A full-stack web application for managing blood donations, donor appointments, requests, analytics, and payments. Built with React (frontend) and Node.js/Express/MongoDB (backend).
- User and Admin authentication (JWT-based)
- Donor registration and profile management
- Appointment scheduling and rescheduling
- Blood request creation and fulfillment
- Admin dashboard with analytics and audit logs
- Feedback system
- Stripe payment integration for donations
- Email notifications
- Secure, rate-limited, and CORS-enabled backend
- Frontend: React, Vite, Context API, Axios
- Backend: Node.js, Express, MongoDB, Mongoose
- Payments: Stripe
- Other: Multer (file uploads), JWT, CORS, dotenv
Blood Donation/
├── Backend/ # Node.js/Express/MongoDB backend
└── blood-donation-frontend/ # React frontend
- Node.js (v16+ recommended)
- MongoDB (local or Atlas)
- Stripe account (for payments)
git clone https://github.com/RushiBg/Blood-Donation-Repo.git
cd Blood\ Donationcd Backend
npm installCreate a .env file in Backend/ with the following:
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
STRIPE_SECRET_KEY=your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret
CLIENT_URL=http://localhost:5173
npm start
# or
node server.jscd ../blood-donation-frontend
npm install
npm run devThe frontend will run on http://localhost:5173 by default.
- The backend uses Stripe Checkout for payments.
- Set up a webhook endpoint in your Stripe dashboard to point to
/api/payment/webhookon your backend. - Use the webhook secret in your
.envfile.
POST /api/users/login— User loginPOST /api/admin/login— Admin loginPOST /api/users— User registrationGET /api/appointments— List all appointmentsPOST /api/appointments— Schedule appointmentPUT /api/appointments/:id/reschedule— Reschedule appointmentGET /api/analytics/stats— Admin analyticsPOST /api/payment/create-checkout-session— Create Stripe Checkout sessionPOST /api/payment/webhook— Stripe webhook
- Fork the repo
- Create your feature branch (
git checkout -b feature/YourFeature) - Commit your changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin feature/YourFeature) - Open a Pull Request