git clone https://github.com/kaziMashry/BlooDonate.git
npm install
npm start
- Add .env file
- Add these variables into .env file:
- URI(mongoDb uri)
- PORT
- JWT_EXPIRE_MINUTE
- JWT_SECRET
BlooDonate repository contains the BE code. Basically here I created some API by which one can regiseter as a blood donor by signing in. On the other hand, one can find-
- all the blood donors of a certain area(of any blood group),
- all the blood doner of a particular blood group(of any area),
- all the blood donor of a certain area with a particular blood group
- Node Js
- Express Js
- MongoDB
- Mongoose
- JWT
There is not much use of authentication in this app. Only one route is protected/authorized. I have developed a custom authentication system with JWT token. Here you'll be given a JWT token and all your requests will be take place based on that token. As soon as you logged out from the application, the token will be blacklisted and no one can use that ever again.
- /user/signin (POST)
This route is to signin as an user.reqBody = { "name": <name>, "email": <email>, "password": <password> }
- /user/login (GET)
This route is to login as an user.reqBody = { "email": <email>, "password": <password> }
- /user/logout (POST)
This route is to logout as an user. - /donor/register (POST)
This route is to register as a blood donor. This is the only protected route where user needs to be logged in to call this API.reqBody = { "mobile": <mobile number>, "bloodGroup": <blood group>, "area": [<list of areas where (s)he is able to donate blood>] }
- /donor/donorArea (GET)
This route will bring all the donor of a particular areareqBody = { "area": <name of the area where blood is required> }
- /donor/donorBloodGroup (GET)
This route will list all the donor of a particular blood group of all regionsreqBody = { "bloodGroup": <required blood group> }
- /donor/donorBloodGroupArea (GET)
This route will list all the donor of a particular blood group of a particular areareqBody = { "area": <name of the area where blood is required>, "bloodGroup": <required blood group> }
Resume: [https://drive.google.com/file/d/16hc-Pd4QrOeXGg8khFc2sq3RYKZD833D/view]