Skip to content

Onion architecture boilerplate based on .Net Core and EF code first.start developing your api from today without spending any time on creating project skeleton.

Notifications You must be signed in to change notification settings

saifulaiub123/.Net-Core-Onion-Architecture-Clean-Code-Boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 

Repository files navigation

.Net core onion architecture boilerplate

# RentGo is mobile number authentication based .net core prject where onion architecture has been used.You can start your api integration from the first day witout spending time on creating skeleton of the project.

onion_architecture

How to use and check features

  • You will need Visual Studio 2022 for supporting .Net 6.
  • You will need a MSSQL database.
  • Sql server 2019 has been used for this project
  • After opening the project configure your database connection string
  • Opten Package manager console the type update-database
  • It will create your database according to connection string.
  • Go to "DatabaseManagement/Initialize" folder from application source folder
  • Run all script sequentially (it will input UserRole and UserStatus values in db)
  • Run the application
  • To create user first call "SendOtp" api. Default verification code is 1234 that will saved in db
  • Then call "api/User/Authentication/" where Mbobile Number and Code field is mandatory
  • If user eith the mobile number already exist it will just retrun success messge otherwise new user will be created with role "User"
  • To test Authorization call "Test" api.

    Technologies implemented:

  • .Net 6
  • Entityframework core 6(Code first)
  • .Net core Identity for authentication and authorization
  • Customise Identity model
  • Automapper
  • Fluent api for both model validation and DBModel configuration
  • Used Generic Repository Pattern for DB operation
  • Implemented Swagger
  • Dependency Injection
  • Followed Seperation Of Concern mechanism
  • Used Custom MIddleware
  • Global Error Handling
  • Serilog for application logging in DB
  • Docker

  • go to
    RentGo folder
  • open cmd
  • run command docker compose build
  • after building run command docker compose up
  • browse http://localhost:8002/swagger/index.html for api