This is a template repository for CS3219 project.
After setting up the environment variables and installing all the package dependencies for the 6 services, a convenient way to run all the 6 services and the frontend concurrently is as follows:
- From the root directory,
cd PeerPressure
- Install npm packages using
npm i
. - Run
npm run dev
.
- Rename
.env.sample
file to.env
. - Create a Cloud DB URL using Mongo Atlas.
- Enter the DB URL created as
DB_CLOUD_URI
in.env
file. - Enter "PROD" as the value for
ENV
in.env
file. - Enter
JWT_SECRET
in.env
file. Eg it can be generated fromrequire('crypto').randomBytes(64).toString('hex')
. - Install npm packages using
npm i
. - Run User Service using
npm run dev
.
- Rename
.env.sample
file to.env
. - Create a Cloud DB URL using Mongo Atlas.
- Enter the DB URL created as
DB_CLOUD_URI
in.env
file. - Enter "PROD" as the value for
ENV
in.env
file. - Enter
JWT_SECRET
in.env
file. Eg it can be generated fromrequire('crypto').randomBytes(64).toString('hex')
. - Install npm packages using
npm i
. - Run User Service using
npm run dev
.
- Rename
.env.sample
file to.env
. - Create a Cloud DB URL using Mongo Atlas.
- Enter the DB URL created as
DB_CLOUD_URI
in.env
file. - Enter "PROD" as the value for
ENV
in.env
file. - Install npm packages using
npm i
. - Run Collaboration Service using
npm run dev
.
- Rename
.env.sample
file to.env
. - Create a Cloud DB URL using Mongo Atlas.
- Enter the DB URL created as
DB_CLOUD_URI
in.env
file. - Enter "PROD" as the value for
ENV
in.env
file. - Enter the Redis URL created as
REDIS_CLOUD_URI
in.env
file. - Install npm packages using
npm i
. - Run Question Service using
npm run dev
.
- Rename
.env.sample
file to.env
. - Create a Cloud DB URL using Mongo Atlas.
- Enter the DB URL created as
DB_CLOUD_URI
in.env
file. - Enter "PROD" as the value for
ENV
in.env
file. - Install npm packages using
npm i
. - Run History Service using
npm run dev
.
- Install npm packages using
npm i
. - Run Communication Service using
npm run dev
.
- Install npm packages using
npm i
. - Run Frontend using
npm start
.
- cd into the service
- Enter the DB TEST URL created as
DB_TEST_URI
in.env
file. - For matching service only: make sure question and history service is running
- Run tests using
npm run test