A Val Town-native rebuild of the NDX Production Command Center. Cloudflare Next.js/Vinext has been replaced with Hono (routes) + a client-side React frontend. Cloudflare D1 → this val's scoped SQLite. Cloudflare R2 → this val's scoped Blob Storage.
Phase status: Phase 2 — non-Monday dashboard features complete. Auth, roles, the full dashboard (jobs, rates, Vista/BusyBusy imports, cost consolidation, equipment/crew/phase views, equipment moves, reports), and permanent job storage are implemented and tested. Monday.com remains disconnected. No production job data is loaded.
Sign in with the existing administrator account. Every dashboard page and data API requires authentication.
Rendering mermaid diagram...
index.ts ← Hono HTTP entrypoint (auth + jobs + data + files + rates)
db.ts ← SQLite migrations (users, sessions, jobs, rates, data, Monday, files)
auth.ts ← PBKDF2 hashing, HTTP-only session cookies, role middleware
equipmentRates.ts ← Equipment rate book (source of hourly operating rates)
frontend/
root.tsx ← HTML shell (stamps immutable asset URLs)
index.tsx ← React entrypoint
App.tsx ← Auth + jobs, rates, imports, cost/equipment/report views
styles.css ← NDX black/white/red interface
pcc_session), token hashed in DB, 30-day expiry.approved_emails) with admin / user roles. Admins manage jobs; both may view/enter data.requireAuth); job create/edit/delete also requires requireAdmin.A "Forgot password?" link on the sign-in screen opens a recovery form. To reset an administrator password you need the administrator email, the recovery code, and a new password entered twice.
ADMIN_RECOVERY_CODE environment
variable — it is never hardcoded, displayed, or logged.👉 Add ADMIN_RECOVERY_CODE here: https://www.val.town/x/wnewton/production-command-center/environment-variables?key=ADMIN_RECOVERY_CODE
Monday.com: disconnected. The Utility Schedule import is deferred to Phase 3.
monday.ts using Deno.env.get("MONDAY_TOKEN"). The
token is never returned, logged, or sent to the browser.MONDAY_BOARD_ID env), column mapping from
the board's own metadata, imports only Utility Schedule items, and ignores
every item in a group whose normalized name is "Completed" / "Completed.".monday_item_id (migration 0003,
unique index), so refreshes update existing jobs instead of duplicating.
Manually created jobs are never touched.POST /api/monday-refresh
imports, writes a snapshot to monday_snapshots, and returns
added / updated / completed-ignored / last-refresh. Errors are generic and
never reveal credentials.Status: the connection/error path is verified reachable and safe. The
currently configured MONDAY_TOKEN is rejected by Monday (HTTP 401 — invalid or
expired), so no jobs have been imported yet. To complete the live sync,
replace the token with a valid Monday personal API token and click Refresh.
MONDAY_TOKEN with a valid token, then click Refresh to import
the Utility Schedule (the write/import path is implemented but not yet
executed against live data).5103, so equipmentRates.ts carries 96 records; some
small-tool entries may be missing).The val injects its own API token; no valtown env var is needed. The credentials
used are MONDAY_TOKEN (server-only) and ADMIN_RECOVERY_CODE.
👉 Add MONDAY_TOKEN here: https://www.val.town/x/wnewton/production-command-center/environment-variables?key=MONDAY_TOKEN