# AGENTS.md - Build God Project ## Project Overview - **Backend**: ASP.NET Core 8.0 + PostgreSQL + SqlSugar ORM - **Admin Frontend**: Vue 3 + TypeScript + Vite + Element Plus (port 5173) - **Game Frontend**: Vue 3 + TypeScript + Vite + Element Plus + TailwindCSS + Three.js (port 5174) --- ## 1. Build, Lint, and Test Commands ### Backend ```bash dotnet build Build_God_Api/Build_God_Api/Build_God_Api.csproj dotnet run --project Build_God_Api/Build_God_Api/Build_God_Api.csproj dotnet run --urls "http://localhost:5091" ``` No test framework or linting configured. ### Admin Frontend ```bash npm install npm run dev # http://localhost:5173 npm run build # Production build npm run type-check # Type-check only npm run preview # Preview production build ``` ### Game Frontend ```bash npm install npm run dev # http://localhost:5174 npm run build # Production build vue-tsc --build # Type-check only ``` No test framework or ESLint configured for frontends. --- ## 2. Code Style Guidelines ### Backend (.NET/C#) **Conventions:** - File-scoped namespaces (`namespace Build_God_Api.Controllers;`) - Nullable reference types enabled (`enable`) - Primary constructors for dependency injection - Use `async/await` for all I/O operations - Avoid `region` - prefer natural code organization **Naming:** - Classes/Types: PascalCase (`AccountController`) - Methods/Properties: PascalCase (`GetAccount`) - Local variables/Parameters: camelCase (`accountId`) - Interfaces: Prefix with `I` (`IAccountService`) - DTOs: Postfix with `Cmd` for commands, `Dto` for responses **Project Structure:** ``` Build_God_Api/Build_God_Api/ Controllers/ # API endpoints Services/ # Business logic interfaces & implementations Services/Game/ # Game-specific services DB/ # Database entities (extend BaseEntity) Dto/ # Data transfer objects Common/ # Utilities Hubs/ # SignalR hubs ``` **Error Handling:** - `BadRequest("message")` for validation errors - `Ok(result)` for success - Try-catch with `Console.WriteLine` for error logging - Use DataAnnotations for input validation at controller level **Route Conventions:** - `[Route("api/god/[controller]")]` - `[ApiController]` with `[HttpGet]`/`[HttpPost]` attributes **Database (SqlSugar):** - Entities extend `BaseEntity` (provides `Id`, `CreatedOn`, `UpdatedOn`, `CreatedBy`, `UpdatedBy`) - Auto-increment PK: `[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]` --- ### Frontend (Vue 3 + TypeScript) **Conventions:** - Composition API with `