An ASP.NET Core application designed with Domain-Driven Design (DDD) principles to manage movie critics. It supports adding, listing, editing, and deleting movies, as well as generating PDF and Excel reports.
- GET /movies → Returns all registered movies.
- GET By Id /movies/{id} → Returns all registered movies.
- POST /movies → Adds a new movie.
- PUT /movies/{id} → Edit an existing movie.
- DELETE /movies/{id} → Delete a movie.
- Reports If the stars query parameter is provided (1–5), the report will only include movies with that rating; otherwise, it will include all rated movies.:
- GET /api/Reports/movies-excel?stars={1-5} → Generates an Excel report of movies.
- GET /api/Reports/movies-pdf?stars={1-5} → Generates a PDF report of movies.
Response types at each request:

- ASP.NET Core – API development.
- MySQL – Database for persistence.
- Entity Framework Core – Modern ORM for .NET, used for database access, migrations, and data management.
- Pomelo.EF Core. MySql
- xUnit – Unit and integration testing.
- Bogus – Fake data generation for testing scenarios.
- ClosedXML - Generates a custom Excel.
- QuestPDF - Generates a custom PDF.
- Domain → Entities, aggregates, and business rules.
- Application → Use cases and application services.
- Infrastructure → Concrete implementations (repositories, persistence, MySQL integration).
- Presentation (API) → Controllers, middlewares, and endpoints.
- Communication → Defines DTOs (Data Transfer Objects) for handling input (requests) and output (responses), ensuring separation between API contracts and domain models.
- Exception Handling → Centralized management of errors, including exception filters, standardized error messages, and resource files for multi-language support.
- Centralized error handling with standardized responses.
- Improves API consumer experience by avoiding inconsistent error messages.
- Error and validation messages in multiple languages.
- Based on the
Accept-Languageheader, allowing support for different cultures.
- Unit Tests: validated with xUnit, ensuring business rules work in isolation.
- Bogus: generates fake data to simulate real-world scenarios.
Follow these steps to run the API locally with automatic migrations/seed data:
-
Install prerequisites:
- .NET 8.0 SDK
- MySQL Server 8.0.42 (or compatible)
- Docker (Optional)
-
Installing/Connecting to MySQL Server using Docker (OPTIONAL):
- Download the Oficial MYSQL Docker Image: mysql
- Create a Docker container for MySQL, use the following command to run the container with MySQL 8.0 (Debian) and map the default port:
docker run --name mySqlApp -e MYSQL_ROOT_PASSWORD=YOURPASSWORD -p 3306:3306 -d mysql:8.0-debian
-
Update the
appsettings.Development.jsonfile (insidesrc/RateMovie.Api/appsettings.Development.json) with your local MySQL credentials.
{
"ConnectionStrings": {
"ConnectionMYSQL": "server=localhost;user=root;password=YOURPASSWORD;database=CashFlowDB"
}
}- Execute through the startup project RateMovie.Api
