GitHub - DarkElfes/ApiProject · GitHub
Skip to content

DarkElfes/ApiProject

Repository files navigation

ApiProject

Contributors

Overview

ApiProject - is example of RESTful API with using JWT and OIDC authentication.
For theme of porject will be chosed shop of "Phone cases" (but emphasis was more on auth and not all backend functionality was used on frontend).

Installation

  1. Clone the repository
git clone https://github.com/DarkElfes/ApiProject
  1. Install the dependencies:
winget install Microsoft.DotNet.SDK.9

Pre-Launch For Google OpenIdConnect (Not necessary, main functionality will work)

For using Google Auth you need to create OAuth 2.0 Client ID in Google Cloud Console.
Then you need to add your ClientId and ClientSecret to the appsettings.json file.

"OIDC": {
    "Google": {
      "ClientId": "YOUR_CLIENT",
      "ClientSecret": "YOUR_SECRET",
      "RedirectUri": "https://localhost:7097/auth/google/oidc-callback"
    }
  }

Launch

For using powershell scripts you need to allow scripts execution:

Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser

Then you can start the projects with the following command:

  1. For run Frontent and Backend projects:
.\backend-frontend.ps1
  1. For run only backend project:
.\backend-only.ps1

In web project console you find the link to the frontend or click here: https://localhost:7097
But for backend you need add /scalar/v1 path to link or click here: https://localhost:7236/scalar/v1 for using scalar docs.

Features

  • Clean architecture with using CQRS pattern (MediatR library)

(But i find the best for me - Vertical Slice Architecture)

  • JWT and OpenIDConnect (Only Google) authentication
  • Scalar documentation with OpenApi
  • Using Entity Framework Core with SQLite
  • Fontend with Blazor WebAssembly (MudBlazor UI)

Postman Documentation

Link to Postman Documentation

Instrucation

Video Instrucation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors