3.0 KiB
3.0 KiB
GEMINI.md
This file provides guidance to Gemini when working with code in this repository.
Project Overview
This is an ASP.NET Core application based on the ASP.NET Boilerplate (ABP) framework. It supports multi-tenancy and targets .NET 9.0. The application uses a PostgreSQL database and JWT Bearer authentication with OpenIddict. The project follows a layered architecture pattern with a clear separation of concerns.
Building and Running
Build
cd aspnet-core
dotnet build ASPBaseOIDC.sln
Run the application
cd aspnet-core/src/ASPBaseOIDC.Web.Host
dotnet run
The API will be available at https://localhost:44311/.
The Swagger UI is accessible at https://localhost:44311/swagger.
Run database migrations
cd aspnet-core/src/ASPBaseOIDC.Migrator
dotnet run
To run in quiet mode (for CI/CD):
dotnet run -- -q
Run tests
cd aspnet-core/test/ASPBaseOIDC.Tests
dotnet test
Development Conventions
Architecture
The solution follows ABP's multi-layer architecture:
- ASPBaseOIDC.Core: Domain layer containing entities, domain services, authorization logic, and business rules.
- ASPBaseOIDC.Application: Application service layer that implements use cases.
- ASPBaseOIDC.EntityFrameworkCore: Data access layer using EF Core. It contains the
ASPBaseOIDCDbContextand database migrations. - ASPBaseOIDC.Web.Core: Web infrastructure shared between hosting models, including authentication and base controllers.
- ASPBaseOIDC.Web.Host: ASP.NET Core Web API hosting project. This is the entry point of the application.
- ASPBaseOIDC.Migrator: A standalone console application for running database migrations.
ABP Framework Integration
- The project uses ABP's module system. Each layer has a module class (e.g.,
ASPBaseOIDCCoreModule). - Dependencies between modules are declared using the
[DependsOn]attribute. - Dependency injection is configured in the module initialization methods.
Authentication
- Authentication is handled using JWT Bearer tokens and OpenIddict.
- The main configuration is in
appsettings.jsonunder theAuthentication:JwtBearersection.
Database
- The project uses a PostgreSQL database.
- EF Core migrations are located in the
ASPBaseOIDC.EntityFrameworkCore/Migrationsdirectory. - To add a new migration, run the following command:
dotnet ef migrations add <MigrationName> --project src/ASPBaseOIDC.EntityFrameworkCore --startup-project src/ASPBaseOIDC.Web.Host
General Conventions
- Application Services are named as
{Entity}AppServiceand implementI{Entity}AppService. - Data Transfer Objects (DTOs) are located in
Dtofolders alongside the services. - Authorization permissions are defined in
PermissionNames.csand granted inASPBaseOIDCAuthorizationProvider. - Localization strings are stored in XML files in the
Core/Localization/SourceFilesdirectory. - Keep the
changelog.mdfile updated with any changes made to the codebase.