Table of Contents
This is a Web API for handling basic information about movies.
This Web API has build using ASP.NET Core Web API using .NET 6.0. This project presents an elegant architecture using CQRS combine with Mediator Pattern. Here also will find Unit test and Integration Test project using xUnit.Net.
Some of the Nuget Packages used here are:
- Entity Framework Core for SQL Server
- Entity Framework Core In-Memory (for Integration Tests)
- Autommaper
- Serilog
- Fluent Validation
- MediatR
- Asp.Net Core Authentication
- Newtonsoft
- Swashbuckle
- xUnit.Net
Here some steps to run the application
- Visual Studio 2020
- SDK .NET 6
- SQL Server Express 2019 or other version will works.
To start using the application you should.
-
Clone the repo.
git clone https://github.com/helibertoarias/Muvids.git
-
Open the solution Muvids.sln and build to restore the Nuget Packages.
-
Set the project Muvids.Web.API as startup project.
-
Open the file ./Muvids.Web.API/appsettings.json and update the user and password. This API use two databases, one called Muvids for the application and other called MuvidsIdentity for the users.
"ConnectionStrings": { "MuvidsConnectionString": "Server=localhost;Database=Muvids;User Id=<user>;Password=<password>", "MuvidsIdentityConnectionString": "Server=localhost;Database=MuvidsIdentity;User Id=<user>;password=<password>" }
-
In VS 2020 open a new terminal and create the database for the application and the users.
Update-Database -Context MuvidsDbContext Update-Database -Context MuvidsIdentityDbContext
-
After this you can run the application. The Swagger page will show up https://localhost:7098/swagger/index.html
-
To validate the Web API you need to import the file Muvids Collection.postman_collection.json into POSTMAN and run the test collection. Here some screenshots.
- Select the imported file and hit the Run button.
- After a seconds you should the test result all passed.
- An extra end point was added in order to provide a random number from an external web service. You can access from this URL https://localhost:7098/api/Random/getrandom
Use this space to show useful examples of how a project can be used. Additional screenshots, code examples and demos work well in this space. You may also link to more resources.
For more examples, please refer to the Documentation
Heliberto Arias - @helibertoarias - [email protected]
Project Link: https://github.com/helibertoarias/Muvids