- Framework: gin-gonic
- Authentication: JWT
- Database: PostgreSQL
- ORM: gorm
- Go Version: 1.16
- Create an .env file in the root directory
- Add the following key and values
- PORT=ANY_PORT_VALUE (Eg: 4000)
- DB_CONFIG=POSTGRES_CONNECTION_STRING
command to start server
go run server.go
command to start server using docker-compose
docker-compose up
command to start server using docker-compose in detach mode
docker-compose up -d
- docker >= 17.12.0+
- docker-compose
- Go inside of root directory
- Run this command
docker-compose -f docker-compose.postgres.yml up -d
This Compose file contains the following environment variables:
POSTGRES_USERthe default value is postgresPOSTGRES_PASSWORDthe default value is changemePGADMIN_PORTthe default value is 5050PGADMIN_DEFAULT_EMAILthe default value is pgadmin4@pgadmin.orgPGADMIN_DEFAULT_PASSWORDthe default value is admin
localhost:5432- Username: postgres (as a default)
- Password: changeme (as a default)
- URL:
http://localhost:5050 - Username: pgadmin4@pgadmin.org (as a default)
- Password: admin (as a default)
- Host name/address
postgres - Port
5432 - Username as
POSTGRES_USER, by default:postgres - Password as
POSTGRES_PASSWORD, by defaultchangeme