A comprehensive community-driven web platform designed to connect people seeking help with those willing to provide it. HelpCamp combines a peer-to-peer help forum with real-time vaccine availability tracking and notifications.
- Features
- Tech Stack
- Project Structure
- Installation
- Configuration
- Running the Application
- API Routes
- Database Models
- Key Features Explained
- Security
- Contributing
- Author
- License
- Post help requests for:
- Hospital services
- Medicines
- Blood donations
- Create help/service ads
- Browse and search all posts and ads by location, category, and pincode
- Comment on posts to provide help or get more details
- User profiles to manage your posts and activities
- Real-time vaccine slot availability checking using Co-vin API
- Subscription-based alerts for vaccine availability
- Supports multiple age groups and vaccine doses:
- 45+ years (Dose 1 & 2)
- 18-44 years (Dose 1 & 2)
- Email notifications when slots become available in subscribed pincodes
- Automated background job checking every 5 minutes for slot updates
- User registration with validation
- Secure login/logout with Passport.js
- Password reset and recovery functionality
- User profiles with contact information
- Account deletion capability
- Session management with MongoDB store
- Email notifications for:
- New comments on your posts
- Vaccine slot availability alerts
- Password reset links
- Account notifications
- Nodemailer integration with Gmail
- Donation/Payment integration using Razorpay
- Admin panel for system management
- Comment system with timestamps
- Input validation and sanitization
- Responsive design with Bootstrap
- Framework: Express.js (Node.js)
- Database: MongoDB with Mongoose ODM
- Authentication: Passport.js with Local Strategy
- Session Management: Express-session with MongoDB store
- Templating Engine: EJS
- CSS Framework: Bootstrap 5
- Styling: Custom CSS
- Client-side Scripting: Vanilla JavaScript & Axios
- Co-vin API: Vaccine slot availability data
- Google APIs: Gmail integration for emails
- Nodemailer: Email sending service
- Razorpay: Payment processing
- Joi: Schema validation
- Helmet: Security middleware
- mongo-sanitize: NoSQL injection prevention
HelpCamp/
├── index.js # Main application entry point
├── middleware.js # Custom middleware functions
├── package.json # Project dependencies
│
├── models/ # Mongoose schemas
│ ├── user.js # User model with authentication
│ ├── post.js # Help request posts
│ ├── ad.js # Service advertisements
│ ├── comment.js # Comments on posts
│ ├── adComment.js # Comments on ads
│ ├── subscribe.js # Vaccine subscription pincodes
│ ├── userSubs.js # User subscriptions (45+, Dose 1)
│ ├── userSubs2.js # User subscriptions (45+, Dose 2)
│ ├── userSubs18.js # User subscriptions (18+, Dose 1)
│ └── userSubs182.js # User subscriptions (18+, Dose 2)
│
├── routes/ # Express route handlers
│ ├── user.js # Authentication & user management
│ ├── post.js # Help posts and comments
│ ├── help.js # Service ads and help requests
│ └── admin.js # Admin panel routes
│
├── utils/ # Utility functions
│ ├── AppError.js # Custom error class
│ └── wrapAsync.js # Async error wrapper
│
├── views/ # EJS templates
│ ├── home.ejs # Homepage with vaccine tracker
│ ├── payment.ejs # Donation page
│ ├── error.ejs # Error page
│ ├── admin/ # Admin pages
│ │ └── adminPanel.ejs
│ ├── partials/ # Reusable components
│ │ ├── header.ejs
│ │ ├── navbar.ejs
│ │ ├── footer.ejs
│ │ └── flash.ejs
│ ├── post/ # Post-related templates
│ │ ├── show.ejs # View single post
│ │ ├── showPosts.ejs # List all posts
│ │ ├── ad.ejs # Create help ad
│ │ ├── adEdit.ejs # Edit ad
│ │ ├── edit_post.ejs # Edit post
│ │ ├── myads.ejs # User's ads
│ │ ├── myposts.ejs # User's posts
│ │ ├── search.ejs # Search results
│ │ └── comment.ejs # Comment section
│ └── user/ # User-related templates
│ ├── register.ejs # Registration form
│ ├── login.ejs # Login form
│ ├── newProfile.ejs # User profile
│ ├── subscribe.ejs # Vaccine subscription
│ ├── forgot.ejs # Password recovery
│ └── vaccine.ejs # Vaccine information
│
├── public/ # Static files
│ ├── css/ # Stylesheets
│ │ ├── bootstrap.min.css
│ │ ├── style.css
│ │ ├── home.css
│ │ ├── register.css
│ │ ├── login.css
│ │ ├── comment.css
│ │ ├── footer.css
│ │ ├── subscribe.css
│ │ └── showPosts.css
│ ├── js/ # Client-side scripts
│ │ ├── main.js
│ │ ├── home.js # Vaccine finder script
│ │ ├── subscribe.js # Subscription logic
│ │ ├── comment.js # Comment functionality
│ │ ├── validation.js # Form validation
│ │ ├── date.js
│ │ ├── edit.js
│ │ ├── option.js
│ │ ├── otp.js
│ │ └── bootstrap.min.js
│ └── imgs/ # Images and assets
- Node.js (v12 or higher)
- MongoDB (local or cloud instance)
- npm or yarn
-
Clone the repository
git clone <repository-url> cd HelpCamp
-
Install dependencies
npm install
-
Create environment file
touch .env
-
Configure environment variables (see Configuration section)
-
Start the application
npm start
Create a .env file in the root directory with the following variables:
# Database
DB_URL=mongodb://localhost:27017/helpCamp
# or for MongoDB Atlas:
# DB_URL=mongodb+srv://username:password@cluster.mongodb.net/helpCamp
# Environment
NODE_ENV=development
# Session Secret
secret=your_secret_key_here
# Email Configuration (Gmail)
GMAIL_USER=your_email@gmail.com
GMAIL_APP_PASSWORD=your_app_password
# Google OAuth (for Gmail API)
GOOGLE_CLIENT_ID=your_client_id
GOOGLE_CLIENT_SECRET=your_client_secret
GOOGLE_REDIRECT_URI=http://localhost:3000/oauth2callback
GOOGLE_REFRESH_TOKEN=your_refresh_token
# Razorpay (Payment)
RAZORPAY_KEY_ID=your_key_id
RAZORPAY_KEY_SECRET=your_key_secret
# Port (optional)
PORT=3000npm startThe application will start on http://localhost:3000
- Establishes MongoDB connection
- Initializes Passport authentication
- Starts vaccine checking job (runs every 5 minutes)
- Sets up session store
GET /register- Registration formPOST /register- Register new userGET /login- Login formPOST /login- Authenticate userGET /logout- Logout userGET /profile- View user profilePOST /profile- Update profileDELETE /profile- Delete accountGET /forget/username- Forgot username pagePOST /forget/username- Send username recovery emailGET /forgot- Password reset requestPOST /forgot- Send password reset linkGET /reset/:token- Reset password formPOST /reset/:token- Update password
GET /- Create new post formPOST /- Create new postGET /show- View all postsGET /:postid- View single postGET /edit/:postid- Edit post formPUT /edit/:postid- Update postDELETE /:postid- Delete postGET /filter/pc/:pc- Filter posts by pincodeGET /filter/cat/:cat- Filter posts by categoryPOST /:postid/comment- Add comment to postDELETE /comment/:commentid- Delete comment
POST /- Create help advertisementGET /- View help adsGET /:postid- View single help adGET /edit/:postid- Edit help ad formPOST /edit/:postid- Update help adDELETE /:postid- Delete help adPOST /:postid/comment- Add comment to help adGET /subscribe/:pincode- Subscribe to vaccine alertsGET /unsubscribe/:pincode- Unsubscribe from alerts
- Administrative and system management routes
{
firstname: String,
lastname: String,
gender: String,
email: String (unique),
phone: String (unique),
pincode: String,
username: String (from Passport),
resetPasswordToken: String,
resetPasswordExpires: Date
}{
categories: ['hospital', 'medicines', 'blood'],
requirement: String,
location: String,
user: ObjectId (ref: User),
time: String,
date: String,
comments: [ObjectId] (ref: Comment),
pincode: Number
}{
categories: ['hospital', 'medicines', 'blood'],
requirement: String,
location: String,
user: ObjectId (ref: User),
time: String,
date: String,
comments: [ObjectId] (ref: AdComment),
pincode: Number
}{
pincode: [Number] // Pincodes to monitor for vaccine availability
}UserSubs- 45+, Dose 1UserSubs2- 45+, Dose 2UserSubs18- 18+, Dose 1UserSubs182- 18+, Dose 2
The application continuously monitors vaccine availability by:
- Fetching data from the Co-vin API every 5 minutes
- Checking multiple pincodes that users have subscribed to
- Grouping subscriptions by age (45+, 18-44) and dose number
- Sending email notifications when slots become available
- Tracking the last check time to avoid duplicate notifications
Background Jobs:
- subs() - 45+, Dose 1 (runs every 5 minutes)
- subs2() - 45+, Dose 2 (runs every 5 minutes)
- subs18() - 18+, Dose 1 (runs every 5 minutes)
- subs182() - 18+, Dose 2 (runs every 5 minutes)Users can:
- Post about their needs (hospital, medicines, blood)
- Browse posts by others needing help
- Comment with offers of help
- Get email notifications when someone comments on their post
- View helper's contact information in the notification
- Two-way commenting (on posts and help ads)
- Timestamped comments
- Comments include user details for direct contact
- Email notifications to post owners
- Password hashing and salting via Passport
- Session persistence with MongoDB store
- Password reset with time-limited tokens
- Account recovery options
The application implements several security measures:
- Helmet.js - Sets HTTP headers for protection
- MongoDB Sanitization - Prevents NoSQL injection attacks
- Input Validation - Joi schema validation for all inputs
- Password Complexity - joi-password-complexity enforcement
- CORS & Session Security - Secure session configuration
- Environment Variables - Sensitive data stored in .env
- Password Reset Tokens - Time-limited recovery tokens
The application uses Gmail's OAuth2 for sending emails. To set this up:
- Enable 2-factor authentication on your Gmail account
- Generate an App Password for your account
- Update the
.envfile with:- Gmail user email
- App password or refresh token
Emails are sent for:
- Password reset links
- Vaccine availability notifications
- Comment notifications on posts
- Registration confirmations
- Displays vaccine slot finder if user is logged in
- Shows available vaccine slots by pincode
- Real-time integration with Co-vin API
- Subscribe to vaccine alerts
- Select age group (45+, 18+)
- Select dose number (1 or 2)
- Manage subscriptions
- Receive email alerts for availability
- System-wide management
- User and content moderation
- Donation/payment tracking
The application tracks:
- Last check time for each pincode to avoid redundant API calls
- User subscription preferences
- Help post and ad statistics
- Comment threads and engagement
- Custom
AppErrorclass for application-specific errors - Async error wrapper (
wrapAsync) for error handling in routes - Validation error messages
- User-friendly error pages
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
Rushikesh Rajendra Wani
This project is licensed under the ISC License.
- The application uses IST (Indian Standard Time) timezone for date/time operations
- Co-vin API is specific to vaccine availability in India
- The platform is designed to work with Indian pincodes (6-digit format)
- Email service requires valid Gmail credentials and App Password
- Express.js Documentation
- MongoDB Documentation
- Passport.js Documentation
- Co-vin API Documentation
- EJS Documentation
Last Updated: February 2026
For questions or issues, please reach out through the repository's issue tracker.