Update CLAUDE.md to reflect current project state
- Add NSwag client generation details and usage convention - Add TypeScript, Pinia, Axios to frontend stack - Change project structure from 'planned' to actual - Document BaseModel and AppDbContext conventions - Mark JWT/FluentValidation as planned (not yet implemented) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
f26e490085
commit
01feed4703
32
CLAUDE.md
32
CLAUDE.md
@ -4,33 +4,49 @@ A Facebook Events replacement webapp for a private friend group.
|
|||||||
|
|
||||||
## Stack
|
## Stack
|
||||||
|
|
||||||
- **Backend:** .NET 8 Web API, Clean Architecture, EF Core 8, FluentValidation, JWT auth
|
- **Backend:** .NET 8 Web API, Clean Architecture, EF Core 8 + Pomelo.EntityFrameworkCore.MySql, NSwag, JWT auth (planned)
|
||||||
- **Database:** MySQL
|
- **Database:** MySQL
|
||||||
- **Frontend:** Vue 3 (Vite), Vuetify 3
|
- **Frontend:** Vue 3 (Vite), Vuetify 3, TypeScript, Pinia, Axios
|
||||||
|
- **API client:** Auto-generated TypeScript client via NSwag on every backend build
|
||||||
- **Version control:** Gitea at https://git.svrcina.eu/martin/claude-test.git
|
- **Version control:** Gitea at https://git.svrcina.eu/martin/claude-test.git
|
||||||
|
|
||||||
## Project Structure (planned)
|
## Project Structure
|
||||||
|
|
||||||
```
|
```
|
||||||
claude-test/
|
claude-test/
|
||||||
|
├── ClaudeTest.sln
|
||||||
├── backend/
|
├── backend/
|
||||||
│ ├── ClaudeTest.API/ # Controllers, middleware, DI config
|
│ ├── ClaudeTest.API/ # Controllers, middleware, DI config, nswag.json
|
||||||
│ ├── ClaudeTest.Application/ # Services, DTOs, validators
|
│ ├── ClaudeTest.Application/ # Services, DTOs, validators (FluentValidation)
|
||||||
│ ├── ClaudeTest.Domain/ # Entities, domain interfaces
|
│ ├── ClaudeTest.Domain/ # Entities, domain interfaces
|
||||||
│ └── ClaudeTest.Infrastructure/# EF Core, repositories, email
|
│ │ └── Common/BaseModel.cs # Base entity: Id, Created, Updated, Deleted
|
||||||
├── frontend/ # Vue 3 + Vuetify 3 app
|
│ └── ClaudeTest.Infrastructure/ # EF Core, AppDbContext, repositories
|
||||||
└── CLAUDE.md
|
│ └── Persistence/AppDbContext.cs
|
||||||
|
└── frontend/ # Vue 3 + Vuetify 3 app
|
||||||
|
└── src/api/apiClient.ts # Auto-generated by NSwag (gitignored)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Conventions
|
## Conventions
|
||||||
|
|
||||||
- REST API with consistent JSON responses and HTTP status codes
|
- REST API with consistent JSON responses and HTTP status codes
|
||||||
- EF Core code-first migrations (never edit migrations manually)
|
- EF Core code-first migrations (never edit migrations manually)
|
||||||
|
- All entities inherit from `BaseModel` (Id, Created, Updated, Deleted)
|
||||||
|
- `AppDbContext` sets `Created`/`Updated` automatically via `ChangeTracker`
|
||||||
|
- All timestamps stored as UTC (`DateTime.UtcNow`)
|
||||||
- DTOs for all API input/output (never expose domain entities directly)
|
- DTOs for all API input/output (never expose domain entities directly)
|
||||||
- FluentValidation for all request validation
|
- FluentValidation for all request validation
|
||||||
- Async/await throughout the backend
|
- Async/await throughout the backend
|
||||||
- Vue 3 Composition API (`<script setup>`) only — no Options API
|
- Vue 3 Composition API (`<script setup>`) only — no Options API
|
||||||
- Pinia for frontend state management
|
- Pinia for frontend state management
|
||||||
|
- Never call API directly from Vue components — always use the generated `apiClient.ts`
|
||||||
|
|
||||||
|
## NSwag API Client Generation
|
||||||
|
|
||||||
|
NSwag runs automatically as a post-build step on `ClaudeTest.API`.
|
||||||
|
- Config: `backend/ClaudeTest.API/nswag.json`
|
||||||
|
- Output: `frontend/src/api/apiClient.ts` (gitignored, regenerated on each build)
|
||||||
|
- Template: Axios — generates one typed client class per controller
|
||||||
|
- Uses `$(NSwagExe_Net80)` in the MSBuild target (required for .NET 8)
|
||||||
|
|
||||||
## Deployment
|
## Deployment
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user