This file provides guidance for AI agents working with this repository.
This is a TypeScript/Node.js project using Fastify as the web framework with Biome for linting and formatting. The project implements a DynamoDB-based data layer using the dynamodb-toolbox library.
- Package Manager: pnpm (version 10.18.2)
- Runtime: Node.js with TypeScript support via tsx
- Web Framework: Fastify
- Schema Validation: Typebox
- Testing: Jest
- Linting/Formatting: Biome
- Data Layer: DynamoDB with dynamodb-toolbox v2.7.1
pnpm install- Install dependenciespnpm run build- Compile TypeScript to JavaScriptpnpm run dev- Run development server with hot reloadpnpm run test- Run testspnpm run test:watch- Run tests in watch modepnpm run test:coverage- Run tests with coverage reportpnpm run format- Format code with Biomepnpm run lint- Lint code with Biomepnpm run types- Check TypeScript typespnpm run docker- Start Docker services
- Formatting: Uses tabs for indentation, double quotes for strings (see
docs/standards/style.md) - Linting: Biome with recommended rules enabled
- Import Organization: Automatically organize imports on save
- Type Safety: Strict TypeScript with no implicit any
- Entity Pattern: Domain entities with static factory methods for data transformation
- DynamoDB Toolbox: See
docs/standards/ddb.mdfor schema design, repository patterns, and best practices - Testing: Test-Driven Development approach - see
docs/standards/tdd.md - Development Practices: See
docs/standards/practices.mdfor workflows and conventions - Technical Standards: See
docs/standards/tech.mdfor architecture and technology choices
- Layered Architecture: Router → Service → Repository → Entity → Database
- Domain-Driven Design: Entities manage all data transformations (fromRequest, toRecord, toResponse, validate)
- Repository Pattern: DynamoDB access abstracted through repositories using dynamodb-toolbox
- Single-Table Design: All entities share one DynamoDB table with PK/SK patterns
- Entity Transformations:
fromRequest()- API request to EntitytoRecord()- Entity to DynamoDB record (InputItem)fromRecord()- DynamoDB record to Entity (FormattedItem)toResponse()- Entity to API response
- Project uses pnpm workspace configuration with specific build dependency handling
- Biome VCS integration is disabled, likely for custom git workflow
- TypeScript configuration includes strict mode and modern ES2020 target