The "Download HTML" button on the QA panel was producing the V1-era hand-rolled HTML skeleton (dark theme, basic card grid, no editorial sections, no theme support). The live dashboard now has the full warm-cream Leaderboard/Constellation/Drawer experience but the offline download lagged behind. Stage 10b now snapshots the production SPA dist into a self-contained HTML file: - Reads templates/dashboard_template/dist/assets/index-*.js + index-*.css (built into the Docker image at image-build time). - Inlines the CSS as <style>, the JS as <script type="module">, the dataset as <script type="application/json" id="atrium-data">. - App.tsx detects the inline data tag and skips the /api/.../dataset fetch, so the SPA boots identically online or offline. - Theme is also inlined as a :root override block in the <head> so the first paint already uses the brief's accent / heading font / background — no flash before the React applyTheme() runs. Falls back to a minimal-but-themed cream HTML if the SPA dist isn't on disk (e.g. running the pipeline outside the Docker image), so offline downloads never crash. The fallback also inlines the dataset for claude.ai-style upload flows. Bundle size: ~580 KB SPA JS + ~17 KB CSS + dataset (varies). Well inside the V3 §10b 3 MB ceiling on typical reports. Google Fonts still loaded externally — accept fallback fonts when the file is genuinely opened with no network. Embedding the full WOFF2 files would push us past 3 MB and the cascade fallback (Georgia for Fraunces) reads cleanly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| v2 | ||
| .gitignore | ||
| DEVELOPER_BRIEF_V2.md | ||
| README.md | ||
Social Reporting
V2 lives in v2/. All commands run from there.
cd v2
docker compose -f docker-compose.v2.yml --env-file .env up -d --build
npm install
npm test # 62 unit tests
npm run pipe seed --report <brief-id>
For the full V2 spec see DEVELOPER_BRIEF_V2.md.
Deploying V2 over an existing V1 install
If V1 is already deployed at /opt/social-reporting, cut over in place:
ssh you@optical-dev.oliver.solutions
cd /opt/social-reporting
git pull origin main # pulls in v2/, removes V1 dirs
bash v2/deploy/cutover-in-place.sh # stops V1, migrates secrets, starts V2
The script prompts before doing anything destructive, migrates
APIFY/Anthropic/Azure secrets from V1's .env into a fresh v2/.env,
swaps the Apache conf to V2's, and starts the V2 docker stack. It also
prompts for the email that will be auto-promoted to super-admin on first
SSO sign-in (BOOTSTRAP_SUPER_ADMIN_EMAIL).
The Azure-registered redirect URI
https://optical-dev.oliver.solutions/social-reports/login.html is
preserved by V2 (Vite base: /social-reports/, React Router basename,
and an explicit /login.html route alias).
V1 archive
V1 source is preserved on the v1-archive branch (frozen at the last V1
commit) and is no longer kept on the deployed server. To roll back from
V2 to V1, the rollback script will re-clone v1-archive if needed:
# On the server
export REPO_URL="https://x-token-auth:YOUR_TOKEN@bitbucket.org/zlalani/social-reporting-tool.git"
bash /opt/social-reporting-v2/v2/deploy/rollback-to-v1.sh
To inspect or check out V1 source locally:
git checkout v1-archive