Skip to content

rajappa-adabala/Container-Shipment-Tracking-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Container-Shipment-Tracking-System

πŸ“¦ Container Shipment Tracking System

πŸš€ Overview

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.

🎯 Features

1️⃣ User Management

βœ… User registration & login with JWT authentication
βœ… Role-based access (Trader & LSP)
βœ… LSPs must approve Traders before they can book containers
βœ… Password hashing for security

2️⃣ Container Management (LSP Only)

βœ… Add, update, delete, and manage containers
βœ… Containers start as available and change status when booked
βœ… Prevent duplicate container names per LSP

3️⃣ Booking System (Trader Only)

βœ… 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

4️⃣ AI-Powered Container Suggestions

βœ… AI recommends best available containers based on cargo type & destination
βœ… Ensures optimal shipping choices for traders

5️⃣ LSP Analytics Dashboard

βœ… Track total containers, pending & confirmed bookings
βœ… Monitor availability & booking trends

6️⃣ Security & Optimization

βœ… JWT-based authentication & authorization
βœ… Redis caching for optimized container search
βœ… Rate limiting to prevent abuse
βœ… Fully RESTful API with PostgreSQL (via Supabase)


πŸ›  Tech Stack

  • Backend: Node.js, Express.js, Supabase (PostgreSQL)
  • Authentication: JWT, Bcrypt
  • Caching: Redis
  • AI Model: Integrated for container recommendation
  • Deployment: Docker, AWS (Optional)

πŸ›  Installation & Setup

1️⃣ Clone the repository

git clone https://github.com/yourusername/container-tracking-system.git
cd container-tracking-system

2️⃣ Install dependencies

npm install

3️⃣ Configure environment variables (.env)

PORT=5000
SUPABASE_URL=your-supabase-url
SUPABASE_ANON_KEY=your-supabase-anon-key
JWT_SECRET=your-jwt-secret

4️⃣ Start the server

npm start

πŸ“‘ API Endpoints

πŸ›  Authentication

Method Endpoint Description
POST /api/auth/register Register user (Trader/LSP)
POST /api/auth/login Login user

πŸ“¦ Containers (LSP Only)

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

🚒 Booking System (Trader Only)

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

πŸ€– AI Model

Method Endpoint Description
POST /api/ai/suggest-container Get AI-based container recommendations

πŸ“Š Analytics (LSP Only)

Method Endpoint Description
GET /api/lsp/analytics Get LSP analytics overview

πŸ›  Testing in Postman

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_id

4️⃣ LSP Adds Containers

{
    "name": "Container 1",
    "capacity": "20ft"
}

5️⃣ Trader Books a Container

{
    "container_id": "your-container-id"
}

🀝 Contributing

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


πŸ“„ License

This project is MIT Licensed.


🌟 Show Your Support

Give a ⭐️ if you like this project! πŸš€

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published