M41Dashboard

Meal4One Dashboard

Setup (one time)

  1. Install dependencies:
    npm install
    
  2. Place your Google service-account key file in this folder, named:
    service-account.json
    

    (Already have one from earlier — just copy it here and rename it.)

  3. Share both Google Sheets with the service account’s email (found in the client_email field of the key file) as Viewer:
    • The main data sheet (MainData / Order / TopCritical / BI / Impression)
    • The Coverage Model sheet (CityCoverage / CoverageResult)
  4. Open update_dashboard.js and set both IDs near the top — copy each from its sheet’s URL:
    https://docs.google.com/spreadsheets/d/[SPREADSHEET_ID]/edit
    
    • SPREADSHEET_ID → the main data sheet
    • COVERAGE_SPREADSHEET_ID → the Coverage Model sheet

Every time you want to refresh the dashboard

Easiest: double-click refresh-dashboard.bat. It pulls fresh data, encrypts it, and pushes the update to GitHub Pages automatically.

Or manually:

node update_dashboard.js

This reads all seven tabs across both sheets (MainData, Order, TopCritical, BI, Impression, CityCoverage, CoverageResult), re-runs all the aggregations, writes dashboard_data.json, and then automatically encrypts it into dashboard_data.enc (see Password Protection below).

Then just open (or refresh) dashboard.html in your browser.

Password protection

The live dashboard is public on GitHub Pages, so it’s protected with a password:

Honest caveat: this is meaningfully stronger than a cosmetic JS gate (the raw published file is genuine ciphertext, not just hidden HTML), but it’s still passwords checked client-side — anyone who has one can share it, a determined attacker could brute-force a weak one offline, and real two-factor login isn’t possible without a server in front of the site. Treat it as “keeps casual/unauthorized viewers out,” not as enterprise access control. For real per-user accounts with 2FA, a server-side gate (Google Apps Script with Google login, or Cloudflare Access) is the route.

Filtering & calculation rules baked into the script

The whole UI is English-only (including the Vendor Type filter labels); city and area names stay as they appear in the source data.

Files

Coverage History & Lead Tracking