This project is a RESTful Web API built using ASP.NET Core for managing movie-related data, inspired by the Internet Movie Database (IMDB). It provides endpoints to handle Actors, Genres, Movies, Producers, and Reviews. The API supports full CRUD (Create, Read, Update, Delete) operations for each entity, making it suitable for a movie catalog backend.
Key features:
- Entity Framework Core for data access (assumed integration with a database like SQL Server).
- Swagger/OpenAPI for API documentation and testing (accessible at
/swagger). - Modular design with separate controllers for each resource.
- Built with .NET 8 or later for modern performance and features.
This API can be used to build a full-stack movie review application, such as a web or mobile app for browsing films, adding reviews, and managing metadata.
- Backend: ASP.NET Core Web API
- MicroORM: Dapper
- Documentation: Swashbuckle.AspNetCore (Swagger)
- Database: SQL Server (configurable via connection string)
- IDE: Visual Studio
- Version Control: Git/GitHub
IMDB_API/
├── Controllers/
│ ├── ActorsController.cs
│ ├── GenresController.cs
│ ├── MoviesController.cs
│ ├── ProducersController.cs
│ └── ReviewsController.cs
├── Models/
│ ├── Actor.cs
│ ├── Genre.cs
│ ├── Movie.cs
│ ├── Producer.cs
│ └── Review.cs
├── Data/
│ └── ApplicationDbContext.cs
├── Program.cs
├── appsettings.json
├── IMDB_API.csproj
└── README.md
The API follows REST conventions with the base path /api/. All endpoints return JSON and use standard HTTP status codes (e.g., 200 OK, 201 Created, 404 Not Found).
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/Actors |
Get all actors |
| POST | /api/Actors |
Create a new actor |
| GET | /api/Actors/{id} |
Get actor by ID |
| PUT | /api/Actors/{id} |
Update actor by ID |
| PATCH | /api/Actors/{id} |
Partially update actor by ID |
| DELETE | /api/Actors/{id} |
Delete actor by ID |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/Genres |
Get all genres |
| POST | /api/Genres |
Create a new genre |
| GET | /api/Genres/{id} |
Get genre by ID |
| PUT | /api/Genres/{id} |
Update genre by ID |
| PATCH | /api/Genres/{id} |
Partially update genre by ID |
| DELETE | /api/Genres/{id} |
Delete genre by ID |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/Movies |
Get all movies |
| POST | /api/Movies |
Create a new movie |
| GET | /api/Movies/{id} |
Get movie by ID |
| PUT | /api/Movies/{id} |
Update movie by ID |
| PATCH | /api/Movies/{id} |
Partially update movie by ID |
| DELETE | /api/Movies/{id} |
Delete movie by ID |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/Producers |
Get all producers |
| POST | /api/Producers |
Create a new producer |
| GET | /api/Producers/{id} |
Get producer by ID |
| PUT | /api/Producers/{id} |
Update producer by ID |
| PATCH | /api/Producers/{id} |
Partially update producer by ID |
| DELETE | /api/Producers/{id} |
Delete producer by ID |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/Reviews |
Get all reviews |
| POST | /api/Reviews |
Create a new review |
| GET | /api/Reviews/{id} |
Get review by ID |
| PUT | /api/Reviews/{id} |
Update review by ID |
| PATCH | /api/Reviews/{id} |
Partially update review by ID |
| DELETE | /api/Reviews/{id} |
Delete review by ID |
Id(int, primary key)Name(string, required)Bio(string, optional)DateOfBirth(DateTime, optional)
Id(int, primary key)Name(string, required, e.g., "Action", "Drama")
Id(int, primary key)Title(string, required)ReleaseDate(DateTime, required)Description(string, optional)GenreId(int, foreign key)ProducerId(int, foreign key)ActorIds(List, many-to-many)
Id(int, primary key)Name(string, required)Bio(string, optional)
Id(int, primary key)Rating(int, 1-10, required)Comment(string, optional)MovieId(int, foreign key)UserId(string, optional)
Note: Relationships (e.g., Movies to Genres/Producers/Actors) are handled via foreign keys in the database.
-
Clone the Repository:
git clone https://github.com/AtulPDhage/IMDB_API.git cd IMDB_API -
Install Dependencies:
- Ensure .NET SDK 8.0+ is installed: Download here.
- Run:
dotnet restore
-
Configure Database:
- Update
appsettings.jsonwith your SQL Server connection string:{ "ConnectionStrings": { "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=IMDBDb;Trusted_Connection=true;MultipleActiveResultSets=true" } }
- Update
-Add Tables using file in Queries.sql
-
Run the Application:
dotnet run- The API will start at
https://localhost:7001(or check console output). - Swagger UI: Navigate to
https://localhost:7001/swagger.
- The API will start at
-
Test Endpoints:
- Use Swagger UI to execute requests directly in the browser.
- Or use tools like Postman or curl.
- Fork the repo.
- Create a feature branch (
git checkout -b feature/AmazingFeature). - Commit changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Author: Atul P Dhage
- GitHub: AtulPDhage
- Issues: Report bugs or request features here.
Built with passion by Atul P Dhage ❤️