Skip to content

mensatt/backend

Repository files navigation

Mensatt Backend

Build & Test Development Deployment

The backend repository for Mensatt written in go.

Requirements

  • Docker & Docker Compose
  • Go 1.22.4

Building

  • Generate all: make generate
  • Run only gqlgen: make gqlgen
  • Run only entc: make entc

Running

  • Start dev server: make up
  • Stop the server: make down

Migrations

Migrations require Atlas to be installed. See here for installation instructions.

Create a new migration:

atlas migrate diff <migration_name> \
 --dir "file://internal/database/migrations" \
 --to "ent://internal/database/schema" \
 --dev-url "postgres://mensatt:mensatt@localhost:5432/mensatt?search_path=public&sslmode=disable" \
 --format '{{ sql . "	" }}'

The --format flag uses a tab as indentation. If you want to manually edit this command you can use ctrl + v + tab to insert a tab character in your shell.