High-performance cargo tracking REST API built with Rust and Actix-web. Tracks shipment status, location updates, customs clearance milestones, and estimated arrival times. Designed for customs logistics and freight forwarding systems. Sub-millisecond response times.
- Shipment Management -- Create, retrieve, update, and list cargo shipments
- Milestone Tracking -- Record and query shipment events: departed, arrived, customs hold, cleared, delivered
- Real-time Status -- Current location, ETA, and status for any tracked shipment
- Flexible Search -- Filter shipments by origin/destination, carrier, status, or date range
- Thread-safe Concurrency -- In-memory store backed by DashMap for lock-free concurrent access
- Structured Logging -- Powered by the
tracingcrate for observability
- Rust 1.75 or later
- Cargo
make build
make runThe server starts on http://127.0.0.1:8080.
| Method | Path | Description |
|---|---|---|
| GET | /health |
Health check |
| POST | /api/shipments |
Create a shipment |
| GET | /api/shipments |
List all shipments |
| GET | /api/shipments/{id} |
Get shipment by ID |
| PUT | /api/shipments/{id}/status |
Update shipment status |
| POST | /api/shipments/{id}/milestones |
Add a milestone |
| GET | /api/shipments/{id}/tracking |
Get tracking history |
| GET | /api/shipments/{id}/tracking/current |
Get current tracking status |
| GET | /api/search/shipments |
Search shipments |
make testmake lint
make fmtLicensed under the Apache License, Version 2.0. See LICENSE for details.