This document provides context and guidelines for AI agents working with this ABP Framework template project.
This is a minimalist, non-layered ABP Framework startup solution template. It's designed as a single-layer architecture (no separate Domain/Application/Infrastructure layers) for rapid development and simplicity.
- Framework: .NET 10.0
- ABP Framework: 10.0.1
- Database: PostgreSQL
- ORM: Entity Framework Core
- Authentication: OpenIddict
- Logging: Serilog (with Seq integration)
- UI Theme: LeptonXLite
- Container: Docker (Linux)
abp/AbpTemplate/
├── Controllers/ # API Controllers
├── Data/ # DbContext and migration services
├── Entities/ # Domain entities
├── Extensions/ # Extension methods and configurations
├── Localization/ # Localization resources
├── Migrations/ # EF Core migrations
├── ObjectMapping/ # AutoMapper profiles
├── Permission/ # Permission definitions
├── Repository/ # Custom repositories
├── Services/ # Application services and DTOs
└── Utils/ # Utility classes and constants
Program.cs: Application entry point with Serilog configuration and automatic migrationsAbpTemplateModule.cs: Main ABP module configurationAbpTemplateDbContext.cs: EF Core DbContextUtils/Constant.cs: String constants (avoid hardcoding strings)appsettings.json: Application configurationDockerfile: Container configuration
- No Hardcoded Strings: Always use constants from
Utils/Constant.csor localization resources - File Size: Keep files under 500 lines - split large files into smaller ones
- Simple Implementation: Prioritize simple solutions over complex ones
- Package Management: Never add packages directly to
.csprojfiles - always usedotnet add packageCLI - Code Formatting: Use
dotnet csharpier .to format code after modifications - Linting: Always lint and format modified files after writing code
- Follow ABP Framework naming conventions
- Use dependency injection for all services
- Implement proper permission checks
- Use Mapperly for object mapping
- Follow ABP's multi-tenancy patterns
- Migrations run automatically on startup (configured in
Program.cs) - Use
AbpTemplateDbMigrationServicefor migration management - PostgreSQL is assumed to be running (not in Docker for development)
- Create entity class in
Entities/folder - Add DbSet to
AbpTemplateDbContext - Create migration:
dotnet ef migrations add MigrationName - Migration will run automatically on next startup
- Create controller in
Controllers/folder - Inherit from
AbpControllerBaseor appropriate ABP base class - Add proper authorization attributes
- Use dependency injection for services
- Create service class in
Services/folder - Implement appropriate interface
- Register in
AbpTemplateModule.csif needed - Use dependency injection
- Add to
Utils/Constant.csas public const string - Use the constant instead of hardcoded strings
cd abp/AbpTemplate
dotnet add package PackageName- Database Setup: PostgreSQL should already be running (not via Docker)
- Run Application:
cd abp/AbpTemplate dotnet run --migrate-database - Format Code:
dotnet csharpier . - Create Migrations:
dotnet ef migrations add MigrationName
- Migrations: Run automatically on startup - no manual migration needed
- Secrets: Use
appsettings.secrets.jsonfor sensitive configuration - Logging: Logs are written to
Logs/logs.txtand optionally to Seq - Multi-tenancy: Template supports multi-tenancy via ABP Framework
- Data Protection: Keys are stored in the database
- HTTPS: HTTP redirects to HTTPS are configured
- Swagger: Available at
/swaggerwith improved class names
Use conventional commits format:
fix:for bug fixesdocs:for documentation changesrefactor:for code refactoringchore:for maintenance tasks- Avoid overusing
feat:prefix
- Ensure code compiles without errors
- Verify migrations work correctly
- Test with multi-tenant scenarios if applicable
- Check Swagger documentation is accessible
- ABP Framework Documentation: https://docs.abp.io
- Demo: https://abp.antosubash.com
- React App Demo: https://abpreact.antosubash.com