Add web UX with dashboard, import wizard, backup management
- SPA frontend (static/index.html): 4-step wizard flow (Upload → Review → Import → Report) + Dashboard bar + Backup UI - FastAPI server (server.py) with 14 API endpoints - New endpoints: /api/status, /api/backups, /api/backup/restore - Updated README with web UX usage - Added web deps: fastapi, uvicorn, python-multipart
This commit is contained in:
@@ -38,6 +38,42 @@ pip install -r requirements.txt
|
||||
python main.py seed-data/import_seed.csv --db /path/to/assets.db [--dry-run]
|
||||
```
|
||||
|
||||
## Web UX
|
||||
|
||||
Standalone web interface for uploading, previewing, and importing Cantaloupe data:
|
||||
|
||||
```bash
|
||||
cd ~/projects/canteen-seed-import
|
||||
source .venv/bin/activate
|
||||
pip install -r requirements.txt # ensure web deps are installed
|
||||
|
||||
python -m web_ux.main --port 8089
|
||||
```
|
||||
|
||||
Then open **http://localhost:8089**
|
||||
|
||||
Features:
|
||||
- 📊 **Dashboard** — DB stats, class/make breakdown, GPS coverage
|
||||
- 📤 **Import** — Drag-and-drop Excel upload, preview parsed data, choose seed/update mode, run import with automatic backup
|
||||
- 💾 **Backup** — Create/manage/compare/restore GPS+photo backups
|
||||
- 📋 **Report** — View the latest validation report
|
||||
- ⚙️ **Config** — View header mappings and handbook reference
|
||||
|
||||
### API Endpoints
|
||||
|
||||
| Method | Path | Description |
|
||||
|--------|------|-------------|
|
||||
| GET | /api/status | DB stats and health |
|
||||
| GET | /api/config | Header mappings + handbook info |
|
||||
| POST | /api/upload | Upload Excel file, returns preview token |
|
||||
| GET | /api/preview/{token} | Get paginated preview data |
|
||||
| POST | /api/import | Run import (seed/update) |
|
||||
| GET | /api/report | Latest validation report |
|
||||
| POST | /api/backup | Create database backup |
|
||||
| GET | /api/backups | List existing backups |
|
||||
| POST | /api/backup/compare | Compare backup to current DB |
|
||||
| POST | /api/backup/restore | Restore preserved fields from backup |
|
||||
|
||||
## Integration
|
||||
|
||||
Once validated, this tool will be integrated into the [Canteen Admin Server](https://admin.canteen.ourpad.casa).
|
||||
|
||||
Reference in New Issue
Block a user