- .Net 8: Uses the latest (at the time of creation) .Net framework.
- C# 12:
- Web API: RESTful and using Minimal API for enhances performance.
- Clean Onion Architecture
- Docker Containers
- Domain Driven Design
- Test Driven Development: With User Stories as the basis for each Domain level Unit Test.
- Test Coverage: Extensive coverage of the domain business logic via NUnit Tests and Fluent Assertions.
- Repository Pattern: Allowing the business and application logic to be database agnostic.
- Cosmos DB: Cloud based Document Database chosen for scalability.
- Open API: Auto API documentation (formally called Swagger).
- Redis caching: Fase in-memory caching.
- .NET Aspire: An opinionated, cloud ready stack for building observable, production ready, distributed applications.
Wip/Future additions
- JWT Authentication
- CI/CD pipelines
- Cloud based hosting: With load balancing and elastic scaling.
- Rate Limit
I chanced upon a debate on Reddit concerning a take-home project that many deemed overly ambitious:
Contrary to the crowd, it piqued my interest as a perfect little project to exhibit a fully working clean Web API project, built with a contemporary Tech Stack and Clean Architectural patterns.
This is the class structure designed to implement the solution for the challange
This is the list of APIs providing the solution
Set Startup Project to be AsipreApp.AppHost Run the solution.
In the Aspire Window click on "cosmos - Details" Then take the port number from "emulator target port":
Now navigate to this url where [portnumber] is replaced with the port from above: https://localhost:[portnumber]/_explorer/index.html Note: CosmodDB emulator usually takes a few mins to start up. So retry untill you see the "Azure Cosmos DB Emulator" page.
There will be a certification error form the selfsigned certificate. Export the Cosmos DB certificate and save to a local file. Then open crt file and install to your Trusted Root Certificate Authorities folder "on this pc".
From the Aspire page follow the URL to get to the Open API documentation
From here you eill be able to see and access the complete suite of API end points
Example requests & responses can be seen by running the APITesterApp project which performs these actions which covers setting up theater chains, managing movies, theaters, showtimes, and bookings.
- Initialize HTTP Client: Configures an HTTP client with an HTTP logging handler to capture and debug HTTP requests and responses. The API base address is set, and the timeout is established.
- POST Request: Sends a POST request to create a new theater chain named "Odeon".
- POST Request: Adds "The Matrix" to the "Odeon" theater chain via a POST request.
- PUT Request: Updates the movie details if the initial add was successful via a PUT request.
- POST Request: Attempts to add a new theater "Loughborough Max" to the chain via a POST request.
- POST Request: Configures a screen with predefined seats in the new theater via a POST request.
- POST Request: Schedules a new showtime for "The Matrix" at the specified screen via a POST request.
- POST Request: Reserves specific seats for a showtime via a POST request.
- PUT Request: Sends a PUT request to confirm the reservation and complete the booking process.
Engagement is welcome. If you have any feedback or wish to discuss any aspect of this project, please feel free to reach out. Feel free to submit Issues or Pull Requests with any suggestions.