The Mechanical Workshop Management System is designed to manage and organize workshop operations in a clean, scalable, and maintainable way. The project focuses heavily on Business Logic enforcement, clear separation of concerns, and modern backend architecture patterns.
The system helps manage:
- Customers and their Vehicles
- Repair Tasks and Parts need for workOrder
- Work Orders lifecycle and status transitions
- Labors / Employees assignments
- Authorization & Access Control based on roles and policies
The goal of the project is not just CRUD operations, but a real-world, production-ready architecture that reflects best practices.
The project is built using:
- Clear separation between Domain, Application, Infrastructure, and API layers
- Business rules are isolated from external frameworks
- High testability and maintainability
- Commands for write operations
- Queries for read operations
- Improved scalability and clarity of intent
-
Features are grouped by use-case, not by technical concern
-
Each slice contains its own:
- Command / Query
- Handler
- Validator
- Request / Response (Contracts)
- Custom
Result<T>implementation - Unified success & failure handling
- Clear error propagation without throwing exceptions in business logic
- All rules are enforced inside the Application layer
- No business logic leaks into Controllers or Infrastructure
- Custom authorization policy to allow only assigned labors to change a Work Order status
- Prevents unauthorized status transitions
- Enforces real business constraints
Implemented using MediatR Pipeline Behaviors:
-
🔍 Validation Behavior
- Uses FluentValidation
- Automatically validates commands and queries
-
📊 Performance Monitoring Behavior
- Logs execution time for each request
- Helps detect slow operations
-
📝 Logging Behavior
- Logs request details for observability and debugging
- Centralized exception handling
- Consistent error responses
- Clean separation between exception handling and business logic
- Code First approach
- Clear entity configuration
- Migrations used for database evolution
- Background services are used to periodically check customer appointments
- If a customer is delayed beyond the allowed time, the related Work Order is automatically canceled
- Ensures workshop schedule consistency and reduces manual intervention
- Real-time communication is implemented to notify the team immediately when a Work Order status changes
- Enables instant UI updates without manual refresh
- Improves operational awareness and response time
src/
│
├── MechanicShop.API
│ ├── Controllers
│ ├── Middlewares
│
│
├── MechanicShop.Application
│ ├── Common # Result Pattern, helpers, base abstractions
│ ├── Features # CQRS Vertical Slices (Commands / Queries / Handlers)
│ └── DependencyInjection.cs
│
├── MechanicShop.Contracts
│ ├── Common
│ ├── Requests
│ ├── Responses
│ └── Class1.cs
│
├── MechanicShop.Domain
│ ├── Common
│ ├── Customers
│ ├── Employees
│ ├── Identity
│ ├── RepairTasks
│ └── WorkOrders
│
├── MechanicShop.Infrastructure
│ ├── BackgroundJobs
│ ├── Data
│ ├── Identity
│ ├── Migrations
│ ├── RealTime
│ ├── Services
│ ├── Settings
│ └── DependencyInjection.cs
│
└── tests # Unit & integration tests
- ✔ Clean Architecture
- ✔ CQRS with MediatR
- ✔ Result Pattern
- ✔ Vertical Slice Architecture
- ✔ Custom Authorization Policies
- ✔ Pipeline Behaviors (Validation, Logging, Performance)
- ✔ Custom Exception Middleware
- ✔ EF Core Code First
✅ Development Completed
🧪 Currently Under Testing
This project is built as a learning-focused yet production-oriented system, emphasizing:
- Correct architecture decisions
- Strong business logic enforcement
- Clean, readable, and maintainable code
It serves as a solid foundation for extending into a full-scale workshop management platform.