BlazorMovieApp is a .NET 8 Blazor WebAssembly (WASM) application that integrates with The Movie Database (TMDB) API to provide a user-friendly movie discovery experience. The app showcases popular, top-rated, now playing, and upcoming movies, along with detailed information about movies, cast, crew, and providers.
- Popular Movies: Display the most popular movies.
- Now Playing: Show currently playing movies.
- Top-Rated: Browse top-rated movies.
- Upcoming Movies: Discover movies that are coming soon.
- Movie Search: Search for movies by title, category, person, or genre.
- Movie Details: Detailed view of individual movies, including cast, crew, and watch providers.
- Cast/Crew Details: View detailed profiles of cast/crew.
- Caching: Improves performance with session storage caching for frequently accessed data.
- Framework: .NET 8 Blazor WASM
- API: TMDB API
- Frontend: Razor Components, CSS (custom styles)
- Backend Services: C# with dependency injection
- Caching: JavaScript interop with session storage
- IDE: Visual Studio
- Source Control: GitHub
- Responsive Design: Bootstrap 5.3.3
-
TMDBClient
- Core API client for TMDB.
- Handles all API calls with support for error handling and configurable headers.
-
PopularMovieService
- Retrieves and maps popular movies from TMDB API.
-
NowPlayingMovieService
- Fetches and maps currently playing movies.
-
TopRatedService
- Fetches and maps top-rated movies.
-
UpcomingComingSoonService
- Retrieves upcoming movies.
-
SearchMovieService
- Handles movie search queries with validation for non-empty input.
-
CreditService
- Provides cast/crew details for specific movies.
-
ProviderService
- Retrieves available watch providers for specific movies.
-
CacheService
- Implements session storage for caching API responses to optimize performance.
-
PersonService
- Fetches details of individual cast/crew.
Service Level API Implementation -TMDBClient.cs builds the raw API calls -Services allow for filters and other logic to be applied to the API calls as desired. -Uniformity is maintained for all calls regardless of complexity -Structure facilitates expandability for future filters and database accomodation.
Session Storage -Eliminates frequent API calls to established categories(found on the nav bar) that may experience multiple clicks. -An expiration time was not set because the stored data is unlikely to change for the session's duration.
-
MoviePageComponent
- Displays paginated lists of movies.
-
MovieDetailsPage
- Detailed view of a movie, including its overview, cast, crew, and providers.
-
PersonCardComponent
- Shows actor profiles with hover effects for more details.
-
MainCreditComponent
- Displays key credits for a movie.
-
PersonCarouselComponent
- Carousel showcasing actors associated with a movie.
-
MovieDetailsPage.razor.css
- Styling for the detailed movie view.
-
PersonCardComponent.razor.css
- Hover effects for actor cards.
- Utilizes a factory pattern and generics to enhance code reusability.
- Adheres to the Single Responsibility Principle (SRP) and promotes inheritance where applicable.
- Follows the DRY (Don't Repeat Yourself) principle for maintainable and clean code.
- Implements dependency injection for better testability and modularity.
-
Clone Repository:
git clone [repository_url] cd BlazorMovieApp
-
Configure API Key:
- Add your TMDB API key to
appsettings.json
under the keyTMDBKey
.
- Add your TMDB API key to
-
Run Application:
- Open the solution in Visual Studio.
- Set
BlazorMovieApp
as the startup project. - Press
F5
to run the application.
-
Deploy:
- Publish the app to a hosting platform like Azure or GitHub Pages following Blazor WebAssembly deployment guidelines.
- Ensure proper attribution when displaying watch providers as per TMDB API guidelines.
- Caching is implemented using session storage for better performance.
- Fork the repository.
- Create a new branch for your feature.
- Commit your changes.
- Open a pull request.
This project is licensed under the MIT License.
In Development
Enjoy using BlazorMovieApp for your movie discovery needs!