modulepackage
0.0.0-20250203135112-b7964813f34e
Repository: https://github.com/matteoaricci/jot-api.git
Documentation: pkg.go.dev
# README
Welcome to the Jot API
Jot is a journaling application with an emphasis of tracking how you're doing over time
Set Up Instructions
Initial Set up
- Download and install golang
- Install Dependencies
go mod download
- Run application
go run main.go
- Application will run on port
8080
by default. Add optional ENV variable,SERVER_PORT
, to run command to set up different port number - Navigate to endpoint
/api/healthz
. If all is set up correctly you should receive a 200 response.
Database Setup
The project uses a postgres database with GORM for the orm. Migrations are handled using Goose Variables should be set accordingly inside a dev.env
file.
Database connection requires the following:
- DB_HOST=
your_host_here
- DB_PORT=
your_port_here
- DB_USERNAME=
your_username_here
- DB_PASSWORD=
your_password_here
- DB_NAME=
your_db_name_here
- DB_SSLMODE=
your_ssl_mode_here
Host, port, and ssl mode will default to localhost, 5432, and disable respectively but username, password, and db name MUST have a value set
Goose requires the following environment variables to run properly:
- GOOSE_DRIVER=
postgres
- GOOSE_DBSTRING="
host=your_host_here user=your_username_here password=your_password_here dbname=db_name_here port=your_port_here sslmode=your_ssl_mode_here
" - GOOSE_MIGRATION_DIR="
./db/migrations/
"
You need the goose db string values to match your DB env values