Aurea Docs
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:

  1. A GraphQL API (Apollo Server 4) for the dashboard and any other consumers.
  2. A Model Context Protocol (MCP) endpoint for AI-agent tool use.
  • Port: 4000
  • Package name: @aurea/api

Technology

ConcernLibrary
FrameworkNestJS 11
GraphQL serverApollo Server 4 + @nestjs/graphql (code-first)
MCP@modelcontextprotocol/sdk 1.x (Streamable HTTP)
ORMDrizzle ORM + postgres driver
Validationclass-validator, zod
RuntimeBun / 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

VariableDescription
DATABASE_URLPostgreSQL connection string
PORTHTTP port (default 4000)
FRONTEND_URLCORS 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

On this page