Skip to content

adriangitvitz/NestApollo-Mongo

Repository files navigation

NESTJS - APOLLO - MONGOOSE - JWTFS

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.

ENV EXAMPLE

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)

Steps to run

  1. Start the MongoDB Cluster
docker-compose -f mongo-replicas.yml up -d
  1. 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
  1. Start the project
yarn start:dev
  1. Navigate to the Apollo Sandbox
http://localhost:3000/graphql

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published