This project uses a MongoDB Replica Set, a JWT custom implementation, that you can find in jwtfs -> jwtfs.service.ts
and a JWT Guard in jwtfs -> jwtfs.guard.ts
as protection for certain queries or mutations.
SECRET="SECRET"
JWT_EXP="1h"
MONGODB_URI=mongodb://localhost:27017,localhost:27018,localhost:27019/<database>
REFRESH_ID="<16char>"
REFRESH_IV="<32char>"
NOTE: JWT_EXP Field could be in hours (2h) or minutes (30m)
- Start the MongoDB Cluster
docker-compose -f mongo-replicas.yml up -d
- Local configuration to connect to the MongoDB ReplicaSet
Edit the /etc/hosts file
nano /etc/hosts
Add the following hosts
127.0.0.1 mongo1 mongo2 mongo3
- Start the project
yarn start:dev
- Navigate to the
Apollo Sandbox
http://localhost:3000/graphql