Spaces:
Running
Running
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).
- UI:
/Β· API docs:/api/builder/docsΒ· Health:/api/builder/health - Ecosystem: agent-generator Β· GitPilot Β· standard
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(Aivenmatrix_appDSN) for persistence;APP_ENV=production.