This is a movie database application that includes a front-end built with WPF using the MVVM pattern and a back-end implemented as a Windows service. Communication between the front-end and back-end is achieved through RabbitMQ.
- WPF (.NET 6)
- RabbitMQ
- Windows Service (.NET Framework 4.8) or Worker Service (.NET 6)
The project is structured into front-end and back-end components:
- Views: Includes XAML files for the list of movies and movie details.
- ViewModels: Implements MVVM pattern with view models for movies list and movie details.
- MovieService.cs: Business logic service for retrieving movie data.
- MoviesRepository.cs: Repository class for accessing movie data (e.g., from a database, hardcoded right now).
- CategoryService.cs: Business logic service for retrieving category data.
- CategoryRepository.cs: Repository class for accessing category data (e.g., from a database, hardcoded right now).
- Models: Defines data models for movies and categories for front-end and back-end.
- Program.cs: Entry point for the Windows service.
- SmitService.cs: Background service responsible for handling RabbitMQ message consumers using MovieService and CategoryService.
- Program.cs: Entry point for the Windows service.
- Worker.cs: Background service responsible for handling RabbitMQ message consumers using MovieService and CategoryService.
- Build the solution using Visual Studio or your preferred IDE.
- Ensure RabbitMQ is installed and running.
- Start the back-end Windows service.
- For .NET Framework service:
- Open Developer Command Prompt for Visual Studio with administrative credentials.
- In Developer Command Prompt for Visual Studio, navigate to the folder that contains your project's output.
- Enter the following command
installutil SmitApp.Backend.exe- Start "Smit Service" service from Services app in Windows
- For .NET 6 Worker service:
- Publish the app using
dotnet publish --output "C:\custom\publish\directory"- Create the Windows Service with PowerShell
sc.exe create "Smit Service" binpath="C:\Path\To\SmitApp.BackendWorker.exe"- Start "Smit Service" service from Services app in Windows
- Run the WPF application for the front-end.
- RabbitMQ server details can be configured in the RabbitMQ connection settings within the code.
The project includes unit tests for the MovieService methods. These tests use the MSTest framework and Moq for mocking.
To run the tests, use your preferred test runner.
This project is licensed under the MIT License.