Local setup
Requirements
Section titled “Requirements”| Tool | Version | Used by |
|---|---|---|
| Python | 3.11 or later | backend/ |
| uv | current | backend/ dependencies and commands |
| Node.js | 22 or later | frontend/, docs/ |
| pnpm | current | frontend/, docs/ |
| Postgres | 14 or later | the portal database |
Run the portal
Section titled “Run the portal”-
Create the database user and databases. The tests use
factory_test.Terminal window sudo -u postgres psql -c "CREATE ROLE factory LOGIN PASSWORD 'factory' CREATEDB"sudo -u postgres psql -c "CREATE DATABASE factory OWNER factory"sudo -u postgres psql -c "CREATE DATABASE factory_test OWNER factory" -
Register the GitHub apps with GitHub apps. Use
http://localhost:5173asAPP_BASE_URL. -
Configure the backend. Create
backend/.envfrom the template in Configuration. -
Start the backend.
Terminal window cd backenduv syncuv run alembic upgrade headuv run uvicorn factory_portal.main:app --port 8000 --reload --timeout-graceful-shutdown 5Check it with
curl localhost:8000/api/health, which returns{"status":"ok"}. FastAPI’s interactive API docs are athttp://localhost:8000/docs. -
Start the web app in a second terminal. Vite serves the app on port 5173 and forwards
/apito the backend, so the browser sees one origin and the session cookie works without CORS.Terminal window cd frontendpnpm installpnpm dev -
Open http://localhost:5173 and sign in with GitHub. The first account on a new database becomes the owner; invite other accounts from Settings → Members before they sign in.
Run these docs
Section titled “Run these docs”cd docspnpm installpnpm dev # http://localhost:4321pnpm build writes a static site with a search index to docs/dist/.
Run the checks
Section titled “Run the checks”cd backenduv run pytestThe tests use the factory_test database, a fake GitHub API and a fake Daytona API
(respx), so they need no network access or real credentials.
cd frontendpnpm build # type check and production buildpnpm lint # oxlintcd docspnpm openapi # regenerate public/openapi.json from the backendpnpm build # fails on broken pages and configDatabase migrations
Section titled “Database migrations”Alembic owns the schema. After you change backend/src/factory_portal/models.py:
cd backenduv run alembic revision --autogenerate -m "describe the change"# Read the generated file in migrations/versions/ and fix it if needed.uv run alembic upgrade head