Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abdulrahmanaymann/imdbclone-restfulapi
IMDB Clone RESTful API.
https://github.com/abdulrahmanaymann/imdbclone-restfulapi
asp-net-core asp-net-core-web-api auto-mapper caching csharp dotnet dtos ef-core filtering identity jwt-authentication n-tier-architecture pagination refresh-token repository-pattern restful-api sql-server swagger tmdb-api unit-of-work-pattern
Last synced: 16 days ago
JSON representation
IMDB Clone RESTful API.
- Host: GitHub
- URL: https://github.com/abdulrahmanaymann/imdbclone-restfulapi
- Owner: abdulrahmanaymann
- Created: 2024-10-15T22:43:57.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2024-10-30T11:36:11.000Z (2 months ago)
- Last Synced: 2024-11-06T09:54:52.357Z (about 2 months ago)
- Topics: asp-net-core, asp-net-core-web-api, auto-mapper, caching, csharp, dotnet, dtos, ef-core, filtering, identity, jwt-authentication, n-tier-architecture, pagination, refresh-token, repository-pattern, restful-api, sql-server, swagger, tmdb-api, unit-of-work-pattern
- Language: C#
- Homepage:
- Size: 2.5 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![Logo](https://i.imgur.com/srymhmQ.png)
# ๐ฌ IMDBClone RESTful API
## ๐ Description
The **IMDBClone RESTful API** is a backend application that replicates key features of IMDb, managing movie-related data, user authentication, ratings, reviews, and watchlists. It supports secure authentication and role-based access controls, allowing for flexible management of users and interactions.
---
## ๐ Technologies
- **Programming Language**: C#
- **Framework**: ASP.NET Core
- **Database**: SQL Server
- **ORM**: Entity Framework Core
- **Authentication**: JWT (JSON Web Tokens)
- **Caching**: IMemoryCache
- **Web Scraping**: Python
- **External API**: TMDB API---
## ๐ Data Integration
- **Web Scraping**: Uses Python scripts to gather additional movie data from external sources, enhancing the database with up-to-date information.
- **TMDB API**: Integrates with The Movie Database (TMDB) API for real-time movie data fetching, ensuring users always have access to the latest information.---
## ๐ Architecture
The API follows a layered architecture that promotes modularity and separation of concerns, utilizing Unit of Work and Repository patterns for efficient data handling.
- **Business Layer**: Contains services and mapping profiles for business logic and DTO mappings.
- **Common Layer**: Stores constants, enums, settings, and utility classes.
- **Core Layer**: Defines data models, DTOs, and validation attributes.
- **Data Access Layer**: Manages database operations with Repository and Unit of Work patterns.
- **Web API Layer**: Exposes RESTful endpoints to handle client interactions.---
## ๐ Backend Structure
### **Project Modules**
- **IMDbClone.Business**
- **Services**: Interfaces and implementations for application functionalities like authentication, caching, and data management.
- **Mapper**: Configures mappings between DTOs and models.
- **IMDbClone.Common**
- **Constants**: Defines roles, HTTP status codes, and cache keys.
- **Settings**: Manages configurations for caching and other settings.
- **IMDbClone.Core**
- **DTOs**: Data transfer objects for movies, users, ratings, reviews, and watchlists.
- **Models**: Entity models defining the application's data structure.
- **Utilities**: Provides pagination, expression handling, and validation.
- **IMDbClone.DataAccess**
- **Repository**: Implements data operations using Unit of Work for transactional integrity.
- **IMDbClone.WebAPI**
- **Controllers**: Exposes API endpoints to handle requests and responses.---
## ๐ฎ Controllers Overview
### 1. **AuthController** ๐
Handles user authentication and profile management operations.| Endpoint | Method | Description | Auth Required |
|---------------------------|--------|--------------------------------------------|---------------|
| `/api/auth/register` | POST | Register a new user | โ |
| `/api/auth/login` | POST | Login and receive JWT tokens | โ |
| `/api/auth/refresh-token` | POST | Refresh access tokens | โ |
| `/api/auth/profile` | GET | Retrieve profile of the logged-in user | โ |
| `/api/auth/profile` | PUT | Update profile of the logged-in user | โ |### 2. **MovieController** ๐ฌ
Manages movie data, including addition, retrieval, updating, and deletion.| Endpoint | Method | Description |
|-------------------------|--------|-----------------------------------------------------|
| `/api/movies` | GET | Retrieve all movies with optional filters |
| `/api/movies/{id}` | GET | Retrieve details for a specific movie |
| `/api/movies` | POST | Add a new movie to the database |
| `/api/movies/{id}` | PUT | Update existing movie details |
| `/api/movies/{id}` | DELETE | Remove a movie from the database |### 3. **RatingController** โญ
Controls movie ratings, allowing users to add, view, update, and delete ratings.| Endpoint | Method | Description |
|-------------------------|--------|----------------------------------------|
| `/api/ratings` | GET | Retrieve all ratings |
| `/api/ratings/{id}` | GET | Retrieve a specific rating |
| `/api/ratings` | POST | Submit a new rating |
| `/api/ratings/{id}` | PUT | Update an existing rating |
| `/api/ratings/{id}` | DELETE | Delete a rating |### 4. **ReviewController** ๐
Manages user reviews for movies, including retrieval, creation, updating, and deletion.| Endpoint | Method | Description |
|-------------------------|--------|-----------------------------------------------------|
| `/api/review` | GET | Retrieve all reviews |
| `/api/review/{id}` | GET | Retrieve a specific review |
| `/api/review` | POST | Create a new review |
| `/api/review/{id}` | PUT | Update an existing review |
| `/api/review/{id}` | DELETE | Delete a review |### 5. **WatchlistController** ๐ฅ
Handles watchlists for users, allowing them to manage their movie collections.| Endpoint | Method | Description |
|-------------------------|--------|-----------------------------------------------------|
| `/api/watchlist` | GET | Retrieve all movies in the userโs watchlist |
| `/api/watchlist/{id}` | GET | Retrieve details of a specific movie in watchlist |
| `/api/watchlist` | POST | Add a movie to the userโs watchlist |
| `/api/watchlist/{id}` | DELETE | Remove a movie from the userโs watchlist |### 6. **UserController** ๐ค
Manages user profiles, roles, and administrative account operations.| Endpoint | Method | Description | Auth Required |
|------------------------------|--------|------------------------------------------------|---------------|
| `/api/users` | GET | Retrieve all registered users with filtering | โ |
| `/api/users/{userId}` | GET | Retrieve a specific user profile by ID | โ |
| `/api/users/{userId}` | DELETE | Delete a specific user from the system | โ |
| `/api/users/{userId}/roles` | GET | Retrieve roles assigned to a specific user | โ |
| `/api/users/{userId}/roles` | POST | Assign a role to a specific user | โ |
| `/api/users/{userId}/roles` | PUT | Update roles assigned to a specific user | โ |
| `/api/users/{userId}/roles` | DELETE | Remove a role from a specific user | โ |
| `/api/users/roles` | GET | Retrieve all available roles | โ |---
## ๐ Project Structure
```
IMDbClone
โ
โโโ IMDbClone.Business
โ โโโ Mapper
โ โ โโโ MappingProfile.cs
โ โโโ Services
โ โ โโโ IServices
โ โ โ โโโ IUserService.cs
โ โ โโโ auth
โ โ โโโ cache
โ โ โโโ movie
โ โ โโโ rating
โ โ โโโ review
โ โ โโโ watchlist
โ โ โโโ token
โ โ โโโ user
โ โ โโโ UserService.cs
โ
โโโ IMDbClone.Common
โ โโโ Constants
โ โ โโโ Roles.cs
โ โ โโโ HttpStatusCodes.cs
โ โ โโโ CacheKeys.cs
โ โโโ Settings
โ โโโ CacheSettings.cs
โ
โโโ IMDbClone.Core
โ โโโ DTOs
โ โ โโโ AuthDTOs
โ โ โ โโโ LoginRequestDTO.cs
โ โ โ โโโ LoginResponseDTO.cs
โ โ โ โโโ RefreshTokenRequestDTO.cs
โ โ โ โโโ RegistrationRequestDTO.cs
โ โ โโโ MovieDTOs
โ โ โ โโโ CreateMovieDTO.cs
โ โ โ โโโ MovieDTO.cs
โ โ โ โโโ MovieSummaryDTO.cs
โ โ โ โโโ UpdateMovieDTO.cs
โ โ โโโ RatingDTOs
โ โ โ โโโ CreateRatingDTO.cs
โ โ โ โโโ RatingDTO.cs
โ โ โ โโโ UpdateRatingDTO.cs
โ โ โโโ ReviewDTOs
โ โ โ โโโ CreateReviewDTO.cs
โ โ โ โโโ ReviewDTO.cs
โ โ โ โโโ UpdateReviewDTO.cs
โ โ โโโ UserDTOs
โ โ โ โโโ UserDTO.cs
โ โ โ โโโ UserProfileDTO.cs
โ โ โโโ WatchlistDTOs
โ โ โโโ CreateWatchlistDTO.cs
โ โ โโโ WatchlistDTO.cs
โ โโโ Enums
โ โ โโโ Genre.cs
โ โโโ Exceptions
โ โ โโโ ApiException.cs
โ โโโ Models
โ โ โโโ ApplicationUser.cs
โ โ โโโ Movie.cs
โ โ โโโ Rating.cs
โ โ โโโ Review.cs
โ โ โโโ Watchlist.cs
โ โโโ Responses
โ โ โโโ APIResponse.cs
โ โโโ Utilities
โ โ โโโ PaginatedResult.cs
โ โ โโโ ExpressionUtilities.cs
โ โโโ Validation
โ โโโ FullNameAttribute.cs
โ โโโ ValidCastAttribute.cs
โ
โโโ IMDbClone.DataAccess
โ โโโ Data
โ โ โโโ ApplicationDbContext.cs
โ โโโ DbInitializer
โ โ โโโ DBInitializer.cs
โ โโโ Migrations
โ โโโ Repository
โ โโโ IRepository
โ โโโ WatchlistRepository.cs
โ โโโ UserRepository.cs
โ โโโ UnitOfWork.cs
โ โโโ ReviewRepository.cs
โ โโโ Repository.cs
โ โโโ RatingRepository.cs
โ โโโ MovieRepository.cs
โ
โโโ IMDbClone.WebAPI
โ โโโ Controllers
โ โ โโโ AuthController.cs
โ โ โโโ MovieController.cs
โ โ โโโ RatingController.cs
โ โ โโโ ReviewController.cs
โ โ โโโ UserController.cs
โ โ โโโ WatchlistController.cs
โ โโโ Program.cs
โ โโโ appsettings.json
```
---## ๐ Getting Started
1. Clone the repository.
```bash
git clone https://github.com/yourusername/IMDbClone-API.git
```
2. Install dependencies and set up the database.
3. Configure environment variables for database connection, JWT, TMDB API keys, and any other required settings.
4. Run the application using your preferred IDE or command line.---