How roshantajne/job-scheduling works
Project type and purpose
• Type: Full-stack MERN (MongoDB, Express, React, Node.js) web application
• Purpose: A job-scheduling portal that:
– Accepts or rejects new job requests based on time and location constraints
– Visualizes scheduled jobs on a calendar/map
– Optimizes routing via a Travelling Salesman Problem (TSP) algorithm
File structure
• Frontend (React):
– project/public: static HTML, manifest, robots.txt
– project/src: React components (Home, About, Map, Form, Details, Service), styling (CSS), images
– project/README.md, package.json: lists React dependencies
• Backend (Node/Express):
– projectserver/server.js: Express entrypoint
– projectserver/routes/api/Job.js: REST endpoints for job CRUD
– projectserver/models/Job.js: Mongoose schema
– projectserver/config/db.js: MongoDB connection logic
– projectserver/vercel.json: deployment config
• Build & Deployment:
– package.json/package-lock.json per folder
– Vercel config for backend
Extract insights from README
• Key features: dynamic distance matrix, TSP optimization, OpenStreetMap and Leaflet integration
• Stack: React UI, Express API, MongoDB data store, third-party mapping/routing APIs
Main components
a. Frontend Client
– React SPA loaded via index.html
– UI modules: Calendar View, Job Form, Map View (Leaflet + OpenStreetMap), Navbar
b. Backend API Server
– Express.js app exposing REST endpoints (/api/jobs)
– Business logic layer: scheduling rules, time/location validation, TSP solver
– Data access layer: Mongoose ODM connecting to MongoDB
c. Database
– MongoDB instance storing Job documents (job metadata, time windows, locations)
d. External Services
– OpenStreetMap API for base maps
– Leaflet Routing Machine for route queries
e. Optional: CI/CD / Hosting
– Vercel or other hosting for serverless functions
– Static hosting for React build
Relationships and data flow
• User interacts with React UI → triggers API calls (fetch jobs, submit new job)
• API Server receives requests →
– Validates request
– Queries MongoDB for existing jobs
– Invokes TSP algorithm + routing API to check job inclusion
– Persists new job or returns rejection
• Server responds with JSON → UI updates state and map visualization
• Component calls Leaflet + OpenStreetMap for rendering routes
Architectural patterns & principles
• Client-Server separation (UI vs API)
• MVC-like layering on backend (Routes → Controllers/Business Logic → Models)
• Stateless REST endpoints
• Modular React components for reusability
• Use of third-party services abstracted behind service layer
Technologies & frameworks
• React, React Router, CSS modules
• Node.js, Express.js, Mongoose
• MongoDB
• OpenStreetMap, Leaflet, Leaflet Routing Machine
• TSP algorithm module (custom)
• Vercel (deployment)