https://github.com/syscall97/bloodonate
https://github.com/syscall97/bloodonate
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/syscall97/bloodonate
- Owner: SysCall97
- Created: 2021-04-11T18:14:08.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-12T19:10:06.000Z (about 5 years ago)
- Last Synced: 2025-02-24T06:35:41.271Z (over 1 year ago)
- Language: JavaScript
- Size: 30.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# BlooDonate
## Installation
```bash
git clone https://github.com/kaziMashry/BlooDonate.git
npm install
npm start
```
## Setup
- Add .env file
- Add these variables into .env file:
- URI(mongoDb uri)
- PORT
- JWT_EXPIRE_MINUTE
- JWT_SECRET
## What is BlooDonate repository?
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-
1. all the blood donors of a certain area(of any blood group),
2. all the blood doner of a particular blood group(of any area),
3. all the blood donor of a certain area with a particular blood group
## Technology used
- Node Js
- Express Js
- MongoDB
- Mongoose
- JWT
## Authentication
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.
## API list
1. /user/signin (POST)
This route is to signin as an user.
```bash
reqBody = {
"name": ,
"email": ,
"password":
}
```
2. /user/login (GET)
This route is to login as an user.
```bash
reqBody = {
"email": ,
"password":
}
```
3. /user/logout (POST)
This route is to logout as an user.
4. /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.
```bash
reqBody = {
"mobile": ,
"bloodGroup": ,
"area": []
}
```
5. /donor/donorArea (GET)
This route will bring all the donor of a particular area
```bash
reqBody = {
"area":
}
```
6. /donor/donorBloodGroup (GET)
This route will list all the donor of a particular blood group of all regions
```bash
reqBody = {
"bloodGroup":
}
```
7. /donor/donorBloodGroupArea (GET)
This route will list all the donor of a particular blood group of a particular area
```bash
reqBody = {
"area": ,
"bloodGroup":
}
```
**Resume:** [https://drive.google.com/file/d/16hc-Pd4QrOeXGg8khFc2sq3RYKZD833D/view]