Update README for PDF export, DOCS_ENABLED flag, and WebSocket URL change

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-20 23:56:19 -07:00
parent a67b325b01
commit be86cae7fa

View File

@@ -19,7 +19,7 @@ A self-hosted web app for managing homeschool schedules, tracking daily learning
- **Done Button** — Marks the current block as fully elapsed (timer snaps to 00:00 / "Done!"), adds a checkmark in the schedule list, and logs "Marked Done by User" in the activity log. Pressing Reset after Done clears the completed state entirely — removing the checkmark and the Done label — treating the block as if it were never started.
- **Block Timer Remaining** — Each block in the schedule list shows time remaining (allocated duration minus elapsed), counting down live on both the parent dashboard and the TV sidebar. Shows "< 1 min" when under a minute, and "Done!" when the full duration is elapsed.
- **Tablet-Friendly Controls** — The session control buttons (Start/Pause/Resume, Reset, Done, End Day) stretch full-width across the session card and are taller for easy tapping on a tablet.
- **Activity Log** — Automatically records every timer event (day started, block start/pause/resume/complete/reset, break start/pause/resume/reset) as a timestamped timeline. Block selection events are intentionally not logged. The "Done" button logs as "Marked Done by User — Block Name". All event types display with a human-readable label and icon. Includes which schedule template was used. Supports manual notes with free text. Browse and filter history by child and date.
- **Activity Log** — Automatically records every timer event (day started, block start/pause/resume/complete/reset, break start/pause/resume/reset) as a timestamped timeline. Block selection events are intentionally not logged. The "Done" button logs as "Marked Done by User — Block Name". All event types display with a human-readable label and icon. Includes which schedule template was used. Supports manual notes with free text. Browse and filter history by child and date. Use the **Export PDF** button to open a dialog, select a child and date range, and generate a printable HTML report in a new tab.
- **Behavior Tracking (Strikes)** — Issue up to 3 strikes per child from the Dashboard. Strike additions and removals are logged in the activity log with a timestamp. Strike count is shown on the TV dashboard. Strikes **reset automatically at midnight** in the user's configured timezone — the reset happens lazily on the first page load after midnight, so no scheduled job is required.
- **Timezone Support** — Set your local timezone in Admin → Settings. All activity log timestamps display in your timezone, including the TV dashboard clock. Midnight strike resets use this timezone.
- **Password Change** — Users can change their own account password from Admin → Settings → Reset Password. The form requires the current password before accepting a new one.
@@ -165,6 +165,9 @@ CORS_ORIGINS=http://localhost:8054
# Super admin credentials (for /super-admin)
ADMIN_USERNAME=admin
ADMIN_PASSWORD=change_me_admin_password
# Set to true only for local development (exposes /api/docs, /api/redoc)
DOCS_ENABLED=false
```
### 3. Build and start
@@ -250,7 +253,7 @@ Each child is assigned a permanent random 4-digit token when created (e.g. `/tv/
### API Documentation
FastAPI auto-generates interactive API docs:
FastAPI auto-generates interactive API docs, but they are **disabled by default**. To enable them, set `DOCS_ENABLED=true` in your `.env` file and rebuild:
- **Swagger UI** — `http://localhost:8054/api/docs`
- **ReDoc** — `http://localhost:8054/api/redoc`
@@ -272,7 +275,7 @@ No separate migration tool or manual steps are required.
## WebSocket Events
The TV dashboard connects to `ws://host/ws/{child_id}` and receives JSON events:
The TV dashboard connects to `ws://host/ws/{tv_token}` (using the child's 4-digit TV token, not the internal database ID) and receives JSON events:
| Event | Triggered by | Key payload fields |
|-------|-------------|---------|
@@ -338,6 +341,7 @@ The TV dashboard connects to `ws://host/ws/{child_id}` and receives JSON events:
| `CORS_ORIGINS` | No | Comma-separated allowed origins (default: `http://localhost:8054`). **Add every domain you access the app from**, including any custom domain behind a reverse proxy (e.g. `http://localhost:8054,https://homeschool.example.com`). Missing an origin causes API requests to be silently blocked by the browser. |
| `ADMIN_USERNAME` | No | Super admin login username (default: `admin`) |
| `ADMIN_PASSWORD` | No | Super admin login password (default: `change_me_admin_password`) |
| `DOCS_ENABLED` | No | Set to `true` to enable `/api/docs` and `/api/redoc` (default: `false`). Recommended only for local development. |
> **Note:** `ADMIN_USERNAME` and `ADMIN_PASSWORD` must be set in `.env` **and** listed in the `backend` service's `environment` block in `docker-compose.yml`. Changing them in `.env` alone is not sufficient — the backend container reads them as environment variables, not from the file directly.