MVC Strucutre is being followed.
main.go: Driver Code for all of backend.
models: Database Models
controllers: Various handlers for HTTP Requests
routes: Definitions of Sub-routers
utils: Middlewares and other files common to multiple functions
scripts: Extra scripts (unrelated to the usual flow of the webapp)
docs: Documentation
-
Separate file for each Model.
-
Controller functions to be grouped together by their routes.
-
Each Subroute has a separate file.
In short, don't keep any surprises. Use groupings as per your discretion.
gorilla/mux
jinzhu/gorm
golang-jwt/jwt/v4
Also uses golanglint-ci for linting code.
- Clone the repo and
cdinto it's directory. - Run the following commands
docker-compose build docker-compose up
NOTE: If you face the following issue with docker-compose.
strconv.Atoi: parsing "": invalid syntax
This is because docker-compose is creating arbitrary container not in docker-compose.yml and terminating the starting process.
FIX: Use docker-compose-v1 instead of docker-compose.