Spaces:
Sleeping
Sleeping
| title: Prosento RepEx | |
| emoji: "\U0001F9FE" | |
| sdk: docker | |
| app_port: 7860 | |
| # RepEx Web Starter | |
| React (Vite) frontend + FastAPI backend with local session storage. | |
| ## Project Layout | |
| ``` | |
| / | |
| server/ | |
| app/ | |
| api/ | |
| routes/ | |
| health.py | |
| sessions.py | |
| router.py | |
| core/ | |
| config.py | |
| services/ | |
| session_store.py | |
| main.py | |
| frontend/ | |
| public/ | |
| assets/ | |
| src/ | |
| components/ | |
| pages/ | |
| lib/ | |
| index.html | |
| vite.config.ts | |
| ``` | |
| ## Quick Start (Dev) | |
| ### Backend (API) | |
| ```powershell | |
| python -m venv .venv | |
| .venv\Scripts\activate | |
| pip install -r server/requirements.txt | |
| uvicorn server.app.main:app --reload --port 8000 | |
| ``` | |
| ### Frontend (Vite) | |
| ```powershell | |
| cd frontend | |
| npm install | |
| npm run dev | |
| ``` | |
| Open `http://localhost:5173`. | |
| ## Production | |
| ```powershell | |
| cd frontend | |
| npm run build | |
| ``` | |
| Start the API server; it will serve `frontend/dist` if present: | |
| ``` | |
| uvicorn server.app.main:app --host 0.0.0.0 --port 8000 | |
| ``` | |
| ## Configuration | |
| Environment variables for the API: | |
| - `APP_NAME` (default: `Starter API`) | |
| - `API_PREFIX` (default: `/api`) | |
| - `CORS_ORIGINS` (comma-separated, default: `http://localhost:5173`) | |
| - `STORAGE_DIR` (default: `data`) | |
| - `MAX_UPLOAD_MB` (default: `50`) | |
| - `FRONTEND_BASE_URL` (default: `http://localhost:5173`) | |
| - `PDF_TIMEOUT_MS` (default: `90000`) | |
| Frontend environment variables: | |
| - `VITE_API_BASE` (optional, default: `/api`) | |
| ## PDF Export (ReportLab) | |
| The server generates PDFs using ReportLab at: | |
| ``` | |
| GET /api/sessions/{session_id}/export.pdf | |
| ``` | |
| Install dependencies: | |
| ```powershell | |
| pip install -r server/requirements.txt | |
| ``` | |