Repository for backend code of bequest keeper using encryption algorithms.
- Download the code.
- Explore to the root folder in termnal.
- Execute npm install.
- Execute nodemon.
Server will run locally.
-
index.js - It is the main file which runs the server.
-
routes - This folder contains routers for API end points. It contains accountRouter.js (/account) and userRouter.js (/users) files which have API endpoints.
-
In accountRouter.js,
url Type Body /register POST name,email,phone,password /login POST email,password /edit PUT email,password,phone -
In userRouter.js,
url Type Body Headers / POST secretkey,nominee1,nominee2,nominee3 text,authorization(token) /info POST secretkey authorization(token) /edit PUT secretkey,nominee1,nominee2,nominee3 text,authorization(token) /nominee POST userid,secretkey
-
-
models - This folder contains accountModel.js and userModel.js files which have schema designs for user bequest and user info.
- userid - User's ID
- token - Encrypted string of JWT token
- timestamps - Time at which user stores secret message
- name - User's name
- email - User's E-mail
- phone - User's Phone Number
- password - User's password
- lastlogins - Time at which user logs in
- filledDetails - Flag which checks if user has stored his secret
- mailsent - Flag which checks if mail has been sent to remind user to login
- nominee1 - Nominee with whom user wants to share his secret message
- nominee2 - Nominee with whom user wants to share his secret message
- nominee3 - Nominee with whom user wants to share his secret message
-
utils.js - This file contains middlewares for user authentication and generating jwt token
- User authentication using JWT
- Encrypting user data using CryptoJS AES aLgorithm
- Decryption using reverse AES
- RestAPIs using Node/Express and MongoDB
- Periodic mail sending functionality using Nodemailer and SMTP