DonorLink - A MERN stack web app connecting blood donation prospects directly to donors, facilitating quick responses during emergencies by bypassing traffic in local blood banks.
DonorLink is a web application designed to connect individuals in urgent need of blood donations with nearby donors, avoiding the delays of local blood banks. This system allows prospects to directly connect with interested donors and ensures timely assistance in emergency health situations.
- Direct Donor-Prospect Connection: Connects users with available blood donors without intermediaries.
- Emergency Focused: Aids in time-critical situations by quickly matching donors with those in need.
- Secure Authentication: Utilizes JWT, Crypto-JS, and CORS for secure communication and authentication.
- Automated Emails: Uses Node-Mailer to send notifications to donors.
- Scheduled Cleanup: Node-Cron is implemented to clean up old/expired data.
- Frontend: React.js, Tailwind CSS
- Backend: Express.js, Node.js, MongoDB, EJS (Embedded JavaScript)
- Database: MongoDB for storing donor and prospect information
- Authentication: JWT (JSON Web Token), Crypto-JS for encryption
- Styling: Tailwind CSS for responsive and modern design
- Email Automation: Node-Mailer for sending automated email notifications
- Task Scheduling: Node-Cron for scheduling routine tasks
-
Frontend:
reacttailwindcss
-
Backend:
expressmongoosecorscrypto-jsjsonwebtokennode-cronnodemailer
Ensure you have the following installed:
-
Clone the repository:
git clone https://github.com/your-username/donorlink.git cd donorlink -
Install dependencies:
npm install
-
Set up environment variables:
Create a
.envfile in the root directory and add the following values:MONGO_URI=your_mongo_database_uri JWT_SECRET=your_jwt_secret MAIL_USER=your_email_username MAIL_PASS=your_email_password -
Start the development server:
npm run dev
-
Open your browser and navigate to
http://localhost:3000to access the application.
- User Registration and Login: Prospects and donors can register and log in to access the platform.
- Donor Search: A prospect can search for blood donors by blood type and location.
- Connect with Donors: The system displays available donors and allows for direct messaging.
- Email Notifications: Donors receive an email notification when they match with a prospect.
DonorLink/
│
├── backend/ # Backend server files (Express, MongoDB setup)
│ ├── models/ # Mongoose models for Donor, Prospect, etc.
│ ├── routes/ # API endpoints for donors, prospects, and authentication
│ └── utils/ # Utility functions (mail, cron jobs, etc.)
│
├── frontend/ # React frontend files
│ ├── components/ # React components (UI elements, forms, etc.)
│ ├── pages/ # Pages (Home, Register, Login, etc.)
│ └── services/ # API services (Axios setup)
│
├── public/ # Public assets (images, CSS)
├── .env # Environment variables
├── package.json # Node.js dependencies and scripts
└── README.md # Project documentation
The following API endpoints are available:
- POST
/api/auth/register- Register a new user (prospect or donor) - POST
/api/auth/login- Log in a user - GET
/api/donors- Fetch available blood donors based on location and blood type - POST
/api/prospects/request- Submit a blood request
We welcome contributions! Please fork the repository and create a pull request. For major changes, please open an issue first to discuss what you would like to change.
Feel free to adjust the content as necessary for your project's exact details and repo setup!