# 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 ```bash cd aspnet-core dotnet build ASPBaseOIDC.sln ``` ### Run the application ```bash 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 ```bash cd aspnet-core/src/ASPBaseOIDC.Migrator dotnet run ``` To run in quiet mode (for CI/CD): ```bash dotnet run -- -q ``` ### Run tests ```bash 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 `ASPBaseOIDCDbContext` and 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.json` under the `Authentication:JwtBearer` section. ### Database * The project uses a PostgreSQL database. * EF Core migrations are located in the `ASPBaseOIDC.EntityFrameworkCore/Migrations` directory. * To add a new migration, run the following command: ```bash dotnet ef migrations add --project src/ASPBaseOIDC.EntityFrameworkCore --startup-project src/ASPBaseOIDC.Web.Host ``` ### General Conventions * Application Services are named as `{Entity}AppService` and implement `I{Entity}AppService`. * Data Transfer Objects (DTOs) are located in `Dto` folders alongside the services. * Authorization permissions are defined in `PermissionNames.cs` and granted in `ASPBaseOIDCAuthorizationProvider`. * Localization strings are stored in XML files in the `Core/Localization/SourceFiles` directory. * Keep the `changelog.md` file updated with any changes made to the codebase.