The backend is a FastAPI application that owns the API, persistence, DXF workflow, and production serving of the frontend build.
- auth and profile APIs
- workspace projects and project messages
- community questions, answers, and voting
- design parsing and DXF generation
- export endpoints for preview images and PDFs
- startup tasks for local databases and cleanup jobs
backend/
├── app/
│ ├── api/ DXF and lower-level API routes
│ ├── core/ settings, auth helpers, env loading, logging
│ ├── models/ request and response models
│ ├── routers/ auth, profile, workspace, community, parsing
│ ├── services/ storage, exporters, parsers, integrations
│ ├── tests/ backend tests
│ └── utils/ shared helpers
├── data/ local SQLite databases and runtime data
├── output/ generated DXF and exported files
├── requirements.txt
└── .env.example
cd backend
cp .env.example .env
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtuvicorn app.main:app --reload --host 0.0.0.0 --port 8000Useful URLs:
http://127.0.0.1:8000/http://127.0.0.1:8000/docswhen docs are enabled
Use backend/.env.example as the source of truth. The most important values are:
HF_TOKENOLLAMA_API_KEYCADARENA_OLLAMA_URLCADARENA_JWT_SECRETPROVIDER_KEY_SECRETCADARENA_WORKSPACE_DB_PATH
/api/v1/auth/*/api/v1/profile/*/api/v1/workspace/*/api/v1/community/*/api/v1/parse-design*/api/v1/generate-dxf/api/v1/dxf/*
The app entry point is backend/app/main.py.
When frontend/build/ exists, the backend serves:
- the React app on
/ - React routes such as
/communityand/generate - legacy studio assets on
/studio-app/*
Run the backend test suite from backend/:
pytest app/testsFor focused checks:
pytest app/tests/test_community_storage.py- local databases are initialized on startup
- community and workspace data are stored in
backend/data/ - generated files are cleaned up periodically by the lifespan task