A production-ready metro services platform for Jaipur Metro Rail Corporation featuring journey planning, complaint management, and admin analytics.
- Journey Planner: Real-time fare calculation, route optimization, travel time estimation
- Complaint Management: Multi-step form, reference tracking, evidence upload
- Admin Dashboard: Real-time analytics, SLA monitoring, sentiment analysis
- Responsive Design: Mobile-first architecture
| Layer | Technology |
|---|---|
| Frontend | Next.js 16, TypeScript, Tailwind CSS, shadcn/ui |
| Backend | Next.js API Routes (Serverless), In-memory data store |
| Deployment | Netlify with automatic function handling |
| Node.js | 20.14.0 (pinned via .nvmrc) |
client/
├── app/
│ ├── page.tsx # Journey planner (home)
│ ├── complaint/page.tsx # Multi-step complaint form
│ ├── track/page.tsx # Track complaint status
│ ├── admin/page.tsx # Admin dashboard analytics
│ └── api/
│ ├── fare/ # Fare calculation
│ ├── complaints/ # Complaint CRUD
│ └── stations/ # Station data
├── lib/
│ ├── fare-calculator.ts # Fare algorithm + stations
│ ├── data-store.ts # Type-safe data storage
│ └── admin-utils.ts # SLA + sentiment analysis
├── components/ # Reusable UI components
└── types/ # TypeScript definitions
| Method | Endpoint | Purpose |
|---|---|---|
| GET | /api/fare |
Get all stations |
| POST | /api/fare |
Calculate fare & route |
| POST | /api/complaints |
Submit complaint |
| GET | /api/complaints |
List all complaints |
| GET | /api/complaints/[id] |
Get complaint details |
Fare Calculation:
- Same line: ₹5 per station (up to ₹25)
- Inter-line transfer: ₹30 base + ₹2 per station
- Travel time: 2.5 min per station + 5 min buffer
Admin Metrics:
- SLA monitoring with breach alerts
- Sentiment analysis of complaints
- Station-wise priority heatmap
- Resolution rate tracking
npm install
npm run dev
# Open http://localhost:3000npm run build
npm startJourney Planner:
- Select source/destination stations
- Verify fare calculation matches algorithm
- Test swap button functionality
- Check responsive mobile layout
Complaint System:
- Submit via
/complaint - Verify reference ID generation
- Track using reference at
/track - Confirm entry in
/admindashboard
Admin Dashboard:
- Real-time data updates (10s interval)
- SLA breach highlighting
- Sentiment analysis accuracy
- Filter and sort functionality
- TypeScript strict mode
- ESLint + Prettier configured
- Zod schema validation
- Type-safe API routes
- Error boundaries and fallbacks
- Database integration (MongoDB/Supabase)
- Email/SMS notifications
- Real-time train tracking
- Payment gateway integration
- Multi-language support (Hindi/English)
- Business logic in
client/lib/ - API routes become serverless functions on Netlify
- Data is in-memory (ready for database migration)
- SLA defaults: 24h assignment, 72h resolution
- Sentiment analysis based on complaint description
MIT - Free for educational use.