Here is the deployed running app link for given task. In case of running the code in local machine please follow the instructions provided in the Installation section
- username - [email protected]
- password - s
-
Create an
.env
file in the root folder of the project and add the following vars as mentioned below- PORT = 3001
- NODE_ENV = development
- DATABASE_URL =
<mongodb connection url>
- SESSION_SECRET = 8dc8ec2963a4ea4adda9e8575f1124180255316df44b821333
- SESSION_EXPIRY_TIME_IN_MINS = 10
- HASH_ROUND = 10
-
- Please ensure you have mongoDB 3.6 or above installed in your local machine.
- Open
.env
file in the root of the project and update theDATABASE_URL
with db connection url - Please ensure that
DATABASE_URL
has the collection name as well.
-
Once the above mentioned mongoDB setup is done, run the
npm run dataseed
. If you would like to add more data to the any collection, open the collection script file in the./scripts/seeding/collection_data
folder and add the data as you wish. -
Please run the build command
npm run build
-
Please run the start command
npm run start
and openhttp://localhost:3001/
- Below mentioned cases where the logout would happen
- By default the session would expire in 10 mins, irrespective of idleness.
- Although the session touching or session extension can be implemented, extending the session on different page is not implemented.
- As this is a SPA, on refreshing the page after login in home page will logout the user.
- If you want to register/add new user to the app
- open VScode
- Install REST Client extension.
- Open the
request.rest
file and there will be a api section to register (http://localhost:3001/user/register
) - set the credentials snd click send request