- Install Postgres 13, Go 1.13+, Redis-Server
- Create postgres user, password, database for the project
- Open .env file and update all required details
- Make sure postgres and redis services are running
- Hit go run main.go in the terminal
Expand
Some parts forked from @mindinvertory under MIT License
- gorm : It is the ORM library in Go which provides user friendly functions to interact with database. It supports features like ORM, Associations, Hooks, Preloading, Transaction, Auto Migration, Logger etc.
- gin : Gin is a web framework for Go language. Here gin is used for increase performance and productivity.
- godotenv : Basically used for load env variables from .env file.
- fresh : It is a live reloader for go-lang, handy for developers when making frequent changes to the code.
The root directory of this repository is named teastore
having the following path:
$GOPATH/src/github.com/<username>/teaStore/
If you have Fresh installed, simple type fresh
in console, else go run main.go
.
To get rid of the debugger warning logs, set mode to release
in the .env
file
Basically contains the helper functions used in returning api responses, HTTP status codes, default messages etc.
Contains handler functions for particular route to be called when an api is called.
Contains helper functions used in all apis
Middleware to be used for the project
Database tables to be used as models struct
Resources contains all structures other than models which can be used as responses
Resources define the routes for your project
It is optional, but if you want to insert lots of dummy records in your database, then you can use seeder.
All the core apis for your projects should be within services.
It is generally for storage purpose.
Contains the HTML templates used in your project
Contains environment variables.