Skip to content

aecsar/go-backend

Repository files navigation

go backend template

A simple go backend template using :

  • gin web framework
  • atlas for migrations
  • sqlc to compile SQL queries to type-safe go code
  • postgresql with the pgx driver
  • docker for easy deployment and good local dx
  • goth to manage multi-provider auth, right now only Google added (see .env.example)

Auth is configured to send a short-lived jwt token. There is an endpoint to refresh the token. There is also a github action configured to run test and migrate database when updates are pushed on prod branch

get started

gh repo clone aecsar/go-backend

# copy .env.example to .env and add values

# start development with docker compose
make dev

# run tests
make test

# run coverage
make coverage

# create a new migration
# make sure to have atlas installed
curl -sSf https://atlasgo.sh | sh

# create the migration
# make sure to have sqlc installed
brew install sqlc
make generate-migration name=your_migration_name

# run migrations
make migrate-up

About

A simple go backend template with gin, sqlc, goth and docker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published