How ivoiliev0394/logisticmanagementapp works
1. Overall shape
This is a layered ASP.NET Core MVC application built around a rich logistics domain. The runtime entry point is Program.cs, which wires MVC, Identity, EF Core persistence, custom model binding, and the application services used by controllers and views.
2. Presentation boundary
The UI layer is classic MVC: controllers in Controllers/, Razor views in Views/, shared layout/components in Views/Shared/, and Identity UI in Areas/Identity/. There are no standalone frontend or API tiers in this repo; the browser talks directly to MVC actions that return views and form posts.
3. Functional portals
The application is organized by business portal rather than by technical layer:
- AdminController and Views/Admin for system administration and reporting
- AuthController and Views/Auth for login/register/access control
- ClientPortalController and Views/ClientPortal for client self-service
- CompanyController split across many partial files for the main operational portal
This is the main UI boundary for an architecture diagram: one web app with multiple role-based workspaces.
4. Application layer
The Application/Services folder contains the business use-case layer. Services are exposed via interfaces in Application/Interfaces and consumed by controllers. This layer coordinates validation, reads/writes entities, shapes data into view models, and encapsulates portal-specific logic such as auth, home/dashboard, client address management, company CRUD, logistics workflows, and sequential number generation.
5. Domain model
The Domain/ tree is the core of the system and is highly logistics-specific. It includes:
- Companies / clients: company profiles, branches, contacts, client addresses
- Shipments / orders / operations: shipments, legs, containers, packages, parties, tracking events, bookings, consolidations
- Assets by transport mode: air, road, rail, sea, plus cargo units
- Routes and planning: routes, route plans, assignments, capacity, calendars, utilization
- Billing and pricing: invoices, payments, charges, tariffs, surcharges, quotes, taxes
- Compliance and documents: dangerous goods, temperature requirements, document versions, file resources
- Identity and security: application users, roles, sessions
The domain is entity-heavy, suggesting most screens are CRUD and workflow screens over EF Core entities.
6. Persistence layer
Infrastructure/Persistence/LogisticAppDbContext.cs is the central data access boundary. The database model is configured through many EF Core configuration classes under Infrastructure/Persistence/Configurations/, matching the domain structure one-to-one. Migrations are present, so schema changes are managed by EF Core. The README says SQL Server is the target database, and the repo structure strongly supports that.
7. Seed and bootstrapping data
The Infrastructure/Persistence/Seed/ tree contains extensive seeders for nearly every module: companies, users/roles, shipments, assets, billing, routes, compliance, operations, and locations. This means the app likely depends on seeded reference data to make the portals usable immediately after initialization. A SeedRunner coordinates the seeding process.
8. Cross-cutting infrastructure
There are a few technical support pieces that affect how requests flow:
- SoftDeleteExtensions for soft-delete behavior in persistence
- FlexibleDecimalModelBinder and provider for culture-tolerant numeric input
- static JavaScript helpers in wwwroot/js/ for auto-generated fields and decimal input fixes
These indicate the app handles complex forms and data entry heavily.
9. Security and identity
Authentication and authorization are built on ASP.NET Core Identity using custom ApplicationUser, ApplicationRole, and RoleNames. The presence of portal-specific controllers and Identity pages indicates role-based access control across admin, company, and client experiences. User sessions are also modeled in the domain, suggesting login/session auditing or session state tracking is part of the business logic.
10. View models and UI composition
Models/ contains extensive ViewModel classes grouped by portal and feature. These are the data contracts between services/controllers and Razor views. The separation is important: domain entities are not rendered directly; instead, the app projects them into portal-specific view models for forms, lists, and details pages.
11. Routing and partial controllers
CompanyController is intentionally split into many partial files by subdomain area: assets, routes, operations, documents, compliance, billing, shared locations, and reports. The same pattern exists in the service layer. This makes the company portal the largest subsystem and suggests the architecture is modular by business capability rather than by technical tier.
12. Testing boundary
LogisticManagementApp.Tests contains service-level tests and helpers for Identity and DbContext setup. The test suite focuses on application services and business behavior rather than UI rendering, which reinforces the architecture: controllers are thin, services do the work, and EF Core-backed data is exercised in tests.
13. Deployment/runtime
The repo includes a Dockerfile and app settings for development plus service dependency metadata, so it is designed to run as a containerized .NET 8 web app backed by SQL Server. Static assets are served from wwwroot, and the UI stack uses Bootstrap, jQuery, and validation scripts for server-rendered forms.
14. High-level data flow
A typical request path is: browser submits an MVC form or page request → controller action → application service interface/implementation → EF Core DbContext and entity configuration → SQL Server → service maps results into ViewModels → Razor view renders response. Identity flows follow the same web entry point but use ASP.NET Core Identity and role checks before reaching business actions.
Main entry points: LogisticAppDbContext.cs DbContext · CompanyPortalService.cs Company Service · Program.cs Program · Controllers Controllers
Components 22
Presentation
MVC UI, role portals, and shared Razor composition.
- Program · Wires MVC, Identity, EF Core, model binding, and app services.
LogisticManagementApp/LogisticManagementApp/Program.cs - Controllers · Role-based MVC entry points for admin, auth, client, company, home, and errors.
LogisticManagementApp/LogisticManagementApp/Controllers - Razor Views · Server-rendered pages for the portals and shared layout/components.
LogisticManagementApp/LogisticManagementApp/Views - Identity Pages · ASP.NET Core Identity pages and account management UI.
LogisticManagementApp/LogisticManagementApp/Areas/Identity - View Models · Portal-specific data contracts used between services, controllers, and views.
LogisticManagementApp/LogisticManagementApp/Models
Application
Use-case services and interfaces consumed by controllers.
- Admin Service · Administrative CRUD and reporting use cases.
LogisticManagementApp/LogisticManagementApp/Application/Services/AdminPortal/AdminCrudService.cs - Auth Service · Login, registration, and access-control workflows.
LogisticManagementApp/LogisticManagementApp/Application/Services/Auth/AuthService.cs - Client Services · Client dashboard and address-management workflows.
LogisticManagementApp/LogisticManagementApp/Application/Services/ClientPortal - Company Service · Large company portal service split across assets, routes, operations, documents, and billing.
LogisticManagementApp/LogisticManagementApp/Application/Services/CompanyPortal/CompanyPortalService.cs - Home Service · Home and dashboard composition for role-specific landing pages.
LogisticManagementApp/LogisticManagementApp/Application/Services/HomeService.cs - Numbering · Sequential number generation used by portal workflows.
LogisticManagementApp/LogisticManagementApp/Application/Services/SequentialNumberGenerator.cs - Service Interfaces · Application service contracts consumed by controllers and tests.
LogisticManagementApp/LogisticManagementApp/Application/Interfaces
Domain
Core logistics entities and business concepts.
- Logistics Domain · Core company, shipment, routing, billing, compliance, location, and identity entities.
LogisticManagementApp/LogisticManagementApp/Domain - Shipments & Ops · Shipments, legs, bookings, consolidations, planning, tracking, and notifications.
LogisticManagementApp/LogisticManagementApp/Domain/Shipments - Transport Assets · Air, road, rail, sea, and cargo-unit assets.
LogisticManagementApp/LogisticManagementApp/Domain/Assets - Commercial · Orders, pricing, billing, invoices, payments, tariffs, and quotes.
LogisticManagementApp/LogisticManagementApp/Domain/Billing - Company Profiles · Companies, branches, contacts, and client addresses.
LogisticManagementApp/LogisticManagementApp/Domain/Companies
Persistence
EF Core database context, configurations, migrations, and seeders.
- DbContext · Central persistence boundary for the application database.
LogisticManagementApp/LogisticManagementApp/Infrastructure/Persistence/LogisticAppDbContext.cs - EF Configs · One-to-one EF Core configuration classes for domain entities.
LogisticManagementApp/LogisticManagementApp/Infrastructure/Persistence/Configurations - Seed Runner · Coordinates broad reference and sample-data seeding.
LogisticManagementApp/LogisticManagementApp/Infrastructure/Persistence/Seed/SeedRunner.cs - Migrations · EF Core migrations and model snapshot.
LogisticManagementApp/LogisticManagementApp/Infrastructure/Persistence/Migrations
Tests
Service-focused test project.
- Service Tests · Tests for application services and supporting identity/DbContext helpers.
LogisticManagementApp/LogisticManagementApp.Tests
Connections 25
- Program → Controllers: registers MVC · Application startup wires request handling and dependencies.
- Program → Service Interfaces: registers services · Startup binds service contracts to implementations.
- Program → DbContext: configures EF Core · Startup connects persistence and database options.
- Program → Identity Pages: enables identity · Startup activates authentication and identity UI.
- Controllers → Service Interfaces: depends on · Controllers call through service abstractions.
- Controllers → View Models: binds view models · Actions map inputs and outputs through portal-specific models.
- Controllers → Razor Views: renders · MVC actions return Razor views and form responses.
- Identity Pages → Auth Service: shares auth flow · Identity UI complements the app's authentication workflows.
- Admin Service → DbContext: reads/writes · Admin use cases work against EF-backed persistence.
- Auth Service → DbContext: reads/writes · Authentication workflows interact with persisted users and roles.
- Client Services → DbContext: reads/writes · Client portal actions persist addresses and related data.
- Company Service → DbContext: reads/writes · Main portal workflows operate over the logistics database.
- Home Service → DbContext: queries · Dashboards aggregate data from persisted entities.
- Numbering → Company Service: supports · Sequential numbers support company workflow creation.
- DbContext → EF Configs: uses mappings · DbContext is shaped by entity configuration classes.
- DbContext → Migrations: evolves schema · Migrations capture database changes over time.
- Seed Runner → DbContext: seeds data · Bootstrap data is inserted through the DbContext.
- Seed Runner → Logistics Domain: materializes · Seeders populate the major logistics entities.
- Company Service → Transport Assets: manages · Company portal covers air, road, rail, sea, and cargo assets.
- Company Service → Shipments & Ops: manages · Company portal covers shipments, tracking, and operational workflows.
- Company Service → Commercial: manages · Company portal includes billing, pricing, and commercial records.
- Company Service → Company Profiles: manages · Company portal includes profiles, branches, contacts, and clients.
- Company Service → Logistics Domain: coordinates · Portal logic composes and updates logistics domain entities.
- Service Tests → Service Interfaces: verifies · Tests target service contracts and use-case behavior.
- Service Tests → DbContext: uses test db · Test helpers stand up an EF Core-backed test context.