BMDb API is a RESTful API for a movie database built with ASP.NET Core (.NET 10) and Entity Framework Core.
- User authentication and authorization using JWT tokens with refresh tokens
- CRUD operations for movies with an admin role
- Search movies by title, genre, director, IMDB id and release date
- Pagination and sorting for movie lists
- ASP.NET Core (.NET 10)
- Entity Framework Core
- PostgreSQL
- FluentValidation
- JWT Bearer Authentication with email access-code confirmation (passwordless)
- CORS
- Serilog
- Swagger
POST /api/auth/register- Register a new userPOST /api/auth/login- Login with access codePOST /api/auth/refresh-token- Refresh JWT tokenPOST /api/auth/forget-access-code- Request a new access codePOST /api/auth/logout- Logout the current user
GET /api/movies— Get all movies (with support for filtering, sorting, pagination, and search by title, genre, director, year)GET /api/movies?title={title}— Get movies by titleGET /api/movies?genre={genre}— Get movies by genreGET /api/movies?director={director}— Get movies by directorGET /api/movies?year={year}— Get movies by release yearGET /api/movies/{id}— Get a movie by IDGET /api/movies/imdb/{imdb}— Get a movie by IMDB IDGET /api/movies/random?limit={limit}— Get random movies (with optional limit)
POST /api/admin/add-movie- Add a new moviePUT /api/admin/update-movie/{id}- Update a movieDELETE /api/admin/delete-movie/{id}- Delete a movieGET /api/admin/get-by-id/{id}- Get a movie by ID (admin)
The project follows a clean architecture pattern with the following layers:
- Presentation Layer: Contains the API controllers and Middlewares.
- Core Layer: Contains the business logic, application services, DTOs, and validators.
- Infrastructure Layer: Contains the data access layer (Entity Framework Core, repositories), JWT authentication wiring, and the JWT/email service implementations.
- Domain Layer: Contains the domain entities, shared response models (
ResponseModel), and exception types.
The API has two clients: a Blazor WebAssembly application for user registration and access code recovery, and an Angular application for user login and movie browsing.