Monorepo pnpm avec NestJS backend en architecture hexagonale. - Structure hexagonale complète (ports, adapters, domain entities) - 9 entities TypeORM (Home, User, Device, Credentials, Session, Message, Memory, Timer) - Migration initiale SQL avec pgvector support - Docker Compose (PostgreSQL 16 + pgvector + Redis 7) - Config partagée (tsconfig, ESLint, Prettier) - Outbound ports définis (STT, TTS, LLM, Cache, Storage, VectorStore) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1.9 KiB
1.9 KiB
Ti-Pote — Project Instructions
Project Overview
Robot animatronique de bureau personnel — modulaire, imprimé en 3D, propulsé par l'IA. Monorepo avec pnpm workspaces.
Stack
- Backend: NestJS + TypeScript, architecture hexagonale (ports & adapters)
- ORM: TypeORM avec PostgreSQL + pgvector
- Cache: Redis (ioredis)
- Frontend: Next.js (à venir dans
apps/frontend) - Infra: Docker Compose (dev), VPS (prod)
Repository Structure
apps/backend/ # NestJS core backend
src/
core/ # Domain (no external deps)
ports/inbound/ # Inbound interfaces
ports/outbound/ # Outbound interfaces (STT, TTS, LLM, storage, cache...)
services/ # Business logic
domain/entities/ # TypeORM entities
tools/ # LLM function/tool definitions
adapters/
inbound/ # REST controllers, WebSocket gateways
outbound/ # Implementations of outbound ports
config/ # App, DB, Redis config
migrations/ # TypeORM migrations (raw SQL)
shared/ # Utils (crypto, token counter, logger)
apps/frontend/ # Next.js frontend (future)
docs/ # Architecture, features, data model, roadmap
Commands
pnpm dev # Start backend in watch mode
pnpm build # Build backend
pnpm lint # Lint all packages
docker compose up -d # Start PostgreSQL + Redis
Conventions
- Language: TypeScript strict mode
- Entities in
core/domain/entities/— file pattern:*.entity.ts - Ports in
core/ports/— file pattern:*.port.ts, exported as Symbols - Adapters implement ports — injected via NestJS DI
- Migrations are manually written SQL (not auto-generated)
- Use
snake_casefor DB columns (TypeORM@Column({ name: 'snake_case' })) - Use
camelCasefor TypeScript properties - All dates stored as
TIMESTAMPTZ - Credentials encrypted with AES-256-GCM before storage