District Transfer Tracking
Architecture & Major Components
High-level diagram (text):
- Trigger (run.sh or cron) -> auto-update + lock + backups -> exports + mapping + sheet sync -> Google Sheet + notifications + reports
Trigger (run.sh/cron)auto-update + lock + backupsexports + mapping + sheet syncGoogle Sheet + notifications + reportsEntry points:
run.sh(pipeline runner)deploy.sh(Apps Script push via clasp)scripts/dev-todo-helper.sh(Dev-ToDo download/commit/update helper)- Apps Script menu: Transfer Tools (student ID lookup, grade validation, manual entry, filter view refresh)
Top-level folders:
bin/: CLI tools (informedk12-sync, jotform-sync, google-sheet-sync, csv_mapper, mssql_to_csv, email_template_mailer)conf.d/: tool configs and mapping filesappsscript/: Apps Script projecttemplates/: report email HTMLREFERENCE-INFO/: CLI usage referencesscripts/: operational helpers (Dev-ToDo helper)logs/: run logs and component logsbackups/: Transfers sheet backupslock/: runtime lock directory to prevent concurrent runsemails_sent/: outbound email tracking from email_template_mailertemp/: transient CSVs and generated mailer configs
Key abstractions:
- Source exports (CSV) for each upstream system
- Mapping configs (csv_mapper JSON) to normalize fields into the Transfers schema
- Sheet sync config (google-sheet-sync TOML) for uploads/downloads
- Backup and retention policies for the Transfers sheet and run logs
- Notification and reporting templates (email_template_mailer HTML + CSV merge)
- Apps Script helpers for validation, manual entry, and filter view maintenance
Setup / Build / Run
- Build system(s):
- Bash pipeline (
run.sh) with strict error handling - Apps Script deployment via
clasp(optional)
- Bash pipeline (
- Local run steps:
cp config.example.toml config.toml- Fill
config.tomlwith API tokens, form IDs, SMTP details, and paths - Ensure
conf.d/google-sheets-sync-transfers.tomlpoints to the correct sheet ID and service account key - Share the Google Sheet with the service account email in
conf.d/priv_key.json ./run.sh(runs from repo root; the script self-cds into its directory)- Optional Apps Script deploy:
./deploy.sh
- Runtime dependencies:
- InformedK12 API token and campaign IDs
- Jotform API key and form ID
- Aeries SQL credentials (MSSQL) for elementary and secondary queries
- Google Sheets service account key (shared with the target sheet)
- Access to the Google Sheet tabs: IK12-Inter, IK12-Intra, JF-Inter, Transfers, Aeries-STU-Demo, config-grades
- SMTP credentials for reporting emails (optional)
email_template_mailerbinary present and executable when reporting is enabled
Operational Notes
- Full cycle run: execute
./run.shto optionally auto-update the repo, acquire a lock, rotate logs/backups, back up Transfers, export sources, map data, sync sheet tabs, upload Aeries-STU-Demo, compute new submissions, and send report/notification emails. - Common failure modes:
- Missing required config values in
config.toml(tokens, form IDs, SMTP). - Lock directory already present from another run (stale lock).
- Missing or non-executable binaries in
bin/. - Access issues to Google Sheets or Aeries SQL (service account not shared).
- Config sheet headers not found within
sheets.range_config(notification recipients not detected). - Auto-update skipped due to a dirty working tree or detached HEAD.
- Missing required config values in
- Validation/audit:
- Staff review in
Transfersusing filter views. - Apps Script helpers for student ID lookup and grade validation.
- Run logs in
logs/and report emails for step-by-step results. - Confirm Transfers backup CSVs exist under
backups/for each run.
- Staff review in