The purpose of this repository is to standardize development and deployment workflow for ASP.NET Core based server side development. It contains a sample web API application built with .NET Core.
Best practices related to .NET Development have been followed while developing this template application. It is however, not absolute and any improvement in this template is highly encouraged. :star: :rocket: :octocat:
Please read CONTRIBUTING.md before starting to contribute in this project.
- Git Version Control System
- .NET 6 SDK & Runtime
- EF Core Command Line Tool v 6.0.0+
- PostgreSQL v13.2 / SQL Server 2017 Express Edition+ with SQL Server Authentication enabled
- Visual Studio 2022 Community Edition / Visual Studio Code with OmniSharp extension installed / JetBrains Rider
- Docker v20.10.6 build 370c289 or above
- Docker Compose v3.7+
- Additional setup needed for generating unit test coverage reports described here
Project Type | Project Name | Usage |
---|---|---|
ASP.NET Core Web API | ASP.NET-Core.WebAPI | Main web API project |
.NET Core Class Library | NET-Core.Library.Domain | Application domain logic de-coupled |
.NET Core Console Application | NET-Core.Console.DB.PostgreSQL | Sample PostgreSQL database configurations with Entity Framework (EF) Core migration pre-configured |
.NET Core Console Application | NET-Core.Console.DB.SqlServer | Sample SQL Server database configurations with Entity Framework (EF) Core migration pre-configured |
XUnit | NET-Core.XUnit.UnitTests | Unit testing project |
Item Name | Type | Purpose |
---|---|---|
.github | Directory | Contains GitHub Action scripts (CI/CD) |
.vs | Directory | Contains Visual Studio setting files |
.dockerignore | File | Contains definitions of files to be ignored by Docker Engine during image building process |
.editorconfig | File | |
.gitignore | File | Contains definitions of files to be ignored by Git |
Scripts | Directory | Contains all scripts related to this repository |
Scripts\repository-files-renamer.ps1 | File | This Powershell script file can be used to automatically renaming directories/files, replacing file contents to set up a new solution from this template repository |
CONTRIBUTING.md | File | GitHub repository contributions mark-up file |
docker-compose.yml | File | Docker compose file to build the application docker image along with PostgreSQL image, PostgreSQL specific migrations and with networking / volumes etc. |
Dockerfile | File | Dockerization script file of the application |
LICENSE.md | File | GitHub repository license mark-up file |
README.md | File | GitHub repository readme mark-up file |
- Console logging using Serilog
- Application monitoring using Sentry & New Relic
- HTTPS redirection
- Health check endpoint
- CORS
- Dependency Injection
- EF Core with in-memory database setup or PostgreSQL or SQL Server database setup with Migrations and Seed Data
- Data access from persistence medium through EF Core using Generic Repository Pattern, Unit of Work pattern
- AutoMapping
- Pagination in API response
- Sample GET/POST/PUT/PATCH/DELETE APIs
- Filtration, Sorting support on GET APIs through OData
- HATEOAS complaint API response
- Consistent & Machine readable error response using ProblemDetails
- API Versioning
- Open API documentation support using Swagger
- Unit Testing setup using XUnit, Moq, Generic Repository Pattern
- Code Coverage Report Generation setup with report summary in GitHub PR as Bot Comment
- Git Ignore, Docker Ignore, Dockerfile and Docker Compose script for containerization
- GitHub actions
- Script to auto renaming components (files/directories, file contents) for setup of new solution from this template.
- Containairization / Dockerization with HTTPS certification and PostgreSQL image
- Containairization / Dockerization with HTTPS certification and SQL Server image
- C# Extension Methods
- Fundamentals of ASP.NET Core
- ASP.NET Core WebAPI Sample
- Best Practices for REST API Design
- Generic Repository Pattern
- .NET CLI
- Options Pattern in .NET Core - Microsoft Documentation
- Options Pattern in .NET Core
- Code Coderage in .NET using Coverlet
- Publish Code Coverage Summary to GitHub PR as Bot Comment