This project is a backend system for container shipment tracking, designed with two user roles:
- Logistic Service Providers (LSPs) can add, update, delete, and manage container availability.
- Traders can view available containers and book them for shipments.
- AI-powered container recommendation system helps traders select the best container.
β
User registration & login with JWT authentication
β
Role-based access (Trader & LSP)
β
LSPs must approve Traders before they can book containers
β
Password hashing for security
β
Add, update, delete, and manage containers
β
Containers start as available and change status when booked
β
Prevent duplicate container names per LSP
β
Only verified Traders can book containers
β
Booking status: pending, confirmed, canceled
β
Auto-cancel bookings after 24 hours if not confirmed
β
Prevent double booking of the same container
β
Booking history tracking
β
AI recommends best available containers based on cargo type & destination
β
Ensures optimal shipping choices for traders
β
Track total containers, pending & confirmed bookings
β
Monitor availability & booking trends
β
JWT-based authentication & authorization
β
Redis caching for optimized container search
β
Rate limiting to prevent abuse
β
Fully RESTful API with PostgreSQL (via Supabase)
- Backend: Node.js, Express.js, Supabase (PostgreSQL)
- Authentication: JWT, Bcrypt
- Caching: Redis
- AI Model: Integrated for container recommendation
- Deployment: Docker, AWS (Optional)
git clone https://github.com/yourusername/container-tracking-system.git
cd container-tracking-systemnpm installPORT=5000
SUPABASE_URL=your-supabase-url
SUPABASE_ANON_KEY=your-supabase-anon-key
JWT_SECRET=your-jwt-secretnpm start| Method | Endpoint | Description |
|---|---|---|
POST |
/api/auth/register |
Register user (Trader/LSP) |
POST |
/api/auth/login |
Login user |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/containers/add |
Add a new container |
PUT |
/api/containers/:id |
Update a container |
DELETE |
/api/containers/:id |
Delete a container |
GET |
/api/containers |
Get all containers |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/containers/book |
Book a container |
POST |
/api/containers/cancel |
Cancel a booking |
POST |
/api/containers/auto-cancel |
Auto-cancel unconfirmed bookings |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/ai/suggest-container |
Get AI-based container recommendations |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/lsp/analytics |
Get LSP analytics overview |
1οΈβ£ Register a Trader
{
"email": "[email protected]",
"password": "123456",
"role": "Trader"
}2οΈβ£ Register an LSP
{
"email": "[email protected]",
"password": "password",
"role": "LSP"
}3οΈβ£ LSP Approves Trader
POST /api/users/approve/:trader_id4οΈβ£ LSP Adds Containers
{
"name": "Container 1",
"capacity": "20ft"
}5οΈβ£ Trader Books a Container
{
"container_id": "your-container-id"
}1οΈβ£ Fork the repository
2οΈβ£ Create a new branch (git checkout -b feature-name)
3οΈβ£ Commit your changes (git commit -m 'Add new feature')
4οΈβ£ Push to your branch (git push origin feature-name)
5οΈβ£ Open a Pull Request
This project is MIT Licensed.
Give a βοΈ if you like this project! π