If you are looking for a template for your upcoming web based .NET core project then probably you come to the right place.
AdminPLUS starter template consists of two separate project, one is AdminAPi project for API or you may call it service and the other is AdminClient project for UI or you may call it client for your API. So here AdminApi is an independent project and you can definitely use this as a service for any other client.
Now have a look some of the features:
This project covered all the latest technology including .NET core 3.1, EF Core 3.1.6, Bootstrap 4 UI framework, Jquery 3.5.1 and also uses Dependency Injection concept, Policy based Authorization, Logger, JWT and many more.
The API project has a well descriptive Swagger API documentation. You will see this on localhost:5001 soon after you run the AdminApi project.
The Client project uses NLog (a 3rd party loggger service) to generate a log text file every day for errors and exceptions that occurs when using. You will find those file on your Windows OS C Drive and the file location is C:DemoLogs.
Policy based Authorization
The policy based authorization is used in this whole application. In the beginning you will get three policy as “AdminPolicy”, “UserPolicy” and “AdminOrUserPolicy”.
The power of dependency injection and loosely couple technique is perfectly used here to achieve the flexibility of use more than one database and couple more things.
The most popular five relational database (SQL Server, MySql, Sqlite, PostgreSql and Oracle12c+) provider is used here. You just need to un-comment the underlying database provider line of codes on Startup class ConfigureServices method in AdminApi project and Dependency Injection will do the rest.
AdminClient project uses the full responsive latest Bootstrap 4 UI framework for starter template. It is light and custom UI template which is developed only for this Project.
EF Core Code first & Seed Data
In this application I used EF Core code first approach and here all the database queries is written in LINQ. After first migration all the project specific data will insert to your underlying database.
JSON Web Token (JWT) Verification
The API project here used JWT authentication to verify the user and issue a token for a certain amount of time (currently it is set to 180 minutes).
HTTP Status Code Error Page
Here the AdminClient project will handle every client error (http status code 4xx like 404) and server error (http status code 5xx like 503). If these type of error occurs then it will re-direct to a separate page with proper message and also log the error to Windows C:DemoLogs location.
Including all of the above features you will also get Jquery DataTable implementation, Client side Image upload technique by Ajax, SweetAlert implementation, Custom form validation by Jquery, Custom Session managing technique, CORS managing technique, database connectivity through Interface and lot more. This project uses a full custom Bootstrap 4 UI template, you can use it for your other projects too. The AdminPLUS template offers you full source code of both Api and Client project along with a rich documentation file.
Quick Start Guide
AdminPLUS starter template has two separate project i.e. AdminClient and AdminApi.
- Open AdminApi project on Visual studio code or Visual Studio 2017/2019.
Then open appsettings.json file and replace the Connection String by your one.
- Open terminal on VS Code or Visual Studio 2017/2019 and write below commands
- dotnet ef migrations add InitialMigration
- dotnet ef database update
- dotnet run
You should see your API listening at localhost:5001.
- Now open AdminClient on Visual Studio 2017/2019 or Visual Studio Code. Run the project either command line or debugging mode (pressing F5 or Ctrl+F5).
In command line mood the Client project will run at localhost:5000 and in debugging mood it will run at localhost:53580.
Please see the video tutorial or documentation for detail illustration.