A .NET Web API service for storing and managing employee data.
- CompanyVault specification.
- How to run locally.
- How to run tests.
- Architecture and design decisions.
CompanyVault is a web API service written with ASP.NET Core and Entity Framework that allows you to:
- Upload employee data in CSV format (a sample).
- Retrieve employee and company data with the endpoints defined in the specification.
- You have installed a Git client.
- You have installed .NET version
8.0.x
or later.
To verify, run in terminal:
git --version
dotnet --version
Run in terminal:
git clone git@github.com:luarvic/CompanyVault.git
Run in terminal:
cd CompanyVault/src/CompanyVault.WebApi
Run in terminal:
dotnet run
Make sure you see Application started. Press Ctrl+C to shut down.
in the terminal window.
Open http://localhost:5068/swagger in web browser.
Make sure you see a page with Swagger UI
title.
Run in terminal:
cd CompanyVault/tests/CompanyVault.WebApi.Tests
Run in terminal:
dotnet test
Make sure you see Passed!
.
data
contains data samplesdocs
contains requirementssrc
contains source codeCompanyVault.WebApi
contains the service projectControllers
contains classes that implement endpointsFormatters
contains classes that add custom formatters, e.g. CSV input formatterMiddlewares
contains classes the implement custom middlewares, e.g. exception handler middlewareMigrations
contains classes generated by Entity Framework migrationsModels
contains classes that represent domain entities and data transfer objects (DTOs)Properties
contains launch settingsRepositories
contains classes that implement Repository and Unit of Work patternsServices
contains classes that implement business logic, e.g. mapping CSV data to DTOs, and DTOs to entities
tests
contains unit and integration testsCompanyVault.WebApi.Tests
contains the test projectIntegrationTests
contains classes that test endpoints by sending HTTP requests to the service with mocked infrastructure, i.e. databaseUnitTests
contains classes that test the services
Among other things, CompanyVault.WebApi
project depends on the following NuGet packages:
- CsvHelper simplifies CSV data loading.
- AutoMapper simplifies objects mapping.
- Microsoft.EntityFrameworkCore.Sqlite enables SQLite database in Entity Framework.
Among other things, CompanyVault.WebApi.Tests
project depends on the following NuGet packages:
- NSubstitute mocks objects for testing.
- xunit is a unit testing framework.