Showcase of a comprehensive API with end-to-end on asp.net core
- JWT Auth
- REST compliance
- Uni testing
- Integration testing
- Docker build
- Docker compose deploy
- .Net Core 3.1
- Asp .Net Core 3.1
- EntityFrameworkCore 3
- MediaTr
- FluentValidation
- Docker for windows
- Docker compose
- XUnit
- NSubstitute
- SQL Server 2019
- dotnet cli
- Docker for Windows
- Docker compose
- Visual Studio 2019
- Visual Studio Code
- Sql Server Management Studio
- Install dotnet 3.1
- Install Visual Studio or Visual studio Code
- Install Docker and Docker compose
- Go to
src/api/Api
- Restore dependencies by running
dotnet restore
- Open the configuration file
src/api/Api/appsettings.Development.json
- Change the
ConnectionString
inside the configuration to your correct sql server database configuration"ConnectionString": "Server=WINDOWS-B21L2V2;Database=Company;Trusted_Connection=True;App=CompanyAPI",
- Go to
src/api/Api
and rundotnet run
- Make sure to have
Docker for Windows
installed - Go to
src/api
- Run
docker build . -t company:lastest
- Run
docker run company:lastest -e ConnectionString=YOUR_DATABASE_CONNECTIONSTRING
- Move to
src/deploy
- Run
docker-compose build
- Run
docker-compose up
- Move to
src/tests/Company.UnitTests
- Run
dotnet test
- Move to
src/tests/Company.IntegrationTests
- Run
dotnet test
- go to
src/api/Api/appsettings.json
- Change the username and password on the
Auth
settings
"Auth": {
"UserName": "superadmin",
"Password": "P@ss123"
}
- go to
src/api/Api/appsettings.json
- Change the Issuer and key on the
Jwt
Settings
"Jwt": {
"Issuer": "Company",
"Key": "0d734a1dc94fe5a914185f45197ea846"
},