A robust backend API for scheduling events, managing invitees across time zones, and sending automated email reminders. Built with Node.js, Express, and MongoDB, this production-grade API supports authentication, event creation, calendar integration, and cron-based notifications.
- You can explore and test all the API endpoints in two ways:
- Open the Swagger UI in your browser for an interactive experience.
- Or check out the full collection on Postman here: View Postman Docs
- Project Overview
- Core Features
- Tech Stack
- Folder Structure
- API Endpoints
- Authentication
- Reminder Job (Cron)
- Environment Variables
- Getting Started
- Future Improvements
This API allows authenticated users to create and manage events, invite participants based on their cities, and automatically send reminder emails before the event starts. Timezone handling is deeply integrated to ensure accuracy in scheduling and notifications. Additionally, invitees receive .ics calendar files compatible with Google and Outlook calendars.
- Secure registration and login via JWT
- Passwords hashed using
bcryptjs
- Create, update, delete events with title, description, location, duration
- Events are scheduled using ISO date-time standards
- Add invitees by email and city
- Automatically detect invitee timezones
- Resend invitations
- Delete invitees from an event
- Uses
city-timezonesanddayjsto localize event times for invitees - Emails show event time in the invitee's local timezone
- Automatically sends
.icsfiles for calendar scheduling via email
- On invite, update, and reminders
- Uses
nodemailerunder the hood
- A cron job runs every minute to check for upcoming events
- Reminders are sent X minutes (default: 45) before event start
- Respects timezones of each invitee
- Backend: Node.js, Express.js
- Database: MongoDB with Mongoose
- Authentication: JWT
- Timezone Management: Day.js + city-timezones
- Email: Nodemailer
- Scheduling: node-cron
- Calendar Files: ical-generator
project-root/
│
├── config/ # DB connection
├── controllers/ # Business logic for auth, events, invites
├── cron/ # Scheduled jobs (reminders)
├── middlewares/ # Auth, error handler
├── models/ # Mongoose schemas
├── routes/ # API endpoints
├── services/ # Email service & ics file generation
├── utils/ # Helper functions (e.g., timezone resolver)
├── .env # Environment configuration
├── server.js # Entry point
└── package.json
POST /register– Create a new userPOST /login– Authenticate and return JWT
POST /– Create an event (auth required)GET /me– Get all events created by the userGET /:id– Get details of a single eventPUT /:id– Update an eventDELETE /:id– Delete an event
POST /:eventId– Add invitee(s) to eventGET /:eventId– List all invitees for eventPOST :eventId//resend/:inviteeId– Resend invite to an inviteeDELETE /:eventId/remove/:inviteeId– Remove an invitee from event
All /api/events and /api/invites routes require a valid JWT in the Authorization header.
Authorization: Bearer <token>
-
File:
cron/reminderJob.js -
Interval: Every minute
-
Logic:
- Finds all events starting within the next X minutes (default: 45)
- Sends reminder emails to each invitee with event details localized to their timezone
- Includes
.icscalendar attachment for seamless scheduling
Create a .env file in the root with the following keys:
PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
EMAIL_HOST=smtp_provider_host
EMAIL_PORT=587
EMAIL_USER=your_email
EMAIL_PASS=your_email_password
REMINDER_TIME_MINUTES=45
- Clone the repository
git clone https://github.com/your-repo/event-scheduler-api.git
cd event-scheduler-api- Install dependencies
npm install- Setup
.env
Create a .env file with the variables mentioned above.
- Start the server
npm start- Health Check
Visit http://localhost:5000/healthz to verify server is up.
- RSVP system (Accept / Maybe / Decline)
- Invitee status tracking
- Swagger API documentation
- Retry queue for failed email deliveries (e.g., using BullMQ + Redis)
- Google Calendar or Outlook syncing
- Role-based permissions (admin vs team members)
- Frontend dashboard (React) for event/invitee management
This project is licensed under the MIT License.