How sonujha0210/freighttracker works
FreightTrack is a REST API for shipment lifecycle and tracking, with customer registration/login and role-protected operations. Clients send requests to API controllers; authentication and shipment services apply business logic, repositories persist or query data, and shipment responses include tracking history, filters, or CSV export. The graph reflects sampled controller, service, repository, and DbContext code, plus documented JWT/RBAC and exception handling. Other documented behavior, including the precise endpoint policies, is represented at subsystem level where source excerpts were unavailable.
Main entry points: ShipmentService.cs Shipment Service · ShipmentsController.cs Shipment Routes · AuthService .cs Auth Service · JwtConfiguration.cs JWT Authentication
Components 15
HTTP API
- Shipment Routes
FreightTrack.API/Controllers/ShipmentsController.cs - Auth Routes
FreightTrack.API/Controllers/AuthController.cs - Exception Handler
FreightTrack.API/Middleware/ExceptionMiddleware.cs.cs
Application Services
- Shipment Service
FreightTrack.Application/Services/Implementation/ShipmentService.cs - Auth Service
FreightTrack.Application/Services/Implementation/AuthService .cs - Customer Service
FreightTrack.Application/Services/Implementation/CustomerService.cs
Persistence and Domain
- Shipment Repository
FreightTrack.Infrastructure/Repositories/ShipmentRepository.cs - Customer Repository
FreightTrack.Infrastructure/Repositories/CustomerRepository.cs - EF DbContext
FreightTrack.Infrastructure/Data/FreightTrackDbContext.cs - Shipment and Customer Models
FreightTrack.Domain/Models/Shipment.cs - Tracking Event Model
FreightTrack.Domain/Models/TrackingEvent.cs
Security
- JWT Authentication
FreightTrack.API/JWTConffig/JwtConfiguration.cs - JWT Settings
FreightTrack.API/appsettings.json
Other components
- API Client
- MySQL Database
Connections 18
- API Client → Shipment Routes: sends requests
- API Client → Auth Routes: registers or logs in
- Shipment Routes → Shipment Service: calls
- Shipment Service → Shipment Repository: queries or changes
- Shipment Repository → EF DbContext: reads and writes
- EF DbContext → MySQL Database: persists data
- Shipment Service → Shipment and Customer Models: maps shipment data
- Shipment Service → Tracking Event Model: maps event data
- Shipment Routes → Shipment Service: requests CSV data
- Auth Routes → Auth Service: calls
- Auth Service → Customer Repository: looks up or saves
- Customer Repository → EF DbContext: reads and writes
- Auth Service → JWT Settings: reads signing settings
- JWT Authentication → JWT Settings: reads validation settings
- API Client → JWT Authentication: presents bearer token
- JWT Authentication → Shipment Routes: authorizes requests
- Exception Handler → Shipment Routes: handles request errors
- Exception Handler → Auth Routes: handles request errors