Automated Change Detection for Student Information Systems
A system that scrapes a Student Information System (SIS) parent portal on a schedule, detects changes to assignment and grade data, including retroactive modifications, and surfaces those changes through a calendar-based diff UI. UI inspired by https://archive.org.
Built to solve a real-world problem: Student Information Systems are inherently ephemeral. Updates made retroactively by a teacher are not surfaced as a time series, leaving parents and students to detect changes through manually timestamped screenshots or spreadsheets. Git history provides the audit trail natively, as every snapshot is an immutable, timestamped commit.
Full documentation and API reference
The system is decomposed into four isolated runtime boundaries deployed across n8n, a container runtime, GitHub, and Vercel. Each has a single responsibility and no access to credentials it does not need.
┌──────────────────────────────────────────────┐
│ ORCHESTRATION │
│ n8n │
│ │
│ Scheduling · Dispatch · Conditional logic │
│ Credential management · Delivery routing │
│ │
│ (see Control Plane Workflow.png) │
└──┬──────────────┬───────────────────┬────────┘
│ │ │
POST /scrape │ GitHub API │ Email, │
HMAC │ (commit) │ Slack, etc. │
▼ ▼ ▼
┌────────────────────────┐ ┌────────────────────────┐ ┌────────────────────┐
│ COLLECTION + INDEX │ │ STORAGE │ │ MESSAGING │
│ Container Runtime │ │ GitHub │ │ n8n-native │
│ │ │ │ │ │
│ Headless browser │ │ Private repo │ │ Email │
│ scraping SIS portal │ │ (data snapshots only) │ │ Future channels │
│ │ │ │ │ │
│ -POST /scrape: │ │ -Code and data │ │ -n8n routes to │
│ stateless worker, │ │ repos separated │ │ channels based │
│ returns JSON │ │ -Git history = │ │ on change type │
│ -POST /append-index: │ │ full audit log │ │ │
│ diffs newest pair, │ │ │ │ │
│ updates rolling index│ │ │ │ │
│ -POST /rebuild-index: │ │ │ │ │
│ full re-diff fallback│ │ │ │ │
└────────────────────────┘ └────────┬───────────────┘ └────────────────────┘
│
GitHub API │ (read-only)
▼
┌──────────────────────┐
│ PRESENTATION │
│ Vercel │
│ │
│ -Calendar UI │
│ -Client-side diffs │
│ -SSR from storage │
│ -Voice agent widget │
└──────┬───────────────┘
│
LiveKit │ (voice/video)
▼
┌──────────────────────┐
│ VOICE AGENT │
│ LiveKit Cloud │
│ │
│ sally-schoolwork │
│ (separate repo) │
│ -Voice/text Q&A │
│ -Avatar (lip-sync) │
│ -Browser navigation │
│ via RPC │
└──────────────────────┘
n8n owns the data flow. The scraper is a stateless worker that returns JSON -- it knows nothing about where data goes or who gets notified. n8n decides what happens with the results: commit to GitHub, notify on changes, retry on failure, route alerts and status notifications via email, with additional messaging channels available as workflow branches.
This is a deliberate separation. The scraper's job is to collect. n8n's job is to orchestrate. Neither holds responsibility for the other's concerns.
Workflow: Schedule Trigger → POST /scrape to scraper → success/failure branch → split class snapshots → commit each to GitHub → update snapshot metadata → POST /append-index (diff against the previous snapshot, append to the index) → on HTTP 409, POST /rebuild-index as a fallback → notify on error (scrape failure or index update failure; the scrape failure email includes an error ID that locates the stack trace in the scraper logs)
A Python + Playwright service behind FastAPI with two endpoints:
- POST /scrape: Stateless scraper. Logs into the SIS portal, extracts assignment tables, returns normalized JSON. Knows nothing about storage or delivery.
- POST /append-index: Diffs one new snapshot against the last entry in the rolling index and appends the result. Called by n8n after each scrape. Re-appending the same snapshot replaces its entry rather than duplicating it. If the snapshot is older than the newest index entry, it returns HTTP 409 so n8n can fall back to a full rebuild.
- POST /rebuild-index: Reads every snapshot in the data repo, diffs consecutive pairs, and rewrites the whole rolling index. Used as the 409 fallback and for backfills. Its cost grows with the number of snapshots, so for large histories run
scripts/rebuild_index.pylocally instead, which avoids the container runtime's request timeout. - GET /health: Returns 500 and lists any missing required environment variables.
All POST endpoints require an X-Webhook-Secret header.
The scraper implements a TableSource abstraction so additional SIS platforms can be added without changing the orchestration layer.
SISSource(TableSource) <- current implementation
FutureSource(TableSource) <- swap in without touching n8n
Authentication is HMAC-based: n8n signs each request with a shared webhook secret, which the scraper verifies before processing.
Code and data live in separate repositories:
- table-mutation-tracker (this repo): Application code, public-ready
- table-mutation-data (private): Snapshot JSON and rolling index only
The data repo receives commits exclusively through n8n via the GitHub Contents API. Git history serves as a complete audit trail of every change detected.
snapshots/
2026-03-10/
140532/
english_10/assignments.json
algebra_2/assignments.json
metadata.json
index/
rolling_index.json
A Next.js app on Vercel reads snapshots from the data repo via GitHub API. Change detection happens at two levels:
- Rolling index (pre-computed): After each scrape, n8n calls the scraper's
/append-indexendpoint, which diffs the new snapshot against the previous one and appends its change counts and a weighted GPA to the rolling index. The calendar view reads these counts to color-code days without fetching individual snapshots. - Detail view (client-side): When a user clicks a day, the frontend fetches both snapshots and diffs them field-by-field, classifying changes as added, deleted, or modified.
Both layers compare the same fields: category, score, percent, grade, comment presence, and each status flag (late, missing, exempt, and so on) individually. The Python and TypeScript diff implementations are kept in agreement by a test that fails if their field lists diverge.
This keeps the frontend fully decoupled from both the scraper and n8n. It reads from storage and nothing else.
n8n handles all outbound communication. Error notifications are active today: email on scrape failure, and a global workspace error handler following n8n design patterns. The architecture supports adding channels (Slack, SMS, weekly digests) as n8n workflow branches without touching any application code.
table-mutation-tracker/
├── src/
│ ├── main.py # Scrape orchestration (called by webhook)
│ ├── webhook.py # FastAPI endpoints: /scrape, /append-index, /rebuild-index, /health
│ ├── config.py # Config loader (sources.json + env vars)
│ ├── lib/
│ │ ├── snapshot_store.py # SnapshotStore ABC + diff logic
│ │ └── github_store.py # GitHub Contents API implementation
│ └── scraper/
│ ├── base.py # TableSource ABC, Assignment/ClassSnapshot models
│ ├── sis.py # SIS portal implementation
│ └── normalize.py # Date, score, grade normalization
├── frontend/
│ ├── app/ # Next.js App Router (calendar + day views)
│ │ ├── api/livekit-token/ # Server-side JWT generation for agent dispatch
│ │ ├── deleted/ # Deleted assignments history page
│ │ └── help/ # Agent capabilities page (navigated to via RPC)
│ ├── components/
│ │ ├── AgentWidget.tsx # Floating voice/video widget with connect/disconnect
│ │ ├── GradeBanner.tsx # Per-class grade cards + GPA display
│ │ ├── CalendarView, DiffTable, ClassTabs, ChangeLegend, etc.
│ ├── lib/
│ │ ├── diff.ts # Client-side assignment diffing engine
│ │ ├── snapshots.ts # GitHub API data fetching
│ │ └── types.ts # Shared TypeScript types
│ └── hooks/ # Local snapshot state management
├── config/
│ └── sources.json # SIS URLs, class definitions, GPA weights per class
├── scripts/
│ ├── generate_synthetic.py # Test data generator (--days N --clean, pushes to data repo)
│ └── rebuild_index.py # CLI to rebuild rolling index from existing snapshots
├── tests/ # pytest: rolling index updates, diff logic, Python/TS parity
├── n8n/ # Exported orchestrator workflow (credentials referenced, not inlined)
├── Dockerfile # Playwright + Chromium containerized scraper
├── docker-compose.yml # Caddy + n8n deployment (GCE)
└── Caddyfile # Reverse proxy + auto-TLS for n8n
| Variable | Description |
|---|---|
SIS_USERNAME |
SIS portal credentials |
SIS_PASSWORD |
SIS portal credentials |
WEBHOOK_SECRET |
Shared secret for n8n request verification |
GITHUB_TOKEN |
Fine-grained PAT with read/write access to data repo (used by /append-index and /rebuild-index) |
DATA_REPO |
GitHub data repo (owner/repo format, used by /append-index and /rebuild-index) |
| Variable | Description |
|---|---|
GITHUB_TOKEN |
Fine-grained PAT with read access to data repo |
DATA_REPO |
GitHub data repo (owner/repo format) |
DATA_PREFIX |
Namespace for data paths. Empty for production, synthetic for preview deployments |
BASIC_AUTH_CREDENTIALS |
Single user:pass for HTTP basic auth. Scope per environment in Vercel. Unset = no auth |
NEXT_PUBLIC_LIVEKIT_URL |
LiveKit Cloud WebSocket URL (for agent widget) |
LIVEKIT_URL |
LiveKit Cloud WebSocket URL (server-side token generation) |
LIVEKIT_API_KEY |
LiveKit API key (server-side token generation) |
LIVEKIT_API_SECRET |
LiveKit API secret (server-side token generation) |
The compose file needs no variables. n8n authenticates with its own owner account, created in the browser on first launch; enable two-factor authentication on it. The n8n image version is pinned in docker-compose.yml, so upgrades are a deliberate change to that tag.
All remaining credentials (GitHub PAT, webhook secret, SIS credentials for passthrough) are stored in n8n's encrypted credential store.
- Docker
- A container runtime that can serve HTTP (Cloud Run, App Runner, Fly.io, or similar)
- A container registry accessible from your runtime
- GitHub fine-grained PAT with Contents read/write on the data repo
- n8n instance (self-hosted or cloud)
# Build for linux/amd64 (required for Playwright/Chromium)
docker buildx build --platform linux/amd64 -t <your-registry>/table-scraper:latest .
# Push to your registry and deploy to your container runtime
docker push <your-registry>/table-scraper:latestdocker compose up -d
# Then open https://<your-n8n-host> and create the owner accountpython -m venv .venv
.venv/bin/pip install -r requirements.txt -r requirements-dev.txt
.venv/bin/python -m pytestTests run against an in-memory snapshot store and never contact GitHub or the SIS.
Deployed via Vercel with auto-deploy from this repo. Set GITHUB_TOKEN, DATA_REPO, and DATA_PREFIX in Vercel environment settings.
A LiveKit-powered voice agent ("Sally Schoolwork") is embedded as a floating widget in the frontend. Users ask questions about grades, assignments, and changes by voice; the agent answers conversationally and auto-navigates the browser to relevant views via LiveKit RPC.
The agent backend lives in a separate repo (sally-schoolwork). This repo provides the frontend widget and RPC navigation handler. See LIVEKIT_AGENT.md for integration details and PROGRESS_LIVEKIT.md for current status.
Frontend components:
AgentWidget.tsx: floating widget with video/audio rendering, persona selector, connect/disconnectNavigationHandler: registersnavigateToRPC method, callsrouter.push()on agent request/api/livekit-token: server-side JWT generation withRoomAgentDispatch/help: capabilities page the agent navigates to after onboarding
Environment variables (add to frontend/.env.local):
NEXT_PUBLIC_LIVEKIT_URL: LiveKit Cloud WebSocket URLLIVEKIT_URL,LIVEKIT_API_KEY,LIVEKIT_API_SECRET: server-side token generation
MIT License. Copyright (c) 2026 David Lasley.
Built using AI-assisted development tooling while maintaining human ownership of architectural decisions, runtime separation, and governance design. AI accelerated implementation; system decomposition and operationalization patterns were deliberate and human-directed.
The focus throughout:
- n8n as orchestrator. It owns the data flow; workers are stateless.
- Runtime isolation over monolithic convenience. Each component scales, fails, and deploys independently.
- Credential isolation by boundary. No component holds secrets it does not need.
- Computed over stored. The rolling index pre-computes change counts for monthly calendar view performance, but detail-level diffs are always derived at read time from raw snapshots.