The Cinema Project is a HttpRestfulApi project written in .NET 7 following DDD and Clean Architecture. The reservation bounded context manage the cinema showtimes and ticket reservation.
- You will need the latest Visual Studio 2022 and the latest .NET Core SDK (at least .NET 7 SDK).
- You will need also Docker Desktop running on your machine.
- To run the project just find and build the solution file JordiAragon.Cinema.Reservation.sln and select docker-compose as startup project.
- Full architecture with responsibility separation concerns, SOLID and clean code (including zero warnings policy)
- Clean Architecture (Onion Architecture)
- Vertical Slices Architecture.
- Domain Driven-Design
- Rich Domain Model with Aggregates and Strong Ids
- Domain/Application Events
- Outbox Pattern with idempotent consumers
- CQRS with DB physical separation using domain events.
- Unit of Work
- Repository & Specification
- Custom API Error Handling with Problems Details
- This project uses JordiAragon.SharedKernel building blocks to follow DDD principles and Clean Architecture.
- ASP.NET 7.0
- Entity Framework Core 7.0
- FastEndpoints
- MediatR
- AutoMapper
- Autofac
- Ardalis.Result
- Ardalis.Specification
- Ardalis.SmartEnums
- Ardalis.GuardClauses
- FluentValidator
- Serilog
- Quartz
- Polly
- Swagger UI with JWT support
- EasyCaching
- Volo.Abp.Guids
- StyleCop & SonarAnalyzer
- xUnit & NetArchTest & Testcontainers & Ardalis.HttpClientTestExtensions
- Outbox pattern to handle the domain event out side the source transaction with resilence idempotent consumers support.
- Result Pattern: Flow Control using Ardalis.Result avoiding throwing exceptions.
- API Versioning
- REPR Pattern using FastEndpoints
- Application cache request with invalidation.
- Generic cache repository with invalidation.
- MediatR Pipelines Behaviours (Decorator pattern)
- LoggerBehaviour to track all requests.
- UnitOfWorkBehaviour as a main exception handler to commit or rollback the transaction.
- ValidationBehaviour to add custom validation per each query or command.
- CachingBehavior and InvalidateCachingBehavior to apply/remove requests to the cache.
- DomainEventsDispatcherBehaviour. Deferred approach to raise and dispatch events before complete the transation.
- PerformanceBehaviour to track the execution time performance.
- Architecture Tests to ensure DDD rules required in Vertical Slices Arquitecture
- Unit Tests: Domain and Application
- Functional Tests with Testcontainers: Presentation.HttpRestfulApi
- Integration Tests with Testcontainers: Infrastructure.EntityFramework
- GitHub workflow CI with SonarCloud integration
-
Create/Cancel showtime
-
Reserve seats
- Reserving the seat response will contain a GUID of the reservation, also the number of seats, the auditorium used and the movie that will be played.
- It should not be possible to reserve the same seats two times.
- It shouldn't be possible to reserve an already sold seat.
- All the seats, when doing a reservation, need to be contiguous.
- Reservation will expire in 1 minute unless marked as purchased.
- No reservations are allowed after showtime ended.
-
Purchase ticket reservation
- We will need the GUID of the ticket reservation, it is only possible to do it while the seats are reserved.
- It is not possible to purchase ticket reservation two times.
Special thanks to all these authors for sharing their knowledge and expertise:
- Ardalis: Clean Architecture
- Jason Taylor: Clean Architecture
- Vaughn Vernon: Implementing Domain-Driven Design (book)
- Vaughn Vernon: Domain-Driven Design Destilado (book)
- Alexey Zimarev: Hands-on Domain-Driven Design (book)
- Microsoft eShopOnContainers
- Microsoft eShopOnWeb
- Kamil Grzybek: Sample .NET Core REST API CQRS
- Kamil Grzybek: Modular Monolith With DDD
- Oskar Dudycz: EventSourcing .NET
- NDC Oslo: Udi Dahan - Talk Session: CQRS pitfalls and patterns
- Explore DDD: Mauro Servienti - Talk Session: Welcome to the (State) Machine
- Explore DDD: Mauro Servienti - Talk Session: All Our Aggregates Are Wrong
- NDC Oslo: Adam Ralph - Talk Session: Finding your service boundaries - a practical guide
- Vladimir Khorikov: DDD in a nutshell
- Diego Martin: SunnyAttic Software Videos
- Jimmy Bogard: Vertical Slice Architecture
- CodeOpinion: Youtube Channel
- Amichai Mantinband: Youtube Channel
- Milan Jovanović: Youtube Channel
The Cinema Project was developed by Jordi Aragón Zaragoza
Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.