Files
cjyyzx/README.gateway.md
T
xiaohei 428644e286
Revalidate Docs / Revalidate Docs (push) Failing after 2s
E2E CI / Check Duplicate Run (push) Failing after 5s
Test CI / Check Duplicate Run (push) Failing after 6s
E2E CI / Test Web App (push) Has been skipped
Test CI / Test Packages (push) Has been skipped
Test CI / Test App (shard 1/3) (push) Has been skipped
Test CI / Test App (shard 2/3) (push) Has been skipped
Test CI / Test App (shard 3/3) (push) Has been skipped
Test CI / Test Desktop App (push) Has been skipped
🔄 Branch Synchronization / sync-branches (push) Failing after 11s
Test CI / Test Database (push) Has been skipped
Test CI / Merge and Upload App Coverage (push) Has been skipped
Database Schema Visualization CI / build (push) Failing after 4m14s
Enterprise AI Workspace prototype: LobeChat (de-branded) + Enterprise Gateway + Postgres/Redis stack
2026-04-21 12:58:00 +08:00

1.5 KiB

Enterprise Gateway (Prototype)

Local-docker prototype of an Enterprise AI Workspace gateway. Sits between a future chat UI and legacy enterprise systems (gongdan / xiaoshou / cloudcost / kb / ai_search / sandbox / doc), enforcing centralized permissions, identity mapping, data-scope filtering, field masking, and audit logging.

Quick Start

cp .env.example .env
docker compose build
docker compose up -d
# wait for api healthcheck
bash apps/api/scripts/acceptance.sh

Default MOCK_MODE=true so no external services are required.

Stack

  • Node 20 + TypeScript + Fastify + Prisma + Postgres 16
  • Next.js 14 (App Router) + React 18
  • docker-compose (db / api / web)

Migration strategy

The api container entrypoint runs prisma db push --accept-data-loss (simpler than migrate for a prototype), then seeds the database if empty, then starts the server. Choice documented: db push avoids fragile migration-file churn during early development.

Dev auth

Pass header X-Dev-User: <username> or cookie dev_user=<username>. Seed users:

  • sa (super_admin), pa (permission_admin), sales1 (internal_sales), ops1 (internal_ops), tech1 (internal_tech), cust1 (customer)

Casdoor JWKS stub is present in apps/api/src/auth/casdoor.ts; not enabled unless AUTH_MODE=casdoor.

Acceptance

See apps/api/scripts/acceptance.sh. Exit 0 on pass.

Teardown

docker compose down -v