1. Install Go
- follow the instructions: https://go.dev/doc/install
2. Clone the repository
3. Install Reflex package (needed for Hot Reload)
- run
go install github.com/cespare/reflex@latest
4. Install swag package (needed for fiber-swagger)
- run
go install github.com/swaggo/swag/cmd/swag@latest
1. Set storage type in .env
:
STORAGE_TYPE=ephemeral
for EphemeralSTORAGE_TYPE=postgres
for Postgres
2a. Start the application (no docker, ephemeral only) with:
make watch
2b. (OR) Start the application (docker, ephemeral & postgres) with:
make start-db
3b. Add database seeding (docker has to run simultaneously in a different terminal):
make seed-db
4b. Stop the application with:
make stop-db
5b. Reset the database with:
make reset-db
make test-all
1. Open http://localhost:5050
2. Click "Add New Server"
3. Set some "Name" in the "General" tab
4. Go to "Connection" tab and set:
- Host name/address:
split-the-bill-postgres-db
- Password:
postgres123
5. Check "Save password" and save the connection
TODO's before we deploy:
Change variables in .env
:
DB_USER
DB_PASSWORD
PGADMIN_EMAIL
PGADMIN_PASSWORD
Remove development flags from docker-compose.yml
:
PGADMIN_CONFIG_SERVER_MODE
PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED
- Swagger API: http://localhost:8080/swagger/
- pgAdmin: http://localhost:5050