···11+# Architecture Overview
22+33+This project follows a three-layer architecture with clear separation of concerns and strong typing across boundaries.
44+55+## Layers
66+77+1. GraphQL (API Layer)
88+ - Location: `apps/server/src/modules/**`
99+ - Implements resolvers and GraphQL object types (classes)
1010+ - GraphQL classes expose `fromDomain()` static factories to convert domain entities to API types
1111+ - No database access; no business logic
1212+1313+2. Domain (Core Model Layer)
1414+ - Location: `apps/server/src/modules/**/*.entity.ts`
1515+ - Plain classes representing core business entities
1616+ - Encapsulate business rules where appropriate
1717+ - No framework-specific decorators except GraphQL field metadata on API classes
1818+1919+3. Persistence (Prisma Layer)
2020+ - Location: Prisma client via `PrismaService`
2121+ - No domain logic; pure data access
2222+2323+## Mapping Pattern
2424+2525+- Each entity has a dedicated Mapper service implementing `BaseMapper<PrismaModel, DomainEntity>`
2626+- Mappers are `@Injectable()` Nest providers
2727+- Services inject mappers and use them to convert from Prisma models to domain entities
2828+- GraphQL classes convert domain entities via `fromDomain()` when returning data
2929+3030+Example flow: Resolver -> Service -> Prisma -> Mapper.toDomain -> Domain -> GraphQLType.fromDomain
3131+3232+## Conventions
3333+3434+- Services accept and return domain entities (never Prisma models)
3535+- Mappers live alongside their entity modules, e.g. `organization.mapper.ts`, `vacancy.mapper.ts`
3636+- Modules must register mapper providers and export them if shared
3737+- Prefer constructor-based instantiation; avoid non-null assertions
3838+- Use bracket notation for `process.env["VAR"]` and `prisma["model"]`
3939+- Linting and formatting are enforced via Biome with `$schema` validation
4040+4141+## Current Mapper Implementations
4242+4343+- Auth: `user.mapper.ts` (already injectable)
4444+- Organization: `organization.mapper.ts` (injectable and used by `organization.service.ts`)
4545+- Organization Roles: `organization-role.mapper.ts` (injectable and used by `organization-role.service.ts`)
4646+- Vacancies: `vacancy.mapper.ts` (injectable and used by `vacancy.service.ts`)
4747+- Job Experience submodules (company/level/role/skill) include injectable mappers
4848+4949+## Docker & Tooling
5050+5151+- Node 22 for all images (client, server, compose client service)
5252+- Biome 2.2.6 with `$schema` and `files.includes` exclusions for `node_modules`, `dist`, `build`
5353+5454+## Testing
5555+5656+- E2E tests under `apps/server/test` exercise GraphQL endpoints against a test app
5757+- Tests expect services to return proper domain entities; GraphQL types handle API shaping