Skip to content

Experience · Repository · Active

cs-chat

Enterprise chat experience with a dedicated NestJS BFF, React workspace, local shared contracts, conversation forks, MCP tools and dedicated PostgreSQL persistence.

  • NestJS 11
  • Prisma 7
  • PostgreSQL
  • React 19
  • Vite
  • Redux Toolkit
  • Tailwind 4

Spec sheet

Area

Experience / CS Chat

Public host

http://chat.cs.lvh.me:8080

Runtime shape

apps/api + apps/web + packages/shared

Backend port

3004

Frontend port

5178

Data store

Dedicated PostgreSQL

Responsibilities

  • Own chat threads, messages, conversation forks and product-specific chat UX.
  • Expose a same-origin BFF that wraps platform auth, platform AI and platform MCP.
  • Let users choose the AI provider per thread through the BFF, without direct Core calls from the browser.
  • Persist product state in cs-chat-postgres through Prisma.
  • Keep frontend traffic same-origin and never direct-to-Core.

Interfaces and contract surface

  • GET /api/health
  • GET /api/ai/providers
  • GET /api/chats
  • POST /api/chats/:threadId/messages
  • POST /api/chats/:threadId/forks
  • GET /api/mcp/tools

Internal modules

Backend

cs-chat api

NestJS BFF for CS Chat, owning chat persistence and same-origin product APIs while delegating auth, direct AI generation, agentic MCP replies and manual MCP tool calls to Core services.

Frontend

cs-chat web

React and Vite frontend for CS Chat, rendering multi-chat navigation, conversation composer, fork actions and MCP tool panels through same-origin APIs.

Package

cs-chat shared

Local shared package for CS Chat contracts, exposing Zod schemas and TypeScript types consumed by the BFF and frontend.

Consumers

  • Internal users via chat host

Dependencies and external touchpoints

Notes

  • The BFF stores product state locally and delegates shared capabilities to Core services.
  • The local stack exposes the experience through chat.cs.lvh.me:8080.

Source references

  • cs-chat/README.md
  • cs-chat/AGENTS.md
  • cs-chat/package.json
  • cs-chat/apps/api/package.json
  • cs-chat/apps/web/package.json
  • cs-chat/packages/shared/package.json

Policy MCP

cs-chat non abilita automaticamente tutti i tool MCP a ogni utente. Il BFF calcola la allowlist leggendo le capabilities runtime arrivate da platform-auth-service.

  • Default: nessun tool disponibile.
  • Ogni tool richiede una capability platform:mcp:tool:<toolName>:call.
  • Il pannello manuale /api/mcp/tools filtra il catalogo MCP in base alle capability effettive dell'utente.
  • Le risposte assistant passano a platform-agent-service una toolPolicy costruita dalla stessa allowlist.

Le capability sono configurabili da platform-status-service nella pagina /auth/capabilities; il catalogo MCP viene sincronizzato da platform-mcp-service verso platform-auth-service.

Workspace reference: /Users/jeanpaul/projects/cs-repository