File size: 1,638 Bytes
0418ff4
 
 
 
 
 
 
4297738
73b6f92
1643ce8
f48f5c4
 
 
 
4297738
 
 
 
 
 
1643ce8
4297738
 
 
1643ce8
 
4297738
1643ce8
 
 
 
 
 
 
 
 
f48f5c4
73b6f92
1643ce8
73b6f92
1643ce8
73b6f92
 
bdfdb65
 
 
73b6f92
 
1643ce8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f48f5c4
 
 
 
 
 
 
51c39cf
 
39f81e0
 
1643ce8
 
 
39f81e0
8c60160
39f81e0
8c60160
 
 
 
 
 
 
39f81e0
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
---
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
```