A comprehensive backend service that revolutionizes waste collection operations using AWS Location Services and IoT integration. This system optimizes waste collection routes in real-time, reducing operational costs and environmental impact.
- Real-time Route Optimization: Advanced route optimization using AWS Location Services
- IoT Integration: Smart bin monitoring and real-time data collection
- Cluster Management: Efficient waste collection planning based on geographical clusters
- Fleet Management: Comprehensive truck fleet tracking and management
- Incident Reporting: Real-time incident tracking and reporting system
- User Management: Secure authentication and role-based access control
- Admin Dashboard: Comprehensive administrative controls and monitoring
The route optimization system is the core feature of this project, leveraging AWS Location Services to provide efficient waste collection routes.
-
AWS Location Services Integration
- Real-time route calculation using
TruckRouteCalculator - Distance matrix computation for multiple locations
- Optimized for vehicle routing
- Real-time route calculation using
-
Smart Route Planning
- Dynamic route optimization based on bin fill levels
- Real-time traffic consideration
- Multi-stop optimization
- Chunk-based processing for large-scale operations
-
Performance Features
- Efficient handling of multiple collection points
- Real-time route updates
- Distance and time optimization
- Cluster-based route planning
-
Data Collection
- Gathers real-time bin locations
- Collects truck fleet positions
- Monitors bin fill levels
-
Route Calculation
- Uses AWS Location Services for accurate distance calculation
- Implements greedy algorithm for route optimization
- Considers multiple constraints (time, capacity, priority)
-
Optimization Process
- Divides large areas into manageable clusters
- Calculates optimal routes within clusters
- Combines cluster routes for complete collection plan
-
Real-time Updates
- Continuous route optimization
- Dynamic rerouting based on new data
- Incident-based route adjustments
This project heavily utilizes AWS services to provide robust and scalable functionality.
-
Route Calculator
- Custom
TruckRouteCalculatorfor waste collection vehicles - Real-time distance and time calculations
- Optimized for multiple stops and vehicle constraints
- Custom
-
Geofencing
- Bin location tracking
- Cluster boundary management
- Service area optimization
// AWS Location Service Configuration
const locationClient = new LocationClient({
region: process.env.AWS_REGION,
credentials: {
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY
}
});AWS_REGION=your-region
AWS_ACCESS_KEY_ID=your-access-key
AWS_SECRET_ACCESS_KEY=your-secret-key
ROUTE_CALCULATOR_NAME=TruckRouteCalculator- IAM roles and policies for service access
- Environment variable management
- Secure credential handling
- API key rotation
graph TB
subgraph Client
A[Mobile App]
B[Web Dashboard]
end
subgraph Backend
C[NestJS Application]
D[Route Optimizer]
E[IoT Manager]
end
subgraph AWS Services
F[Location Services]
G[Route Calculator]
H[Geofencing]
end
subgraph Database
I[AmazonDynamoDB]
end
subgraph IoT Devices
J[Smart Bins]
K[Truck Trackers]
end
A --> C
B --> C
C --> D
C --> E
D --> F
F --> G
F --> H
C --> I
J --> E
K --> E
sequenceDiagram
participant Client
participant Backend
participant AWS
participant IoT
participant DB
Client->>Backend: Request Route Optimization
Backend->>IoT: Get Bin Status
IoT-->>Backend: Bin Fill Levels
Backend->>DB: Get Bin Locations
DB-->>Backend: Location Data
Backend->>AWS: Calculate Route Matrix
AWS-->>Backend: Distance Matrix
Backend->>Backend: Optimize Route
Backend-->>Client: Optimized Route
- Framework: NestJS
- Language: TypeScript
- Cloud Services: AWS Location Services
- Security: Helmet, CORS
- API: RESTful with versioning support
- Node.js (v14 or higher)
- AWS Account with Location Services enabled
- Amazon DynamoDB (for data storage)
- Clone the repository
git clone https://github.com/emrebaranarca/aws-waste-route-optimizer.git- Install dependencies
npm install- Start the application
npm run start:dev