/ASPNetBoilerplate

A simple and skeletal boilerplate for ASP.NET Core Web API projects

Primary LanguageC#MIT LicenseMIT


Logo

ASPNETBoilerplate

A simple and skeletal boilerplate for ASP.NET Core Web API projects

Contributors Forks Stargazers Issues License

Table Of Contents

About The Project

This boilerplate was built to jump start development with minimal setup and save hours configuring and setting up common functionalities in a REST API project. The project followes the N Tier Architecture. The boilerplate includes the following features

  1. JWT Based Authentication
  2. Role based Authorization
  3. Custom global error handling
  4. Auto mapping of domain entities to DB tables through Dapper Mapper classes
  5. Generic repository for CRUD operations

The solution has four projects that are included in it.

  1. Web - This is the main ASP .NET Core project.
  2. Domain - This is a Class Library that has all your business domain entities.
  3. Repository - This is a Class Library and implements the Repository pattern.
  4. Migrator - This is a Console Application that runs your migrations.

Built With

This project is configured with the following

Getting Started

All you have to do to use this boilerplate is to fork this repository and then clone the forked repository! It's that simple!

Prerequisites

  • Ensure that you have .NET 7 SDK installed.
  • This project is makes use of SQLServer as the Database.

Usage

  1. Run the rename.ps1 file to rename all the files and update the namespaces with your project name.
.\rename.ps1 <YOUR_PROJECT_NAME>
  1. Update the connection strings in the Web and Migrator project to that of your database.
  2. Replace the admin username and password in the 20230306220822_InitialMigration.cs file. The password has to be SHA256 encoded.
  3. Follow the instructions in the README in the Migrator to run the migrations.

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  • If you have suggestions for adding or removing projects, feel free to open an issue to discuss it, or directly create a pull request.
  • Please make sure you check your spelling and grammar.
  • Create individual PR for each suggestion.

Creating A Pull Request

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Authors

  • Ranjith Shenoy - *An enthusiastic software developer * - Ranjith Shenoy - **

Acknowledgements