Attendance as a Service
Microservice for signing up users for events
Report Bug
|
Request Feature
Table of Contents
Getting Started
The service is a backend GraphQL API which is written in Golang. It uses gqlgen to create strongly typed GraphQL APIs and Entgo as a ORM in front of a PostGreSQL database.
Prerequisites
To start development server you need the following components on your local machine:
- Golang (1.17)
- PostGreSQL (10.0+) (optionally use Docker + Docker Compose build)
Development
make
With Make sure you have Docker running on your computer.
Additionally, make sure you have sourced the environment variables below. This
can be done by putting the environment variables in a file .env
, and sourcing
the environment variables using source .env
in your terminal.
To start development, simply run make
in the project directory.
For more information, please read the Makefile
or execute
make help
in the terminal.
make
Without To start a development server on your machine follow these steps:
-
Set local environment variables required to run the application:
export POSTGRES_USER=admin export POSTGRES_PASSWORD=admin export POSTGRES_DB=a3s
-
Start your PostGreSQL server (
docker-compose up psql
) -
Download Go dependencies with
go mod download
-
Generate
gqlgen
code withgo run github.com/99designs/gqlgen generate
-
Generate Ent entities with
go generate ./ent
-
Migrate the Ent schema to your local PostGreSQL database with
go run cmd/migrate.go
-
Start the server with
go run cmd/main.go