Golang APIs for online shopping microservices.
this project contains backend APIs and logic for online shopping microservices powered by Go,Gin,Redis and MongoDB
Application runs on Go 1.14 And redis and MongoDB.
- [Project Structure](#Project Structure)
- [Install application](#Install application)
- Configuration
- Features
- [Services and Database dependencies](#Services and Database dependencies)
.
├── config # all config files is here
├── file # develop yml config file is here
└── test_conf # unit test yml config file is here
├── console # console commands dicretory
└── cmd # all console commands is here
├── constants # some static values is here
├── controller # controller layer directories. all server controllers logics is here
└── http # a directory for http controllers
├── docs # any documentation is here swagger,flowchat,gif , ....
├── domain # we save project struct/models in here
├── logic # business logic layer directories. all server business logics is here
├── repository # repository layer directories. all server repository logics is here
├── rediskeys # redis keys names is here
├── services # request and connections to therd party servers is here
├── go.mod # go modules file
├── go.sum # go modules file
├── main.go # project started in this file
cd micro-service
To installation dependencies use go mod vendor
command.
by default app server in running read config file from ./file/cofigs.yml if you want to change some service or database address or ports must edit config file
to setup config you can set your settings into yml file.
To run application on development config use
go run main.go
some time we need some worker to do some jobs periodically we user cobra
to write console commands to do some jobs.
to run worker to get real time users go to console
and run
go run main GetUsers
we have multiple http route :
v1/discounts/discounts
POST
: api for create discount ( enter the new discount code)v1/discounts/win/user
GET
: api for get a list of real time winning usersv1/wallet/info/{phone_number}
GET
: api for get a wallet information
his server need redis
andMongoDB
servers to start running.