Video Demo: Watch Here
The Blazor Movies Project is a dynamic web application developed for Harvard University's CS50 course. This project leverages Blazor WebAssembly and ASP.NET Core to create an interactive movie listing platform. Users can view, create, update, and delete movie listings through a clean and intuitive interface. The application is connected to a SQL Server database that stores all movie data, making it a full-stack solution.
- User Authentication: Supports user registration and login, allowing for differentiated access levels.
- CRUD Operations: Authenticated users can create, update, and delete movie listings, while unauthenticated users can only view the listings.
- Responsive Design: The application is fully responsive, providing a consistent experience across various devices and screen sizes.
- Real-time Data Interaction: Utilizes Blazor's capabilities for real-time UI updates when data changes.
To run this project locally, you will need to set up both the Blazor WebAssembly frontend and the ASP.NET Core backend. Follow these steps:
- Clone the repository to your local machine.
- Ensure you have .NET 5.0 or later installed.
- Navigate to the
MoviesApi
project directory and rundotnet run
to start the backend server. - Navigate to the
BlazorMoviesProject
directory and rundotnet run
to start the frontend application. - Access the application via
http://localhost:5000
.
After setting up the project, you can:
- Register/Log in: To access administrative features.
- Browse Movies: All users can browse the existing movie listings.
- Manage Movies: Logged-in users can add, edit, or delete movies.
To set up the database for the Blazor Movies Project, follow these steps:
Ensure you have SQL Server Management Studio (SSMS) installed on your machine. If not, you can download it from SQL Server Management Studio (SSMS).
-
Navigate to the DatabaseScripts Folder:
- Open your project in Visual Studio.
- Navigate to the
DatabaseScripts
folder.
-
Open SQL Server Management Studio (SSMS):
- Launch SQL Server Management Studio.
- Connect to your SQL Server instance.
-
Execute the Scripts:
- In SSMS, open a new query window.
- Drag and drop the SQL script file from the
DatabaseScripts
folder into the query window or use theFile -> Open -> File...
option to navigate and open the script file. - Execute the script by pressing
F5
or clicking on theExecute
button.
Once the database is created, update the connection strings in the appsettings.json
file of your ASP.NET Core project to match your SQL Server instance details. This ensures that your application can connect to the newly created database.
After running the scripts, use SSMS to browse to the SQL Server instance and check if the database and its tables are created correctly and populated with initial data as expected.
If you encounter any issues during the database setup, review the SQL script for any errors and ensure your SQL Server instance is configured to allow script executions. Check for any permission issues that might prevent scripts from running.
- If modifications are needed based on your environment (e.g., changing database names, schema details), adjust the scripts accordingly before executing.
- Regularly backup your database once changes are made to ensure data safety.
This project uses the following open-source packages:
- Blazor WebAssembly
- ASP.NET Core
- Entity Framework Core
- SQL Server
This project is released under the MIT License.