RC Tech Club central API server for applications
- Prisma CLI
- npm
- Docker and docker-compose
- After you clone the repository, you should notice a
.env.sample
file in the root directory. Copy that file as.env
, and put in the values below.
# database
DATABASE_URL=postgresql://prisma:prisma@localhost:5432/prisma?schema=prisma$default
DB_USER=prisma
DB_PASSWORD=prisma
# application
PHOENIX_SECRET=phoenix
GOOGLE_CLIENT_ID=798725565697-sfibjdadpcan9ks908dnl8p5k1dncmoq.apps.googleusercontent.com
NODEMAILER_PASSWORD=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
SLS_SECRET=sls-secret
- Once you have the above, you will need to deploy migrations to the postgres database using
prisma migrate
.
# Spin up the postgres database
docker-compose up -d # Runs in detached mode
# Migrate
npx prisma migrate deploy
- Generate prisma client based on the database schema.
# Generate
npx prisma generate
- Start the server in
dev
mode.
npm run dev
- To test your graphql resolvers with the graphql playground, spin up the server with
npm start
, and initiate a local instance of ladybird. Login with ladybird, so that your auth token is stored in cookies. To verify if your token is present, open your browser's developer console, and look intoapplication cookies
; our token is stored asRCTC_USER
.
Open the graphql playground, and change your settings for request-credentials
from the default omit
to same-origin
.
Make sure to save your settings.