Git Product home page Git Product logo

dotnet-web-api-boilerplate's Introduction

.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 Helper which standardizes responses, maps errors, etc...
  • An implementation of Serilog for logging.
  • 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
  • Update the login controller, user lib & auth lib.
  • In program.cs
    1. Update CORS websites list
Remove the following
  • Values controller, values lib & corresponding interfaces

dotnet-web-api-boilerplate's People

Contributors

azure-pipelines[bot] avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar kolappannathan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dotnet-web-api-boilerplate's Issues

API response model

All responses should be in same format defined by API Response class.

New date attributes

  • Move date attributes to a date namespace inside attributes
  • Change onlyfuture to FutureOnly

Create the following new attributes

  • PastOnly
  • past and present

Captcha generation

Add an API to get captcha. Either use ReCaptcha or a FOSS nuget package

DateLib

Create a new DateLib under utils with the following functions,

  • CombaineDateAndTime //combines date and time from different DateTime objects

Don't encrypt connection string in appsettings.json

Anyone with access to the source code can already decrypt it and find the original key as the encryption key is stored with the connection string. Hence this is not needed and makes the process the changing the connection string difficult.

Dependabot couldn't find a <anything>.(cs|vb|fs)proj for this project

Dependabot couldn't find a .(cs|vb|fs)proj for this project.

Dependabot requires a .(cs|vb|fs)proj to evaluate your project's current .NET dependencies. It had expected to find one at the path: /<anything>.(cs|vb|fs)proj.

If this isn't a .NET project, or if it is a library, you may wish to disable updates for it from within Dependabot.

You can mention @dependabot in the comments below to contact the Dependabot team.

Simplify Adding claims

  • Combine common tasks in Adding claims. Use generic function for adding all claims.
  • Add additional registered claims such as issuer

Security Lib functions for encryption

New security lib functions

  • Encryption & decryption (use system or standars nuget)
  • URL friendly encryption & decryption

Achieve the second via a helper function that convert strings to URL friendly one and in reverse

File response

Add new function "CreateFileResponse" in web api helper

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.