Live Demo: https://medshare-mruy.onrender.com/
MedShare is a full-stack web application that connects people who have surplus medical supplies with those in need. The platform streamlines donation listings, request fulfillment, and location-based discovery to help essential medical items reach the right people quickly.
- Role-Based Access Control: Three user roles β Donor, Seeker, and Admin β with tailored dashboards and permissions
- Donation & Request Management: Create, edit, and manage donation listings; submit and track requests with lifecycle status updates
- Location-Aware Search: Interactive maps powered by Mapbox to discover nearby available supplies
- Image Uploads: Cloudinary integration for secure image storage and display
- Availability Tracking: Real-time status updates for donations (available, reserved, fulfilled)
- Pentris Review System: Users can leave reviews and ratings for donors and seekers to build community trust
- Admin Tools: Admin dashboard for user management, donation oversight, and platform moderation
- Responsive UI: Mobile-friendly design built with EJS templates, Bootstrap 5, and custom CSS
Backend
- Node.js (v22.6.0)
- Express.js
- MongoDB Atlas (Database)
- Passport.js (Authentication)
- Express-Session (Session Management)
Frontend
- EJS (Embedded JavaScript Templates)
- Bootstrap 5
- Custom CSS
Integrations
- Cloudinary: Image upload and storage
- Mapbox: Interactive maps and location-based search
- dotenv: Environment variable management
Key Packages
@mapbox/mapbox-sdk- Interactive map integrationcloudinary- Image storage and deliveryconnect-flash- Flash messagesconnect-mongo- MongoDB session storecookie-parser- Cookie handlingjoi- Schema validationmethod-override- RESTful routingmulter&multer-storage-cloudinary- Image upload handlingpassport,passport-local,passport-local-mongoose- Authenticationnodemailer- Email service integration
- Node.js (v22.6.0 or higher)
- MongoDB Atlas account (or local MongoDB instance)
- Cloudinary account
- Mapbox account
git clone https://github.com/Rohanpawar9921/MedShare.git
cd MedSharenpm installCreate a .env file in the root directory and add:
# Cloudinary Configuration
CLOUD_NAME=your_cloudinary_cloud_name
CLOUD_API_KEY=your_cloudinary_api_key
CLOUD_API_SECRETE=your_cloudinary_api_secret
# Mapbox
MAP_TOKEN=your_mapbox_token
# MongoDB Atlas
ATLASDB_URL=your_mongodb_atlas_connection_string
# Session Secret
SECRETE=your_session_secret
# Email Configuration (Optional)
SMTP2GO_HOST=smtp.gmail.com
SMTP2GO_PORT=587
SMTP2GO_USERNAME=your_email_username
SMTP2GO_PASSWORD=your_email_password
SMTP2GO_FROM_EMAIL=your_from_email
SMTP2GO_FROM_NAME=Community-MedSharenode init/index.jsnpm startThe app will be available at http://localhost:8080
- Sign up and create a donor account
- Add donation listings with images, description, quantity, and location
- Manage availability and status of your donations
- Receive and respond to requests from seekers
- Sign up and create a seeker account
- Browse available donations using search and map filters
- Submit requests for needed medical supplies
- Track request status and receive notifications
- Leave reviews for donors after successful fulfillment
- Access admin dashboard with elevated privileges
- Manage users, donations, and requests
- Monitor platform activity and moderate content
- Handle reported issues and user disputes
MedShare/
βββ app.js # Main application entry point
βββ cloudConfig.js # Cloudinary configuration
βββ middleware.js # Custom middleware (auth, validation)
βββ schema.js # Joi validation schemas
βββ package.json # Dependencies and scripts
βββ controllers/ # Business logic
β βββ listings.js # Donation listing controllers
β βββ reviews.js # Review controllers
β βββ users.js # User authentication controllers
βββ models/ # MongoDB schemas
β βββ listing.js # Donation listing model
β βββ review.js # Review model
β βββ user.js # User model
βββ routes/ # Express routes
β βββ medpantry.js # Donation routes
β βββ review.js # Review routes
β βββ user.js # Authentication routes
βββ views/ # EJS templates
β βββ listings/ # Donation views
β βββ users/ # Auth & home views
β βββ includes/ # Reusable components (navbar, footer, flash)
β βββ layouts/ # Layout templates
βββ public/ # Static assets
β βββ css/ # Stylesheets
β βββ js/ # Client-side scripts
βββ init/ # Database seeding
β βββ data.js # Sample donation data
β βββ index.js # Seeding script
βββ utils/ # Utility functions
βββ emailService.js # Email service helpers
βββ ExpressError.js # Custom error handling
βββ wrapAsync.js # Async error wrapper
{
title: String, // e.g., "Paracetamol 500mg"
description: String, // Details about the donation
image: {
url: String,
filename: String
},
price: Number, // Quantity available
location: String, // City/area
country: String, // Country
reviews: [Review], // Array of review references
owner: User, // Donor user reference
geometry: { // GeoJSON for maps
type: "Point",
coordinates: [lng, lat]
}
}{
email: String,
username: String,
password: String (hashed),
role: String // donor, seeker, or admin
}{
comment: String,
rating: Number, // 1-5 stars
author: User,
createdAt: Date
}- Password Hashing: User passwords are hashed using Passport Local Mongoose
- Session Management: Secure session handling with express-session and connect-mongo
- Role-Based Authorization: Middleware to protect routes based on user roles
- Input Validation: Server-side validation using Joi for all user inputs
- Environment Variables: Sensitive credentials stored securely in
.envfile - CSRF Protection: Flash messages and form validation
The application is deployed on Render.
- Create a new Web Service on Render
- Connect your GitHub repository
- Set the following:
- Build Command:
npm install - Start Command:
npm start
- Build Command:
- Add all environment variables from
.envin Render dashboard - Deploy!
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/YourFeature) - Commit your changes (
git commit -m 'Add YourFeature') - Push to the branch (
git push origin feature/YourFeature) - Open a Pull Request
- π Bug fixes
- β¨ New features (request/fulfillment workflow, notifications)
- π Documentation improvements
- π¨ UI/UX enhancements
- π Security improvements
- π§ͺ Testing coverage
- Real-time notifications for new requests
- In-app messaging between donors and seekers
- Advanced search filters (medicine type, expiry date)
- Inventory tracking and alerts
- Email notifications for request lifecycle
- Mobile app (React Native)
- Multi-language support
- Analytics dashboard for admins
This project is licensed under the MIT License.
Rohan Pawar
- GitHub: @Rohanpawar9921
- Email: rohan_pawar_aiml@moderncoe.edu.in
Add screenshots of your application here showing key features like donation listings, map view, user dashboard, etc.
Made with β€οΈ for the community