go-graphql-api-template

module
v0.0.0-...-77b0776 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2024 License: MIT

README

go-graphql-api-template

Showcase a Go GraphQL API repository structure

Setup local environment

Requirements
  • make
  • go version 1.18
  • docker
Setup a local environment

You can create a local mysql 8 database instance and a redis instance using:

make setup-local-env
make migrate-up

And then you can start and stop your database:

make start-local-env
make stop-local-env
Run database migration

Database migrations are located in the sql/migrations directory. We use the golang-migrate tool to handle migrations: https://github.com/golang-migrate/migrate

You can run migration up and down one step using:

make migration-up
make migration-down
Local docker-compose

You can run the following command from the root of the repository to create the whole environment in a docker container running the following command:

make run

The API will be running locally on the port :80

TODO:
  • Add Postman files
  • make sure it's running
  • Add basic feature like notes/auth
  • Unit test
  • Add CI

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL