.NetFlicks is a .NET Core sample app for renting digital movies and viewing details such as cast and crew. It contains custom-built data tables for efficient paging, searching, sorting and editing of thousands of items. Its main focus is to showcase best practices for multitier system architecture, database design and intuitive, mobile-friendly UI. This project has been a great learning experience for me and I hope it can help other developers looking for a solid template to build on.
- Server
- Client
The database for this solution uses Entity Framework and ASP.NET Identity. I chose not to use Identity Roles, instead allowing all users to see both the Client and Administrator UI at once for simplicity. The database, called DotNetFlicksDb, is automatically seeded with data for 40 movies, provided by TMDB.
This solution is divided into four layers based on IDesign methodology:
Layer | Description | Able to Call | Model |
---|---|---|---|
Clients | An entry-point to the system, such as an MVC site or REST API | Managers | ViewModel |
Managers | Manages the workflow of a call chain, handles business logic | Engines, Accessors | DTO |
Engines | Encapsulates algorithms and business logic (optional layer) | Accessors | DTO |
Accessors | Accesses data from resources like databases and APIs | None | Entity |
IDesign is a closed architecture that focuses on encapsulating volatility, minimizing coupling and separation of concerns. The official IDesign documentation is sparse, so I'd recommend reading Software architecture and project design, a mechanized approach for a quick intro to the method.
Here's my implementation of IDesign for this solution:
- Install the following:
- .NET Core 2.2 SDK
- Visual Studio Community 2017 (15.7+ is required for Core 2.2, select
ASP.NET and web development
workload during installation)
- Download this repository
- Open the solution in Visual Studio and run the Web project (this may take some time, as it will create and seed the database)
- Log into the default administrator account (email:
[email protected]
, password:p@ssWORD471
) or create your own account to start using the site
- Access/manage database
- Inside Visual Studio, open the SQL Server Object Explorer window by going to View->SQL Server Object Explorer
- Expand
(localdb)\MSSQLLocalDB
and theDatabases
folder to findDotNetFlicksDb
(exists only after you first run the project)
- Catch emails in development
- Install Papercut, a fake SMTP server that you can use to catch outgoing emails in development
- View logs and exceptions
- In order to view a list of all logs and exceptions from your current IIS session, add
/elm
to the base URL - This is made possible by the ELM (Error Logging Middleware) package, which you can read more about here
- For more information on logging, check out Microsoft's Introduction to Logging in ASP.NET Core
- In order to view a list of all logs and exceptions from your current IIS session, add
- Can't find a LocalDB instance in SQL Server Object Explorer
- Open Visual Studio Installer
- Modify your Visual Studio Installation
- Go to the
Individual Components
tab - Scroll down to the
Cloud, database and server
section - Ensure that
SQL Server 2016 Express LocalDB
is checked and clickModify
- Admin Settings pages are slow or unresponsive
- LocalDB requires a certain amount of free memory to efficiently run large database queries
- Try closing processes until your memory usage drops and then reload the page