Skip to content

A production-ready ASP.NET Core MVC web application for tally & weighing of trucks during loading or discharging used by cargo surveyors and tally teams

Notifications You must be signed in to change notification settings

Peter42306/TrucksWeighingWebApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trucks Weighing Web App

A production-ready ASP.NET Core MVC web application for truck-based cargo weight control used by cargo surveyors and tally teams during loading and discharging operations at ports, terminals, warehouses, and silos.

The application supports real-time multi-user workflows, tracking each truck from initial weighing through cargo operations to final weighing, with automated totals and PDF reporting.

Project highlights

  • Production-ready ASP.NET Core MVC application, deployed on Linux (Nginx + systemd)
  • Real-world inspection workflow used during cargo operations (ports / terminals)
  • Authentication & authorization:
    • ASP.NET Core Identity
    • Email confirmation, password recovery
    • Roles (User / Admin)
  • Admin panel for inspections, statistics, and feedback management
  • Multi-user concurrent input (weighbridge operator + cargo operations operator)
  • State-driven truck lifecycle tracking:
    • Initial weighing
    • Cargo operations started / finished
    • Final weighing
  • Excel-like operational UI, optimized for fast data entry
  • Responsive and mobile-friendly design
  • Server-side data validation & consistency
  • Pagination and server-side filtering for large truck datasets
  • PDF export (daily and period-based tally sheets with totals and balances)
  • Persistent Data Protection keys (cookies remain valid after restarts)
  • Deployed and running in production

Features

Inspections

  • Create inspections with vessel, cargo, location, timezone
  • Optional inspection logo and notes

Truck workflow

  • Initial and final weight capture
  • Automatic net weight calculation
  • Plate number autocomplete from historical data

Operational safety logic

  • Trucks must pass initial weighing before cargo operations
  • Visual separation of truck states

Truck status dashboard

  • Waiting for cargo operations
  • Under cargo operations
  • Waiting for final weighing
  • Completed

Team collaboration

  • Multiple users working on the same inspection simultaneously
  • Shared real-time status visibility

Reporting

  • PDF export using QuestPDF
  • Export entire inspection or selected date/time range
  • Daily summaries and balance figures for selected period or from the beginning

How it works (real workflow)

  • Create an inspection (vessel, cargo, location, timezone, optional logo & notes)
  • At the weighbridge, record initial truck weight
  • At the cargo operations point, mark start and finish of loading/discharging
  • Perform final weighing at the weighbridge
  • Review totals and balance figures
  • Export a PDF tally sheet for reporting or handover

Screenshots

Screenshot 2026-01-20 170525

Screenshot 2026-01-20 170540

Screenshot 2026-01-20 170602

Screenshot 2026-01-20 170626

Screenshot 2026-01-20 170645

Screenshot 2026-01-20 170720

Screenshot 2026-01-20 170733

Screenshot 2026-01-20 170802

Screenshot 2026-01-20 170825

Screenshot 2026-01-20 170834

Technology stack

Backend / Web

  • ASP.NET Core MVC
  • ASP.NET Core Identity + Roles
  • Entity Framework Core (Code First, migrations)
  • PostgreSQL
  • AutoMapper

Frontend

  • Razor Views (MVC)
  • Server-side validation with domain rules
  • Bootstrap-based responsive layout

Infrastructure / Deployment

  • Linux server deployment
  • Nginx reverse proxy
  • systemd services
  • Persistent Data Protection keys
  • Email delivery: SendGrid
  • PDF generation: QuestPDF

Project structure

TrucksWeighingWebApp/
├─ Areas/
│  └─ Identity/                         # ASP.NET Core Identity UI
│
├─ Controllers/
│  ├─ Admin/                            # Admin-only endpoints
│  ├─ HomeController.cs
│  ├─ InspectionsController.cs          # Core inspections workflow
│  ├─ TruckRecordsController.cs         # Truck weighing records
│  ├─ GalleryController.cs
│  └─ ContactController.cs
│
├─ Data/
│  └─ ApplicationDbContext.cs            # EF Core DbContext
│
├─ DTOs/
│  └─ Export/                           # Excel / PDF export DTOs
│
├─ Infrastructure/
│  ├─ Identity/                         # Role & admin seeding
│  │  ├─ IdentitySeed.cs
│  │  ├─ RoleNames.cs
│  │  └─ SeedOptions.cs
│  ├─ Telemetry/
│  │  └─ UserSessionMiddleware.cs       # Session & activity tracking
│  └─ TimeZone/
│     └─ Tz.cs
│
├─ Interfaces/
│
├─ Mappings/
│  └─ MappingProfile.cs                 # AutoMapper profiles
│
├─ Models/
│  ├─ ApplicationUser.cs
│  ├─ Inspection.cs
│  ├─ TruckRecord.cs
│  ├─ UserSession.cs
│  ├─ UserLogo.cs
│  ├─ FeedbackTicket.cs
│  ├─ ErrorViewModel.cs
│  └─ SendGridOptions.cs
│
├─ Services/
│  ├─ Auth/
│  │  └─ AppCookieEvents.cs             # Login counters
│  ├─ Export/
│  │  ├─ TruckExcelExporter.cs
│  │  └─ TruckPdfExporter.cs
│  ├─ Logos/
│  │  └─ UserLogoService.cs
│  └─ SendGridEmailService.cs
│
├─ ViewModels/
│  ├─ InspectionCreateViewModel.cs
│  ├─ InspectionEditViewModel.cs
│  ├─ TruckRecordCreateViewModel.cs
│  ├─ TruckRecordEditViewModel.cs
│  ├─ PeriodStatsViewModel.cs
│  └─ FeedbackTicketViewModel.cs
│
├─ Views/
│  ├─ Inspections/
│  ├─ TruckRecords/
│  ├─ Gallery/
│  ├─ Stats/
│  ├─ Home/
│  └─ Shared/
│     ├─ _Layout.cshtml
│     ├─ _LoginPartial.cshtml
│     └─ Error.cshtml
│
├─ wwwroot/
│  └─ uploads/
│     └─ logos/                         # User-uploaded logos
│
├─ keys/                                # Data Protection keys
│
├─ Migrations/
├─ appsettings.json
├─ appsettings.Development.json
├─ appsettings.Production.json
├─ Program.cs                           # DI + middleware pipeline
└─ TrucksWeighingWebApp.csproj

Project status

This is a live, deployed, and actively used application, built as practical tool for the cargo surveyors and tally teams that helps control cargo weight during truck operations at terminals - in ports, warehouses, and silos (loading or discharging).

About

A production-ready ASP.NET Core MVC web application for tally & weighing of trucks during loading or discharging used by cargo surveyors and tally teams

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages