- Migration
- Seeder
- Command
- MVC model
- Gorm, Gin, PostgreSql
- Docker, docker-compose
- Authentication (login, register, logout)
- Authorization (admin, user)
- Cart basic + checkout
- Manage resource (product, category) for admin
- Manage profile for user
- Install Golang with version > 1.2, Install gow to run server local: https://github.com/mitranim/gow
- git clone https://github.com/donghuynh99/go-ecommerce-api.git
- Go to project
- go mod tidy
- docker-compose up -d (Create postgreSql and get credential to connect)
- cp .env.example .env
- Update .env file like this
APP_NAME=Ecommerce API
APP_PORT=8080
APP_URL=http://localhost:8080
POSTGRESQL_DB=ecommerce_api
POSTGRESQL_HOST=localhost
POSTGRESQL_PORT=5432
POSTGRESQL_USER=root
POSTGRESQL_PASSWORD=pass
LANGUAGE=en
- go run main.go db:migrate
- go run main.go generate:admin [email protected] pass (You also change email and password that you want)
- Import file collection ecommerce_api.json to your postman application. And Import file enviroment ercommerce_api_environment.json.
- ~/go/bin/gow run . To serve your application.