dotb_ai-platform/stack.md

2.0 KiB

Technology Stack

This records adopted rebuild decisions, not proof that deployment or integration has passed. See docs/specs/ai-platform-lead-scoring.md for behavior and ARCHITECTURE.md for placement.

  • Backend: Python 3.13, uv, FastAPI/Pydantic at HTTP boundary, PostgreSQL 16+ with SQLAlchemy async + asyncpg, Alembic. Domain uses Python values and pure functions; no transport/ORM models inside it.
  • Runtime: one backend process, ephemeral asyncio tasks; PostgreSQL owns run durability, unique idempotency and transactional outbox. Startup terminalizes lost work before readiness. No broker/Redis or distributed leases in v1.
  • AIHub: V-Key supplied per request in RAM, Bearer forwarding, medium bounded two-pass when AI is required. Lead Scoring's versioned AI profile defaults to AIHub and may select a separate OpenAI-compatible adapter; its URL is stored with the version and its model comes from the profile. The optional server-side API key is sent only to the URL configured for that key; changing the URL in Admin Web does not forward that key. Only development permits loopback HTTP; production URLs require HTTPS. Actual provider protocol/model/timeout and quotas require sandbox verification; no server-wide tenant V-Key.
  • Admin Web: SvelteKit 5, TypeScript 5, Bun, adapter-node after runtime verification; generated types from FastAPI OpenAPI, server-only session/backend access. DotB-Omni owns business UI.
  • Tooling: pytest, Ruff, Pyright, Import Linter, Alembic lifecycle, Svelte check/Vitest and one browser flow; pre-commit opt-in, GitHub CI authoritative. uv/Bun lockfiles required. Dockerfiles separate for backend and web; Compose local only.
  • rewrite_architect.md is a draft: its proposed psycopg/pnpm, key re-display, dynamic subscription and speculative catalog are not adopted. Tenant key raw is returned once; rotate if lost.

Before production choose hosting, TLS/proxy, secret manager, DB backup/restore and retention, alerts/on-call and deployment verification. Never imply local Compose alone establishes production readiness.