Apps
apps/api
The Aurea API — NestJS 11 with Apollo GraphQL and an MCP server endpoint for AI-agent integration.
Overview
apps/api is the data and integration layer for the Aurea platform. It exposes:
- A GraphQL API (Apollo Server 4) for the dashboard and any other consumers.
- A Model Context Protocol (MCP) endpoint for AI-agent tool use.
- Port: 4000
- Package name:
@aurea/api
Technology
| Concern | Library |
|---|---|
| Framework | NestJS 11 |
| GraphQL server | Apollo Server 4 + @nestjs/graphql (code-first) |
| MCP | @modelcontextprotocol/sdk 1.x (Streamable HTTP) |
| ORM | Drizzle ORM + postgres driver |
| Validation | class-validator, zod |
| Runtime | Bun / Node ≥ 22 |
Module structure
src/
├── app.module.ts
├── main.ts
└── modules/
├── cases/ # Case entity, service, resolver
└── mcp/ # McpController, McpService (tool definitions)Cases module
The CasesService manages immigration / relocation cases. In development it uses an in-memory
seed; in production it will be backed by Drizzle + PostgreSQL.
See GraphQL API for the full schema.
MCP module
McpController handles POST /mcp using the Streamable HTTP transport. McpService creates
an McpServer and registers the four Aurea tools.
See MCP Server for tool details.
Key environment variables
| Variable | Description |
|---|---|
DATABASE_URL | PostgreSQL connection string |
PORT | HTTP port (default 4000) |
FRONTEND_URL | CORS allowed origin |
Scripts
bun run dev # nest start --watch --builder swc
bun run build # nest build
bun run start:prod # node dist/main
bun run test # vitest