Skip to content

A .NET Web API service for storing and managing employee data

Notifications You must be signed in to change notification settings

luarvic/CompanyVault

Repository files navigation

CompanyVault

Dev build status

A .NET Web API service for storing and managing employee data.

Table of Contents

  1. CompanyVault specification.
  2. How to run locally.
  3. How to run tests.
  4. Architecture and design decisions.

CompanyVault Specification

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.

How to Run Locally

Prerequisites

  • 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

Getting Started

1. Clone the Repository

Run in terminal:

git clone git@github.com:luarvic/CompanyVault.git

2. Navigate to the Service Source Directory

Run in terminal:

cd CompanyVault/src/CompanyVault.WebApi

3. Run the Service

Run in terminal:

dotnet run

Make sure you see Application started. Press Ctrl+C to shut down. in the terminal window.

4. Verify Running Service

Open http://localhost:5068/swagger in web browser.

Make sure you see a page with Swagger UI title.

How to Run Tests

1. Navigate to the Service Tests Directory

Run in terminal:

cd CompanyVault/tests/CompanyVault.WebApi.Tests

2. Run the Tests

Run in terminal:

dotnet test

Make sure you see Passed!.

Architecture and Design Decisions

Folders Structure

  • data contains data samples
  • docs contains requirements
  • src contains source code
    • CompanyVault.WebApi contains the service project
      • Controllers contains classes that implement endpoints
      • Formatters contains classes that add custom formatters, e.g. CSV input formatter
      • Middlewares contains classes the implement custom middlewares, e.g. exception handler middleware
      • Migrations contains classes generated by Entity Framework migrations
      • Models contains classes that represent domain entities and data transfer objects (DTOs)
      • Properties contains launch settings
      • Repositories contains classes that implement Repository and Unit of Work patterns
      • Services contains classes that implement business logic, e.g. mapping CSV data to DTOs, and DTOs to entities
  • tests contains unit and integration tests
    • CompanyVault.WebApi.Tests contains the test project
      • IntegrationTests contains classes that test endpoints by sending HTTP requests to the service with mocked infrastructure, i.e. database
      • UnitTests contains classes that test the services

Dependencies

CompanyVault.WebApi Dependencies

Among other things, CompanyVault.WebApi project depends on the following NuGet packages:

CompanyVault.WebApi.Tests Dependencies

Among other things, CompanyVault.WebApi.Tests project depends on the following NuGet packages:

About

A .NET Web API service for storing and managing employee data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages