Graphql api for sharing newspaper quizzes between friends, including results and statistics
Follows the GraphQL Cursor Connections Specification.
The api is packaged in docker and deployed with github actions to the github registry. A helm template is also deployed with a github action to https://helm.demery.net.
See quizlord-stack for further details about deployment and for the terraform module.
Doppler is used to provide access to secrets, in order to run the app you first need to run
doppler login
doppler setup
If using nixos a flake file is provided to load a shell with all the required dependencies.
nix develop
The following can be run to upgrade the flake.lock file
nix flake update
Afterwards rerun nix develop
and check the new versions installed by the flake match.
node --version
prisma --version
The node and prisma versions may need to be updated to match.
- Prisma: Just the
package.json
version - Node: The
package.json
engine entry, theDockerfile
FROM
and the.nvmrc
file
docker compose up -d
npm ci
npm run db:dev:migrate
npm start
# Perform a local production build
npm run build
# Build a local image tagged with local
docker build -t quizlord-api:local .
# Run local build using the env file
docker run -p 4000:80 --env-file <(doppler secrets download --no-file --format docker) --name=quizlord-api quizlord-api:local
# Cleanup
docker rm quizlord-api && docker image rm quizlord-api:local
- You first to have a local k8s cluster running.
- Ensure doppler is setup with
doppler setup
- Install the doppler operator as described https://docs.doppler.com/docs/kubernetes-operator
- Create the doppler token secret
kubectl create secret generic doppler-token-quizlord-api-secret \ --namespace doppler-operator-system \ --from-literal=serviceToken=$(doppler configs tokens create doppler-kubernetes-operator --plain)
- Create the destination namespace with
kubectl create namespace quizlord
- Create the doppler secret with
kubectl apply -f .k8s/doppler-secret.yaml
- Create the registry pull secret
kubectl create secret docker-registry registry-github-quizlord --docker-server=ghcr.io --docker-username=danielemery --docker-password=REPLACE_ME --docker-email="[email protected]" -n quizlord
- Install using local chart
helm install -n quizlord quizlord-api ./helm
- Cleanup
helm uninstall -n quizlord quizlord-api