dotnet-web-api-boilerplate icon indicating copy to clipboard operation
dotnet-web-api-boilerplate copied to clipboard

A boilerplate / starter template for Web API server based on ASP .Net.

.Net Web API boilerplate

Generate Repo GitHub Workflow Status GitHub release

A boilerplate / template for a WebAPI server based on ASP.Net.

Scope

This API boilerplate includes the following:

  • Role based JWT authentication.
  • Web API Helpers which standardizes responses, maps errors, etc...
  • An implementation of CSV Error logger.
  • A core library with the following
    • Custom data model attributes
    • Database adapter
    • Helper functions for hashing, encrypting, compression, random number & character generation, etc...
  • A constants library for commonly used constants.

Notice

Before using the code in production

Change the following values
  • In appsettings.json
    1. Database connection string.
    2. JWT secret, issuer and audience
  • In Base class in Operations, uncomment the line that establishes db connection
  • Update the login controller & user lib.
  • This project has a default editorconfig file. If needed customize it.
Remove the following
  • Values controller & values lib