All Projects → melardev → GoGonicEcommerceApi

melardev / GoGonicEcommerceApi

Licence: other
Ecommerce Rest API application built in Go with Gin Gonic + Gorm

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to GoGonicEcommerceApi

go-12factor-example
Example the 12factor app using golang
Stars: ✭ 20 (-75.31%)
Mutual labels:  gorm, gin-gonic
mytek
Django e-commerce web application with advanced features
Stars: ✭ 27 (-66.67%)
Mutual labels:  ecommerce, e-commerce
Supply
🛍 Supply is a free e-commerce Jekyll theme with Gumroad integration.
Stars: ✭ 24 (-70.37%)
Mutual labels:  ecommerce, e-commerce
E Commerce Db
Database schema for e-commerce (webstores) sites.
Stars: ✭ 245 (+202.47%)
Mutual labels:  ecommerce, e-commerce
DigitalProducts
Sell digital products with Craft Commerce
Stars: ✭ 48 (-40.74%)
Mutual labels:  ecommerce, e-commerce
saleor-sdk
JavaScript/TypeScript SDK for building e-commerce experiences and checkouts with Saleor API.
Stars: ✭ 125 (+54.32%)
Mutual labels:  ecommerce, e-commerce
go api boilerplate
🐶Go (Golang)🚀REST / GraphQL API + Postgres boilerplate
Stars: ✭ 127 (+56.79%)
Mutual labels:  gorm, gin-gonic
Coreshop
CoreShop - Pimcore eCommerce
Stars: ✭ 193 (+138.27%)
Mutual labels:  ecommerce, e-commerce
grav-skeleton-gravcart
The Grav Shopping Cart skeleton
Stars: ✭ 11 (-86.42%)
Mutual labels:  ecommerce, e-commerce
awesome-medusajs
A curated list of awesome resources related to MedusaJS 😎
Stars: ✭ 113 (+39.51%)
Mutual labels:  ecommerce, e-commerce
Prisma Ecommerce
💰A graphql e-commerce real-world fullstack example (backoffice included)
Stars: ✭ 231 (+185.19%)
Mutual labels:  ecommerce, fullstack
react-storefront
An open-source storefront in React.js with Next.js. Built for Headless Commerce, using a modern stack with TypeScript, GraphQL, Apollo, and Tailwind CSS.
Stars: ✭ 265 (+227.16%)
Mutual labels:  ecommerce, e-commerce
Mern Marketplace
A MERN stack based online marketplace application [Full-Stack React Projects]
Stars: ✭ 194 (+139.51%)
Mutual labels:  ecommerce, full-stack
Knowledge-Base
record every requirement and solution here
Stars: ✭ 31 (-61.73%)
Mutual labels:  full-stack, fullstack
Aimeos Symfony
Symfony e-commerce bundle for professional, ultra fast online shops, complex B2B applications and #gigacommerce
Stars: ✭ 194 (+139.51%)
Mutual labels:  ecommerce, e-commerce
fullstack-typescript
A demo project of a full stack typescript application
Stars: ✭ 28 (-65.43%)
Mutual labels:  full-stack, fullstack
Smartstorenet
Open Source ASP.NET MVC Enterprise eCommerce Shopping Cart Solution
Stars: ✭ 2,363 (+2817.28%)
Mutual labels:  ecommerce, e-commerce
Next Ecommerce
⚡️ Quantum Ecommerce. Made with Next.js | GraphQL | Apollo Server | Apollo Client | SSR
Stars: ✭ 186 (+129.63%)
Mutual labels:  ecommerce, e-commerce
kasir
Cashier Management & Inventory Management System
Stars: ✭ 28 (-65.43%)
Mutual labels:  ecommerce, e-commerce
clean-gin
Implementation of clean architecture in Go, Gin with dependency injection.
Stars: ✭ 181 (+123.46%)
Mutual labels:  gorm, gin-gonic

GoGonicEcommerceApi

Table of Contents

Introduction

This is one of my E-commerce API app implementations. It is written in Golang using go-gonic web framework.. This is not a finished project by any means, but it has a valid enough shape to be git cloned and studied if you are interested in this topic. If you are interested in this project take a look at my other server API implementations I have made with:

Full-stack Applications

E-commerce (shopping cart)

Server side implementations

The next to come are:

  • Spring Boot + Spring Data Hibernate + Kotlin
  • Spring Boot + Jax-RS Jersey + Hibernate + Kotlin
  • Spring Boot + mybatis
  • Spring Boot + mybatis + Kotlin
  • Asp.Net Web Api v2
  • Elixir
  • Golang + Beego
  • Golang + Iris
  • Golang + Echo
  • Golang + Mux
  • Golang + Revel
  • Golang + Kit
  • Flask + Flask-Restful
  • AspNetCore + NHibernate
  • AspNetCore + Dapper

Client side implementations

This client side E-commerce application is also implemented using other client side technologies:

Blog/CMS

Server side implementations

The next to come are:

  • Spring Boot + Spring Data Hibernate + Kotlin
  • Spring Boot + Jax-RS Jersey + Hibernate + Kotlin
  • Spring Boot + mybatis
  • Spring Boot + mybatis + Kotlin
  • Asp.Net Web Api v2
  • Elixir
  • Golang + Beego
  • Golang + Iris
  • Golang + Echo
  • Golang + Mux
  • Golang + Revel
  • Golang + Kit
  • Flask + Flask-Restful
  • AspNetCore + NHibernate
  • AspNetCore + Dapper

Client side

The next come are

  • Angular NgRx-Store
  • Angular + Material
  • React + Material
  • React + Redux + Material
  • Vue + Material
  • Vue + Vuex + Material
  • Ember

Simple CRUD(Create, Read, Update, Delete)

Server side implementations

Client side implementations

The next come are

  • Angular NgRx-Store
  • Angular + Material
  • React + Material
  • React + Redux + Material
  • Vue + Material
  • Vue + Vuex + Material
  • Ember
  • Vanilla javascript

CRUD + Pagination

Server side implementations

The next come are

  • NodeJs Express + Knex
  • Flask + Flask-Restful
  • Laravel + Fractal
  • Laravel + ApiResources
  • Go with Mux
  • AspNet Web Api 2
  • Jersey
  • Elixir

Client side implementations

The next come are

  • Angular NgRx-Store
  • Angular + Material
  • React + Material
  • React + Redux + Material
  • Vue + Material
  • Vue + Vuex + Material
  • Ember
  • Vanilla javascript

Social media links

  • Youtube Channel I publish videos mainly on programming
  • Blog Sometimes I publish the source code there before Github
  • Twitter I share tips on programming

WARNING

I have mass of projects to deal with so I make some copy/paste around, if something I say is missing or is wrong, then I apologize and you may let me know opening an issue.

Getting started

  1. go get https://github.com/melardev/ApiEcomGoGonic
  2. Change the .env.example as you need(see warning below)
  3. Rename .env.example to .env
  4. Seed the database passing "create seed" as arguments to the app(read main.go to understand what I mean)

WARNING

The recommended database to use is Postgresql, the other database backends may not work as expected. Unfortunately the MySQL does not work as expected, for example the BeforeSave Hook for User is not able to retrieve the Role model if using MySQL, the same code does work if SQLite, it is weird, because the SQL query generated is valid and it returns a row, but somehow the driver is not able to map it to the user.

Features

  • Authentication / Authorization
  • JWT middleware for authentication
  • Multi file upload
  • Database seed
  • Paging with Limit and Offset using GORM (Golang ORM framework)
  • CRUD operations on products, comments, tags, categories, orders Fetching products page
  • Orders, guest users may place an order Database diagram

What you will learn

  • Golang

  • Golang Go-Gonic web framework

  • JWT

  • Controllers

  • Middlewares

  • JWT Authentication

  • Role based authorization

  • GORM

    • associations: ManyToMany, OneToMany, ManyToOne
    • virtual fields
    • Select specific columns
    • Eager loading
    • Count related association
  • seed data

  • misc

    • project structure

Understanding the project

The project is meant to be educational, to learn something beyond the hello world thing we find in a lot, lot of tutorials and blog posts. Since its main goal is educational, I try to make as much use as features of APIs, in other words, I used different code to do the same thing over and over, there is some repeated code but I tried to be as unique as possible so you can learn different ways of achieving the same goal.

Project structure:

  • models: Mvc, it is our domain data.
  • dtos: it contains our serializers, they will create the response to be sent as json. They also take care of validating the input(feature incomplete)
  • controllers: well this is the mvC, they receive the request from the user, they ask the services to perform an action for them on the database.
  • seeds: contains the file that seeds the database.
  • static: a folder that will be generated when you create a product or tag or category with images
  • services: contains some business logic for each model, and for authorization
  • middlewares: it contains middlewares(golang functions) that are triggered before the controller action, for example, a middleware which reads the request looking for the Jwt token and trying to authenticate the user before forwarding the request to the corresponding controller action

TODO

  • Add model constraints such as not null
  • Refactor the seeding with http://gorm.io/docs/query.html#Select
  • Global Application Error handling
  • Can't Preload field errors:
  • Security, validations, file upload
  • Delete FileUpload if associated tag, category or product deleted
  • Delete Files if tag, category, product fail to be saved
  • Use pointers as function parameters instead of passing them by value as I did in many
  • For some reason /api/products does not work on browsers due to CORS issues, /api/home does work, on postman all routes work ....

Resources

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].