A modern freight logistics platform connecting Shippers (who post cargo loads) with Transporters (who bid on jobs). Built with Spring Boot backend and React + Tailwind CSS frontend featuring live GPS tracking, role-based access control, and a glassmorphic dark UI.
- JWT-based authentication with secure token management
- Role selection at registration β Shipper, Transporter, or Admin
- JWT tokens contain user profile (
firstname,role) for client-side gating - Show/hide password toggle on login/register forms
- Shippers/Admins can post new loads with full details:
- Origin & destination cities
- Product type, truck type (dropdown), truck count, weight
- Loading & unloading dates
- GPS coordinates β auto-detected from city name via OpenStreetMap Nominatim geocoder
- Comments & special instructions
- All loads display as cards with route, details, status badge, shipment tracker, and live map
- Soft-delete loads (Shippers can delete own loads only; Admins can delete any)
- Transporters/Admins can submit proposals (proposed rate + terms) on
POSTEDloads - Shippers/Admins can accept or reject proposals from the Bookings Management tab
- Accepting a booking auto-updates the load status to
BOOKED - Admins can remove bookings entirely
- Real-time metrics: Total Loads, Active/Unbooked, Dispatched, Secured Revenue (βΉ)
- Fulfillment percentage ring gauge
- Recent bookings activity feed with color-coded status dots
- Each load card renders an interactive Leaflet/OpenStreetMap map
- GPS marker pinned at the load's origin coordinates
- CartoDB Dark tiles matching the UI theme
| Action | π‘ Shipper | π΅ Transporter | π’ Admin |
|---|---|---|---|
| Post a Load | β | β | β |
| Submit Proposal | β | β | β |
| Delete Load | β own only | β | β any |
| View Bookings tab | β | β | β |
| Accept/Reject Booking | β | β | β |
| Remove Booking | β | β | β |
- Framework: Spring Boot 3, Spring Data JPA, Spring Security
- Database: PostgreSQL (Neon DB cloud)
- Auth: JWT (access + refresh tokens)
- Caching: Caffeine (in-memory)
- Docs: springdoc-openapi (Swagger UI)
- Build: Maven Wrapper
- Framework: React 19 + Vite
- Styling: Tailwind CSS v4 (glassmorphism dark theme)
- Maps: React-Leaflet + OpenStreetMap
- Geocoding: Nominatim (free, no API key)
- Font: Google Fonts β Outfit
- Java 17+
- Node.js 18+
- PostgreSQL (or use the configured Neon DB connection)
git clone https://github.com/Adityarajj23/SpringBoot-Logistics.git
cd SpringBoot-LogisticsEdit src/main/resources/application.yml with your PostgreSQL credentials, or use the default Neon DB config.
.\mvnw.cmd spring-boot:run # Windows
./mvnw spring-boot:run # Mac/LinuxBackend runs on: http://localhost:8081
cd frontend
npm install
npm run devFrontend runs on: http://localhost:5173
Navigate to http://localhost:5173 in your browser.
Base URL: http://localhost:8081
Swagger UI: http://localhost:8081/swagger-ui.html
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/register |
Register a new user (with role) |
| POST | /api/auth/authenticate |
Login and receive JWT token |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/loads |
Create a new load |
| GET | /api/loads |
Get loads (filter by shipperId, productType, truckType) |
| GET | /api/loads/{loadId} |
Get a specific load |
| PUT | /api/loads/{loadId} |
Update a load |
| DELETE | /api/loads/{loadId} |
Soft-delete a load |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/bookings |
Create a booking proposal |
| GET | /api/bookings |
Get bookings (filter by transporterId, proposedRate) |
| GET | /api/bookings/{id} |
Get a specific booking |
| PUT | /api/bookings/{id} |
Update a booking (status change β ACCEPTED triggers load BOOKED) |
| DELETE | /api/bookings/{id} |
Soft-delete a booking |
{
"id": "UUID",
"shipperId": "String",
"productType": "String",
"truckType": "FLATBED | OPEN_BODY | REEFER | CONTAINER | TANKER | TRAILER",
"noOfTrucks": "int",
"weight": "double",
"comment": "String",
"status": "POSTED | BOOKED | CANCELLED",
"currentLat": "Double",
"currentLng": "Double",
"facility": {
"loadPoint": "String",
"unloadingPoint": "String",
"loadingDate": "ISO-8601",
"unloadingDate": "ISO-8601"
}
}{
"id": "UUID",
"loadId": "UUID",
"transporterId": "String",
"proposedRate": "Double",
"comment": "String",
"status": "PENDING | ACCEPTED | REJECTED"
}SpringBoot-Logistics/
βββ src/main/java/com/sdeintern1/Logistics/
β βββ Controller/ # REST controllers (LoadController, BookingController)
β βββ DTO/ # Request/Response DTOs
β βββ Entity/ # JPA entities (Load, Booking, User)
β βββ Mapper/ # MapStruct mappers
β βββ Repository/ # Spring Data JPA repositories
β βββ Security/ # JWT auth, filters, config
β βββ Service/ # Business logic
β βββ Specification/ # JPA Specifications for filtering
βββ src/main/resources/
β βββ application.yml # Config (DB, JWT, caching)
βββ frontend/
β βββ src/
β β βββ components/
β β β βββ Auth.jsx # Login/Register with role picker
β β β βββ Dashboard.jsx # Analytics dashboard
β β β βββ LoadBoard.jsx # Load cards + Bookings management
β β β βββ CreateLoadModal.jsx # Post load form (with geocoding)
β β β βββ CreateBookingModal.jsx # Submit proposal form
β β β βββ LiveMap.jsx # Leaflet map component
β β β βββ ShipmentTracker.jsx # Visual progress tracker
β β βββ App.jsx # Main app with JWT auth & routing
β β βββ index.css # Tailwind + custom theme
β βββ package.json
βββ README.md
- Register as Shipper (
alice@test.com) β Post 2 loads with GPS - Register as Transporter (
bob@test.com) β Submit proposals on loads - Register as Admin (
admin@test.com) β Accept/reject proposals, verify load status updates - Dashboard β Check real-time analytics (revenue, fulfillment %)
All passwords: use any password you choose (min length enforced).
- JWT with embedded claims:
firstnameandroleare encoded in the token, eliminating extra API calls for profile data - Frontend role gating: UI buttons/tabs are conditionally rendered based on decoded JWT β no backend round-trips
- Auto-geocoding: City names are resolved to GPS coordinates via free Nominatim API (no API key needed)
- 204 handling: Backend returns
204 No Contentfor empty lists; frontend handles gracefully - Soft deletes: Both loads and bookings use
@SQLDeletefor audit-safe deletion