lab-64 / split-the-bill-server

Backend for the Split the Bill App
4 stars 0 forks source link
golang gorm postgresql

Split The Bill - Server

Go Webserver Testing


Developer Get Started

1. Install Go

2. Clone the repository

3. Install Reflex package (needed for Hot Reload)

4. Install swag package (needed for fiber-swagger)

Start Application

1. Set storage type in .env:

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

Testing

make test-all

pgAdmin

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:

5. Check "Save password" and save the connection


Deyploment

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

URLs