This project is a full-stack Onam festival platform for MIT ADT University. It presents cultural sections, event information, a traditional shopping catalog, and backend-powered order registration with validation, persistence, and email workflows.
The cart and checkout user flow is currently disabled intentionally.
- Overview
- Features
- Tech Stack
- Screenshots
- Quick Start
- Environment Variables
- Project Structure
- API Routes
- Available Scripts
- CI/CD
- Deployment Checklist
- Troubleshooting
- Roadmap
- License
| Module | Description |
|---|---|
| Home Experience | Hero section, cultural visuals, and responsive section navigation |
| Sadya Showcase | Dedicated section for Onam feast details and media |
| Events | Event highlights and informational cards |
| Shopping Catalog | Traditional items catalog view (cart actions disabled for now) |
| Coming Soon | Placeholder area for upcoming modules |
| Order API | Backend order creation/retrieval with server-side validation |
| Email Utilities | Order confirmation and test-email endpoints with modular email service |
| Security Basics | Rate limiting, CORS controls, request IDs, and production-safe diagnostics |
| Layer | Technologies |
|---|---|
| Frontend | React 18, Vite 7, React Router 7, Tailwind CSS 3, Vitest |
| Backend | Node.js 20, Express 4, MongoDB, Mongoose 8, Nodemailer 8, express-validator |
| Infrastructure | Netlify (frontend), Render-compatible backend, MongoDB Atlas/local MongoDB |
| CI/CD | GitHub Actions workflows at .github/workflows/ci.yml and .github/workflows/deploy.yml |
Screenshots below are representative. The live app at onammitadt.netlify.app reflects the current state.
| Home Page | Events Page | Shopping |
|---|---|---|
![]() |
![]() |
![]() |
Additional pages like Sadya, Shopping, and Coming Soon are available through the main navigation, with responsive layouts tuned for both mobile and desktop.
- Node.js >= 20
- npm >= 10
- MongoDB (local or Atlas)
git clone https://github.com/Gaurav-205/Onam.git
cd Onam
cd backend && npm install
cd ../frontend && npm installBackend:
cp backend/.env.example backend/.envFrontend:
cp frontend/.env.example frontend/.envPowerShell (Windows) alternative:
Copy-Item backend/.env.example backend/.env
Copy-Item frontend/.env.example frontend/.env# Terminal 1
cd backend && npm run dev
# Terminal 2
cd frontend && npm run devFrontend: http://localhost:5173
Backend: http://localhost:3000
Health endpoint: http://localhost:3000/health
- Open the frontend and browse Home, Events, and Shopping sections.
- Open backend health endpoint and confirm API status is returned.
- If checkout is intended for local testing, set
CHECKOUT_ENABLED=trueinbackend/.env.
| Variable | Required | Description | Example |
|---|---|---|---|
NODE_ENV |
No | Runtime mode (development or production) |
development |
PORT |
No | Backend listening port | 3000 |
FRONTEND_URL |
Yes | Allowed CORS origins (comma-separated for multiple) | http://localhost:5173,https://onammitadt.netlify.app |
MONGODB_URI |
Yes | MongoDB connection string | mongodb://localhost:27017/onam-festival |
CHECKOUT_ENABLED |
No | Enables order creation route (POST /api/orders) |
false |
UPI_ID |
Recommended | UPI target shown in config endpoint | your-upi-id@ybl |
WHATSAPP_GROUP_LINK |
Optional | Group invite link for responses/emails | https://chat.whatsapp.com/... |
EMAIL_USER |
Optional | Sender email for notifications | example@gmail.com |
EMAIL_PASSWORD |
Optional | App password/SMTP password | xxxx xxxx xxxx xxxx |
EMAIL_SERVICE |
No | Predefined service (gmail, outlook, etc.) |
gmail |
EMAIL_FROM_NAME |
No | Display sender name | Onam Festival - MIT ADT University |
EMAIL_HOST |
Optional | Custom SMTP host | smtp.example.com |
EMAIL_PORT |
No | SMTP port | 587 |
EMAIL_SECURE |
No | Use secure SMTP (true/false) |
false |
EMAIL_DEBUG |
No | Extra email debug logs | false |
LOG_LEVEL |
No | Logging verbosity | info |
| Variable | Required | Description | Example |
|---|---|---|---|
VITE_API_BASE_URL |
Yes | Backend base URL (without forcing /api) |
http://localhost:3000 |
Notes:
- Frontend automatically appends
/apiwhere needed. - In production, if
VITE_API_BASE_URLis missing, frontend falls back to same-origin.
Onam/
├── .github/
│ └── workflows/
│ ├── ci.yml
│ └── deploy.yml
├── backend/
│ ├── config/
│ ├── middleware/
│ ├── models/
│ ├── routes/
│ ├── utils/
│ │ ├── email/
│ │ ├── emailService.js
│ │ ├── logger.js
│ │ └── rateLimiter.js
│ ├── scripts/
│ │ └── syntax-check.js
│ ├── server.js
│ └── package.json
├── frontend/
│ ├── public/
│ ├── scripts/
│ ├── src/
│ │ ├── components/
│ │ ├── config/
│ │ ├── constants/
│ │ ├── data/
│ │ ├── hooks/
│ │ ├── pages/
│ │ └── utils/
│ └── package.json
└── README.md
| Method | Path | Purpose |
|---|---|---|
GET |
/health |
API health + database connectivity status |
GET |
/api/config |
Public runtime config (upiId, communication links) |
POST |
/api/orders |
Create a new order (disabled unless CHECKOUT_ENABLED=true) |
GET |
/api/orders/:orderId |
Fetch order by MongoDB order id |
GET |
/api/orders?studentId=... |
Query orders by studentId, email, or status |
PATCH |
/api/orders/:orderId/status |
Update order status |
GET |
/api/test-email |
Email transport diagnostic |
POST |
/api/test-email-send |
Send a test email to a provided address |
GET |
/api/email-diagnostics |
Safe email configuration status |
curl -X POST http://localhost:3000/api/orders \
-H "Content-Type: application/json" \
-d '{
"studentInfo": {
"name": "Test Student",
"studentId": "MITADT2026XYZ",
"email": "student@example.com",
"phone": "9876543210",
"course": "B.Tech",
"department": "Computer Science",
"year": "2nd Year",
"hostel": "Hostel A"
},
"orderItems": [
{
"id": "mundu-001",
"name": "Mundu",
"quantity": 1,
"price": 280,
"total": 280
}
],
"payment": {
"method": "cash"
},
"totalAmount": 280
}'Order query notes:
- At least one query filter is required for
GET /api/orders. - Supported filters:
studentId,email,status,page,limit.
| Script | Description |
|---|---|
npm run dev |
Start Vite dev server |
npm run build |
Create production build |
npm run build:prod |
Build with NODE_ENV=production |
npm run preview |
Preview built frontend |
npm run preview:prod |
Preview on host/port suited for deployment checks |
npm run lint |
Run ESLint |
npm test |
Run Vitest |
npm run test:ui |
Run Vitest UI |
npm run test:coverage |
Run tests with coverage |
npm run optimize:images |
Optimize frontend images |
npm run optimize:large-image |
Optimize large image assets |
| Script | Description |
|---|---|
npm run dev |
Start backend with nodemon |
npm start |
Start backend normally |
npm run prod |
Start backend in production mode |
npm test |
Run backend syntax checks |
npm run test:email |
Run email testing utility |
| Workflow | Trigger | What it does |
|---|---|---|
| ci.yml | Push / PR to main/master | Runs backend tests and frontend lint, tests, and build |
| deploy.yml | After ci.yml success on main/master or manual run | Builds deploy artifact and prepares deployment |
Before production deployment, verify:
FRONTEND_URLincludes deployed frontend origin(s).MONGODB_URIpoints to production Atlas cluster.CHECKOUT_ENABLED=trueonly when checkout should be publicly live.UPI_IDis configured for payment instructions.EMAIL_USERandEMAIL_PASSWORDare set if confirmations are required./healthreportsdatabase: connectedafter deployment.
If backend startup reports port conflict, set a different PORT in backend/.env.
PORT=3001
If MongoDB is not running locally (e.g. MONGODB_URI is disconnected), the backend will automatically enter In-Memory Fallback Mode in development.
This enables you to:
- Access the API and configure checkout features successfully.
- Submit mock order registrations.
- Query and update orders in-memory.
The health endpoint /health will report a degraded status ("status":"degraded") while MongoDB is offline, but all API endpoints will continue to work normally by persisting state in memory.
If you want to run with a real database, verify MongoDB is running locally or that your MONGODB_URI is valid.
Add your frontend origin to FRONTEND_URL in backend/.env.
Use these routes for safe email debugging:
GET /api/test-emailGET /api/email-diagnosticsPOST /api/test-email-send
# Frontend
cd frontend
npm run lint
npm test
npm run build
# Backend
cd backend
npm testThe backend check currently validates JavaScript syntax for all backend files.
- Re-enable cart and checkout flow when payment and operations are finalized.
- Add authenticated admin operations for order management.
- Expand automated API tests beyond syntax validation.
- Add observability dashboard metrics for production usage.
ISC



