This commit is contained in:
2026-11-03 08:44:11 +01:00
parent cbf5f20c75
commit 0a9da4f9c5
13 changed files with 422 additions and 5 deletions
+18 -4
View File
@@ -3,9 +3,9 @@
Two Flask services with separate responsibilities and separate databases:
- **main app** (`app.py`) — all user-facing views: login, home, notes,
notifications, clipboard, API docs and the `/sensors` dashboard. It owns the
**main app** database (`main_app.db`: users, notes, notifications and clipboard
file metadata) and proxies data requests to the sensors API.
notifications, clipboard, calendar, API docs and the `/sensors` dashboard. It
owns the **main app** database (`main_app.db`: users, notes, notifications and
clipboard file metadata) and proxies data requests to the sensors API.
- **sensors app** (`sensors_app.py`) — API only. It owns the **sensors**
database (`sensors.db`, tables `sensor` and `sensor_readout`) and has no
knowledge of users. Its API is open to every user on the local machine.
@@ -56,6 +56,7 @@ server/
├── notes.html
├── notifications.html
├── clipboard.html
├── calendar.html
├── docs.html
└── sensors.html
```
@@ -187,6 +188,19 @@ automatically):
alembic -c alembic_users.ini upgrade head
```
## Calendar
The main app provides a `/calendar` page with two views for browsing sensor
readouts:
- **month** (`/calendar?view=month&year=YYYY&month=MM`) — calendar grid of the
given month, each day lists readouts (sensor, time, type, value)
- **week** (`/calendar?view=week&date=YYYY-MM-DD`) — list of the seven days of
the week containing the given date
Readouts are fetched from the sensors API through the
`GET /api/sensors/:id/readouts/range?from=...&to=...` endpoint.
## Notes
Logged-in users manage their own private short notes at `/notes`. Each note has
@@ -349,7 +363,7 @@ deployment path or user is different.
| Service | Port | Routes |
|---|---|---|
| main | 8000 | `/`, `/login`, `/home`, `/clipboard`, `/notes`, `/notifications`, `/sensors`, `/api/docs`, `/api/*` (proxy) |
| main | 8000 | `/`, `/login`, `/home`, `/clipboard`, `/calendar`, `/notes`, `/notifications`, `/sensors`, `/api/docs`, `/api/*` (proxy) |
| sensors | 8001 | `/api/*` (sensors and readouts) |
### Tests