Back end code repository for SENG499 Summer 2022 project.
To run the backend locally you need to run a Postgres database and the GraphQL server separately. After cloning the repo, follow these steps to get things up and running:
- Run
npm ci
to install the project's dependencies - Run
docker-compose up
to boot up a Docker container running the Postgres database - Run
./setup.sh
to start the GraphQL server athttp://localhost:4000/
. This script does the following:- Runs necessary database migrations
- Seeds the database with dummy data for testing
- Runs the server (automatically reloads with changes to codebase)
To run queries and mutations in Apollo Server that rely on authentication, you need to pass a valid token in the Authorization
request header. You can do that by going to the Headers
tab near the bottom of Apollo Server:
The following tokens can be entered for different testing purposes:
- User:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjM1LCJpYXQiOjE2NTU4MzQyMDJ9.LVAWpkgfM59R1aXVhkjxwMCw9zLlohEKgcxMAunLVn4
- Admin:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjQwLCJpYXQiOjE2NTU4MzQzNjd9.dzq10dUHj-KGGrAbgpjb3AkfqNTUyHwfBcncrBKYoPA
- Keith Radford (@keithradford)
- Anmol Monga (@a-mon)
- Finn Morin (@rcrossf)
- Eduardo Szeckir (@szeckirjr)
- Peter Wilson (@peterrwilson99)