Skip to content

Template to generate dotnet backend APIs with SQL Server and Entra ID support

Notifications You must be signed in to change notification settings

Apex-CS/il-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Innovation Lab Backend Template

Description

This is a template project aimed to create backends for Innovation Labs. It's using C# and ASP.NET Core targetting .NET 8 with the following packages included:

  • FastEndpoints: an opinionated framework to create endpoints using the REPR (Request-Endpoint-Response) Design Pattern. Please follow the documentation to configure endpoints. All endpoints in the template are in the folder Features (following the Vertical-Slice-Architecture). Given that, we don't use MVC or Controllers anymore as they are slow in performance and it's a pattern that many other languages abandoned way long time ago.
  • Entity Framework Core 8 with SQL Server support. All models are added in the Models folder and the context file is located in the Data folder.
  • Microsoft Identity Web (to access Microsoft's Entra ID-generated JWTs).

Installation

To install the template globally in your machine, open any terminal (powershell, cmd) and follow these steps:

  • Clone this repo and change the directory to the newly cloned folder.
  • Execute dotnet new install . to install the template.

After that, the new template will be available to be used in any IDE (like Visual Studio or JetBrains Rider).

image

image

Settings

We recommend using User Secrets as they're a secure way to have secrets in the local machine and not in the repository you'll upload it. Remember to create an app registration to generate access to Entra ID (the settings required for Microsoft Identity).

{
    "ConnectionStrings:DefaultConnection": "<database connection string>",
    "AzureAd:ClientId": "<entra id requirement>",
    "AzureAd:TenantId": "<entra id requirement>",
    "AzureAd:Instance": "<entra id requirement>",
    "AzureAd:Scope": "<entra id requirement>"
}

Don't forget

  • Models in this template are using the Entity-First approach. You need to install the dotnet ef tools to generate migrations and apply them.
  • Any database provider that supports EF Core can be used if SQL Server is not needed.
  • As any other dotnet project, this can be extended in any way possible.

About

Template to generate dotnet backend APIs with SQL Server and Entra ID support

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages