Before getting started, ensure you have done the following things:
- Install
Go
on your machine - Install
Postgres
andRedis
either directly on your machine or via Docker - Register for a Mailtrap account for sending test emails
To start this repo on your machine, do the following:
- Clone this repo
- Go to the repo directory on your machine
- Execute
go mod tidy && go mod vendor
- Setup the environment variables in
./.env
file (see below for details) - Start
Postgres
andRedis
services - Run
create_db
for creating the Postgres DB - Run
make migrate_up_all
for running the DB migrations - Finally,
go run ./cmd
Setup the following environment variables in ./.env
file:
DB_USER="dbUser"
POSTGRES_PASSWORD="somepassword"
POSTGRES_URL="postgresql://root:secret@localhost:5433/fit_forge?sslmode=disable"
AUTH_SECRET_KEY="sup3rs3cr3t"
REDIS_DSN="localhost:6379"
EMAIL_HOST="https://sandbox.api.mailtrap.io"
MAILTRAP_API_KEY="API_KEY"