A comprehensive full-stack web application for intelligent logistics management with real-time tracking, route optimization, and delay prediction.
- Real-time Order Tracking: Live tracking of delivery orders with status updates
- Route Optimization: AI-powered route calculation and traffic avoidance
- Delay Prediction: Advanced algorithms predict potential delays before they occur
- Weather Integration: Real-time weather data impacts delivery planning
- Smart Reassignment: Automatic order reassignment based on employee availability
- Customer Portal: Track orders, reschedule deliveries, update addresses
- Employee Portal: Manage orders, view routes, handle logistics operations
- 45-Minute Rule: Customer actions restricted within 45 minutes of delivery
- Employee Permissions: Employees can reassign orders and notify customers
- Workload Management: Automatic detection of overloaded employees
- React.js with TypeScript
- React Router for navigation
- Axios for API calls
- Leaflet.js + OpenStreetMap for mapping
- CSS with clean white/blue design
- Node.js + Express.js
- RESTful APIs for all operations
- Mock Data with realistic scenarios
- CORS enabled for frontend communication
- OSRM for routing and optimization
- OpenWeatherMap for weather data
windsurf-project-2/
βββ frontend/ # React frontend
β βββ src/
β β βββ components/ # React components
β β βββ App.tsx # Main app component
β β βββ index.tsx # Entry point
β βββ public/
β βββ package.json
β βββ tsconfig.json
βββ backend/ # Node.js backend
β βββ data/
β β βββ mockData.js # Mock data for employees/orders
β βββ routes/ # API routes
β β βββ employees.js
β β βββ orders.js
β β βββ logistics.js
β βββ services/ # Business logic services
β βββ server.js # Express server
β βββ .env # Environment variables
β βββ package.json
βββ README.md
- Node.js (v16 or higher)
- npm or yarn
-
Install Backend Dependencies
cd backend npm install -
Install Frontend Dependencies
cd frontend npm install
-
Start Backend Server (Port 5000)
cd backend npm start -
Start Frontend Development Server (Port 3000)
cd frontend npm start -
Access the Application
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
- Health Check: http://localhost:5000/health
The system includes 5 realistic scenarios:
- EMP001 (Rajesh): Normal workload, active
- EMP002 (Priya): Overloaded (6/6 orders)
- EMP003 (Amit): On break with weather delay
- EMP004 (Sunita): Normal workload
- EMP005 (Vikram): Normal workload
- ORD001: Normal delivery in transit
- ORD002: Heavy traffic delay scenario
- ORD003: Weather delay (heavy rain)
- ORD004: Successfully delivered
- ORD005: Express delivery in progress
- ORD006: Pending assignment
- Employee IDs: EMP001, EMP002, EMP003, EMP004, EMP005
- Password: password123 (same for all employees)
- Order IDs: ORD001, ORD002, ORD003, ORD004, ORD005, ORD006
- No login required - just enter order ID
GET /api/employees- Get all employeesGET /api/employees/:id- Get employee by IDPOST /api/employees/login- Employee loginGET /api/employees/available/:orderId- Get available employees for reassignment
GET /api/orders- Get all ordersGET /api/orders/:id- Get order by IDPUT /api/orders/:id/reassign- Reassign order to different employeePUT /api/orders/:id/customer-action- Customer actions (reschedule/update address)GET /api/orders/recommendations/list- Get recommended order IDs
GET /api/logistics/routes/:orderId- Get route informationGET /api/logistics/route/optimize- Get optimized routeGET /api/logistics/weather/:location- Get weather dataPOST /api/logistics/predict-delay- Predict delivery delaysGET /api/logistics/dashboard- Get dashboard analytics
- Clean & Professional: White and blue color scheme
- Minimal UI: Inspired by TVS Supply Chain and Amazon Logistics
- Responsive: Works on desktop and mobile
- Accessible: Semantic HTML and ARIA labels
- β Order tracking with real-time status
- β Weather information (if delay is weather-related)
- β Route visualization
- β Reschedule delivery (45-minute rule applies)
- β Update address (45-minute rule applies)
- β Recommended order IDs for easy testing
- β Login with employee credentials
- β Dashboard with assigned orders
- β Order management (notify, reassign)
- β Weather information for delivery window
- β Route optimization suggestions
- β Solutions for detected issues
- β Real-time workload monitoring
PORT=5000
NODE_ENV=development
WEATHER_API_KEY=your_openweather_api_key_here
OSRM_API_URL=http://router.project-osrm.org
FRONTEND_URL=http://localhost:3000
- Normal Delivery: Standard delivery process
- Overloaded Employee: Employee with maximum orders
- Heavy Traffic: Route with traffic congestion
- Weather Delay: Delivery impacted by rain
- Employee on Break: Unavailable employee scenario
- Live Order Status: Updates reflect across both portals
- Dynamic Reassignment: Changes sync immediately
- Weather Integration: Real-time weather conditions
- Route Optimization: Traffic-aware routing
- Frontend uses TypeScript for type safety
- Backend uses Express.js with middleware
- Mock data provides realistic test scenarios
- All CRUD operations fully functional
- Error handling implemented throughout
- CORS configured for development
For any issues or questions:
- Check the console for error messages
- Verify both servers are running
- Ensure correct API endpoints
- Test with provided mock credentials
Smart Logistics System - Transforming delivery management with intelligent solutions! πβ¨