Section 5 of 17
The example: Fleetline
Contents
Fleetline runs maintenance for companies that operate trucks, vans and buses. Mechanics work in depots; planners assign work; customers book services and pay invoices; finance and support run a back office.
5.1. Applications
| Application | Users | Framework in this guide |
|---|---|---|
ops-portal |
Planners and mechanics in the depots | Angular |
customer |
Fleet customers: bookings, vehicles, invoices | Angular (Next.js in section 12) |
backoffice |
Finance, support, administrators | Angular (Nuxt in section 13) |
5.2. Domains and teams
| Domain | Owns | Team | Used by apps |
|---|---|---|---|
maintenance |
Work orders, checklists, planning board, SLAs | Workshop | ops-portal, backoffice |
fleet |
Vehicles, odometer, service history | Workshop | all three |
inventory |
Parts, stock per depot, reservations | Supply | ops-portal, backoffice |
booking |
Service slots, booking flow, rescheduling | Customer | customer, ops-portal |
billing |
Quotes, invoices, payments | Finance | customer, backoffice |
customers |
Accounts, contracts, contacts | Customer | customer, backoffice |
identity |
Sign-in, roles, permissions | Platform | all three |
notifications |
In-app inbox, e-mail preferences | Platform | all three |
shared |
Design system, layout, HTTP setup, dates, money, testing | Platform | all three |
Five teams, about thirty-five front-end engineers, about 280,000 lines of TypeScript. CODEOWNERS maps each libs/<domain>/ folder to its team, so a pull request into maintenance asks the Workshop team for review and nobody else.
5.3. The workspace
fleetline/
├── apps/
│ ├── ops-portal/
│ ├── customer/
│ └── backoffice/
└── libs/
├── maintenance/
│ ├── api/
│ ├── feature-shell/
│ ├── feature-work-orders/
│ ├── feature-work-order-detail/
│ ├── feature-planning-board/
│ ├── feature-checklist-editor/
│ ├── ui-work-order-card/
│ ├── ui-checklist/
│ ├── ui-planning-grid/
│ ├── data-access/
│ ├── model/
│ └── util-sla/
├── fleet/
│ ├── api/
│ ├── feature-shell/
│ ├── feature-vehicle-list/
│ ├── feature-vehicle-detail/
│ ├── ui-vehicle-badge/
│ ├── ui-odometer-chart/
│ ├── data-access/
│ └── model/
├── inventory/
├── booking/
├── billing/
├── customers/
├── identity/
├── notifications/
└── shared/
├── ui-design-system/
├── ui-layout/
├── data-access-http/
├── util-http/
├── util-date/
├── util-money/
└── util-testing/
Maintenance alone has twelve libraries. That is normal: one feature-* per use case, one ui-* per cohesive group of components, one data-access and one model per domain until they grow too big (section 16.3).
5.4. One use case through the layers
The rest of the guide follows one use case: a planner opens the work orders of a depot, filters them, and assigns a mechanic. It touches four libraries of maintenance and one of fleet:
| Library | What it contributes |
|---|---|
maintenance/feature-work-orders |
The page: reads the facade, renders cards, forwards clicks |
maintenance/ui-work-order-card |
The card and the status filter, no state, no HTTP |
maintenance/data-access |
NgRx feature, effects, HTTP client, facade |
maintenance/model |
WorkOrder, WorkOrderFilter, matchesFilter, isOverdue |
fleet/api |
VehicleSummaryStore: plate and model for a vehicle id |