Local Development Setup
Canonical Local Paths
- backend app root:
C:\QiLabs\60_QiApps\_qilife\backend - frontend app root:
C:\QiLabs\60_QiApps\_qilife\frontend - SQLite database path:
C:\QiLabs\60_QiApps\_qilife\data\db\qilife.sqlite
Backend
- Create and activate a virtual environment.
- Install backend dependencies from
requirements.txt. - Start FastAPI with
uvicorn app.main:app --reload --host 127.0.0.1 --port 8000.
Python's standard library already includes SQLite support; do not add sqlite3 as a pip dependency.
Frontend
- Install dependencies in
frontend/. - Optional: set
VITE_API_BASE_URL=http://127.0.0.1:8000. - Start Vite on
127.0.0.1:5173.
If VITE_API_BASE_URL is not set, the app stays operational in localStorage fallback mode.
Deployment Doctrine
We use a single API base URL strategy across environments.
- Frontend app: hosted on Cloudflare Pages.
- Backend app: hosted on
qiserverrunning the real FastAPI application with local SQLite. - Optional gateway: a future Cloudflare Worker may proxy traffic, but it is not the primary backend today.
Frontend API Configuration
- Uses
VITE_API_BASE_URLfor all backend API calls. - Local dev example:
http://127.0.0.1:8000 - Future
qiserverAPI target:https://qilife-api.qially.com - Do not hardcode localhost in frontend components.
- On startup, the frontend checks
/api/health. If offline, it showsLocal fallback modeand uses localStorage for the working loop.
Development Rules
- Treat repo
docs/as canonical system knowledge. - Keep imported repo docs read-only in the app.
- Do not create a separate wiki service for v1.