Files
ESP32-ThermoPro-Bridge/frontend/README.md
T
Keith Solomon c80de43f55 fix: run frontend without virtualenv
- Modify app.py to add vendor/ to sys.path so pip --target works.
- Add frontend/.gitignore to exclude vendor/, __pycache__, thermopro.db.
- Update README with pip --target instructions.
2026-07-20 20:28:10 -05:00

70 lines
1.9 KiB
Markdown

# ThermoPro CYD Frontend
A Progressive Web App (PWA) that consumes the CYD ThermoPro Bridge API, stores session history in SQLite, and displays probe temperatures with charts, target setpoints, and freeform notes.
## Architecture
```
LXC/container
├── Python backend (Flask)
│ ├── Polls CYD /api/latest periodically
│ ├── Stores readings + sessions + notes in SQLite
│ └── Serves the static PWA and API
└── PWA (HTML/CSS/JS)
├── Dashboard with probe cards
├── Temperature history charts
├── Target setpoint editor
└── Session notes
```
## Requirements
- Python 3.10+ (system install or any working Python interpreter)
- SQLite (stdlib)
Dependencies are installed locally into `frontend/vendor/` so no virtual environment is required.
## Installing dependencies
```bash
cd frontend
pip install --target vendor -r requirements.txt
```
On Windows with PowerShell:
```powershell
cd "C:\Users\ksolo\Projects\House Projects\ThermoPro CYD\frontend"
pip install --target vendor -r requirements.txt
```
## Running locally
```bash
cd frontend
CYD_BASE_URL=http://192.168.2.55 python app.py
```
On Windows with PowerShell:
```powershell
cd "C:\Users\ksolo\Projects\House Projects\ThermoPro CYD\frontend"
$env:CYD_BASE_URL = "http://192.168.2.55"
python app.py
```
Then open `http://localhost:5000`.
## Configuration
| Environment variable | Default | Description |
|----------------------|---------|-------------|
| `CYD_BASE_URL` | `http://192.168.2.55` | Base URL of the CYD bridge |
| `POLL_INTERVAL` | `5` | Seconds between backend polls |
| `DATABASE_PATH` | `thermopro.db` | SQLite database file |
| `DEFAULT_CHART_MINUTES` | `60` | Default chart time range |
## Deployment
Serve the app behind a reverse proxy (e.g. Caddy or Nginx) in an LXC. The backend continues polling the CYD as long as it can reach the device.