matrix-builder / README.md
ruslanmv
Deploy: metrics + docs (Batch 12)
22b729d
|
Raw
History Blame Contribute Delete
2.07 kB
metadata
title: Matrix Builder
emoji: 🟒
colorFrom: green
colorTo: gray
sdk: docker
app_port: 7860
pinned: false
license: mit
short_description: Give AI coders a contract, not a prompt.
tags:
  - ai-coding
  - governance
  - nextjs
  - fastapi

Matrix Builder β€” full stack on one Space

The complete app on a single Hugging Face Space: the Next.js UI is the public server (port 7860) and proxies /api/builder/* to the FastAPI backend running internally on 127.0.0.1:8000 β€” same-origin, no CORS. This mirrors the Vercel topology exactly, from the same apps/web source (no second frontend codebase).

How it's deployed (single source)

apps/web is the only frontend source. It runs in two places, both built from it:

Where Builds from Backend
Vercel (builder.matrixhub.io) apps/web (root dir) rewrites /api/builder/* β†’ this Space's public /api/builder
HF Space (this) apps/web staged as web/ by CI, built in-image local FastAPI on 127.0.0.1:8000

CI keeps the Space in sync: .github/workflows/hf-space.yml stages apps/web β†’ web/ plus services/api, then pushes to the Space, which builds this Dockerfile. Developers only ever edit apps/web.

Deploy tree (assembled by CI at the Space root)

Dockerfile  start.sh  README.md  requirements.txt
web/          ← apps/web (the single frontend source)
services/api/ ← FastAPI backend
scripts/

Secrets / variables (Settings β†’ Variables and secrets)

  • MB_JWT_SECRET β€” β‰₯32-byte random (required for real auth; demo runs in-memory without a DB).
  • Optional: DATABASE_URL (Aiven matrix_app DSN) for persistence; APP_ENV=production.

Source: https://github.com/agent-matrix/matrix-builder