This is a Blood Donation Management System built with Node.js, Express, and the EJS templating engine. The application helps manage blood donation records, donors, and recipients with a user-friendly web interface.
- User Authentication (login/signup)
- Donor Management
- Recipient Management
- Blood Donation Record Tracking
- Admin Dashboard
- Responsive Web Interface
- Node.js
- Express.js
- EJS (Embedded JavaScript templates)
- MongoDB (with Mongoose ODM)
- Bootstrap (for frontend styling)
- Passport.js (for authentication)
Before running the application, ensure you have the following installed:
- Node.js (v14 or higher)
- npm (comes with Node.js)
- MongoDB (either local instance or MongoDB Atlas connection)
-
Clone the repository:
git clone https://github.com/nikeshadhikari9/Blood-Donation-EJS.git cd Blood-Donation-EJS -
Install dependencies:
npm install
-
Set up environment variables:
- Create a
.envfile in the root directory with the following content:MONGODB_URI=your_Mongodb_URI (dont forget to also specify the database to be used at the end) SESSION_SECRET=your_session_secret_here (you can have any value for this key) PORT=3000 CLOUDNAME=your_cloudinary_name API_KEY=your_cloudinary_key API_SECRET=your_cloudinary_secret GEMINI_API_KEY=your_gemini_api_key APP_EMAIL=your_email APP_PASSWORD=your_email_password APP_PORT=465 DOMAIN=http://localhost:4001/ HUGGINGFACEAPI=Bearer your_token - Replace all env variables values with your actual values.
- Create a
-
Go to the src folder:
cd src -
Start the server:
npm start
-
The application should now be running at:
http://localhost:3000
Blood-Donation-EJS/
├── public/ # Static assets (CSS, JS, images)
├── src
├── controllers/ # Route controllers
├── db # Connects to database
├── json # Has rules for donating blood
├── middlewares # Middlewares for apis
├── models/ # MongoDB models
├── routes/ # Express routes
├── services/ # services
├── app.js # Main application file
├── index.js # Index file that starts the server
├── views/ # EJS files (frontend)
├── package.json # Project dependencies
└── .env # Environment variables
/- Home page/auth/login- User login/auth/signup- User registration/dashboard- Main dashboard (after login)/donor- Donor management/recipient- Recipient management/blood- Blood donation records
The application includes admin functionality. To create an admin user, you can either:
- Manually set
isAdmin: truein the user document in MongoDB, or - Use the signup form with a special admin code (if implemented in the application).
Contributions are welcome! Please fork the repository and submit a pull request with your changes.
This project is open-source. Please check the repository for specific licensing information.
Nikesh Adhikari