Skip to content

Techblogy/Boilerplate-new

 
 

Repository files navigation

Boilerplate

Quality Gate Status Sonar Cube Static Analysis Coverage Reliability Rating Technical Debt Maintainability Rating Security Rating Bugs Vulnerabilities Duplicated Lines (%) Build

Table of Contents

  1. About The Project
  2. Getting Started
  3. Usage
  4. Business Rules
  5. Screenshots
  6. What Is Next?

About The Project

The project is a template for new projects. It is always an ongoing project in order to adapt it to the newer versions of .NET environments. There is a CRUD operation with one entity. Also, the project includes security, tests, mappings, repository, middlewares, and so on.

The main point of the project is to create a base for new projects.

Built With

You can find the used technologies below.



Getting Started

Prerequisites

Installation

You can find two ways to start the project below.

First way;

  1. Clone the repo
   https://github.com/ckaraboran/Boilerplate-new.git
  1. Find the Boilerplate.Api folder and run the project
   C:\Projects\Boilerplate\Presentation\Boilerplate.Api>dotnet run

Second way;

  1. Open the solution with Visual Studio

  2. Run the project

Usage

There are endpoints for dummies in order to add, update, delete and get them by using database. You can find the related endpoints below.

   (GET) {https://localhost:5001/api/dummy
   (GET) https://localhost:5001/api/dummy/1
   (POST) https://localhost:5001/api/dummy
   (PUT) https://localhost:5001/api/dummy
   (DELETE) https://localhost:5001/api/dummy/1

There are two ways to use the endpoints of the Boilerplate Api. The first way is to use Swagger which is integrated to API. The second way is to use Postman collections. The requests are ready to use in Postman collections.

Swagger

You can see the details about the requests by clicking the endpoint like below. You should execute after setting the request.

Postman

There are environment and collection files under docs/postman folder. You should import them to your Postman workspace by applying the steps in https://learning.postman.com/docs/getting-started/importing-and-exporting-data/.

After that, you can work on endpoints by modifying the requests.

Business Rules

There no business rules in Boilerplate API.

Screenshots

  • I checked the code issues with ReSharper.

Code Quality

As you can see in the beginning of document, the project is integrated to Sonarqube Cloud. You can find the statistics of code smells, vulnerabilities, security hotspots and bugs. You can check the Sonarqube dashboard via https://sonarcloud.io/project/overview?id=ckaraboran_Boilerplate-new

What Is Next?

You can find a couple of advices below in order to make the Insurance API better.

  • Adding NewRelic (free) to show the logs in console and txt file (maybe Sentry integration)
  • Adding fluent validation
  • Adding mock library to put all mock objects into one place
  • Adding Swagger specifications
  • Adding summary comments
  • Adding versioning
  • Adding integration tests
  • Adding more tests in Postman
  • Adding audit log
  • Adding custom ApiResponse object
  • Adding rate limiting (HTTP 429 status code will be returned)
  • Adding open telemetry
  • Adding Elastic APM integration for monitoring about API
  • Adding MediatR library in order to apply CQRS before the project getting bigger
  • Adding cloud features
  • Adding cancellation tokens
  • Adding caches
  • Checking Microsoft documents for performance tips (https://docs.microsoft.com/en-us/dotnet/api/system.threading.cancellationtoken?view=net-6.0)
  • Adding Dockerfile
  • Adding helm charts
  • Adding Kubernetes deployment

And of course, we can enrich the project with many things more...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 99.1%
  • PowerShell 0.9%