A parking spot reservation system built with modular monolith architecture in .NET 10.
MySpot demonstrates a modular monolith approach where the application is divided into loosely-coupled modules that communicate through well-defined interfaces.
| Module | Description |
|---|---|
| Users | User registration, authentication (JWT), and account management |
| ParkingSpots | Management of parking spots (CRUD operations) |
| Availability | Resource availability tracking and management |
| Reservations | Parking spot reservation logic and booking management |
| Notifications | Email notifications and communication |
| Mapping | Cross-module event mapping and translation |
| Saga | Distributed transaction coordination using Chronicle |
Modules communicate through:
- Shared Contracts - Synchronous calls via shared interfaces (e.g.,
IAvailabilityModuleApi) - Events - Asynchronous messaging via
IMessageBroker - Module Requests - Request/response patterns
- .NET 10 SDK
- Docker (for PostgreSQL)
- Node.js 18+ (for workshop app)
Use the workshop runner script to start all services:
./run-workshop.shThis will start:
- PostgreSQL database (Docker)
- Backend API at
http://localhost:5000 - Workshop frontend at
http://localhost:5173 - Test runner API at
http://localhost:3001
1. Start Infrastructure (PostgreSQL)
docker-compose up -d2. Run Backend API
cd src/Bootstrapper/MySpot.Bootstrapper
dotnet runThe API will be available at http://localhost:5000
3. Run Workshop App (for exercises)
cd workshops
npm install
npm run dev:allThe workshop app will be available at http://localhost:5173
dotnet testTo run specific exercise tests:
dotnet test --filter "FullyQualifiedName~Exercise03"MySpot-Modular-Monolith/
├── src/
│ ├── Bootstrapper/ # Application entry point
│ │ └── MySpot.Bootstrapper/ # Main web host
│ ├── Modules/
│ │ ├── Availability/ # Resource availability module
│ │ │ ├── Api/ # HTTP endpoints
│ │ │ ├── Application/ # Use cases & handlers
│ │ │ ├── Infrastructure/ # Data access
│ │ │ └── Shared/ # Public contracts
│ │ ├── Mapping/ # Event mapping module
│ │ ├── Notifications/ # Notification module
│ │ ├── ParkingSpots/ # Parking spots module
│ │ ├── Reservations/ # Reservations module
│ │ ├── Saga/ # Saga coordination
│ │ └── Users/ # Users module
│ └── Shared/
│ ├── MySpot.Shared.Abstractions/ # Shared interfaces
│ └── MySpot.Shared.Infrastructure/ # Shared implementations
├── tests/
│ └── MySpot.Workshops.Tests/ # Workshop exercise tests
├── workshops/ # Workshop frontend app
│ ├── src/ # React components
│ └── server/ # Test runner server
├── docker-compose.yml # Infrastructure setup
└── run-workshop.sh # All-in-one runner
POST /sign-up- Register new userPOST /sign-in- Authenticate and get JWT tokenGET /me- Get current user (requires auth)GET /users/{id}- Get user by ID
GET /parking-spots- List all parking spotsPOST /parking-spots- Add new parking spotPUT /parking-spots/{id}- Update parking spotDELETE /parking-spots/{id}- Delete parking spot
POST /reservations- Make a reservation (requires auth)DELETE /reservations/{id}- Remove reservation (requires auth)
POST /resources- Add new resource
POST /emails/send- Send email notification
The workshop app provides interactive exercises to learn modular monolith patterns:
- Start the workshop environment:
./run-workshop.sh - Open
http://localhost:5173in your browser - Select an exercise from the sidebar
- Read the description and implement the solution
- Click "Run Tests" to verify your implementation
| # | Title | Category |
|---|---|---|
| 1 | Module Design | Application Design |
| 2 | Module Loading - Creating a Module | Module Architecture |
| 3 | Shared Contracts - Synchronous Module Communication | Synchronous Communication |
| 4 | Local Contracts - HTTP-like Module Communication | Synchronous Communication |
| 5 | Asynchronous Communication - Event-Driven Mapping | Asynchronous Communication |
| 6 | Background Dispatcher - True Async | Asynchronous Communication |
| 7 | Outbox Pattern - Bug Hunt | Transactional Patterns |
| 8 | Saga Pattern - Compensation Flow | Transactional Patterns |
Configuration is managed through appsettings.json in the Bootstrapper project:
- Database: PostgreSQL connection string
- JWT: Token configuration for authentication
- CORS: Allowed origins for cross-origin requests
- Logging: Serilog configuration
This project is for educational purposes as part of DevMentors workshops.