# S06: App Footer with Version Info

**Goal:** Every page shows a subtle footer with app version, build date, and optional repo link.
**Demo:** After this: Every page shows a subtle footer with app version, build date, and optional repo link.

## Tasks
- [x] **T01: Added AppFooter component displaying app version, build date, commit SHA, and GitHub link — wired through Vite define constants with Docker-compatible env fallback** — Create the AppFooter component showing app version, build date, and git commit SHA. Wire build-time constants through Vite define, add TS declarations, update App.tsx and App.css, and update Docker infrastructure to pass the git SHA into the web build.

**Important context:**
- The canonical repo is on ub01 at `/vmPool/r/repos/xpltdco/chrysopedia`. Docker/compose files live there.
- This working directory has the frontend code. Docker files (`docker/Dockerfile.web`, `docker-compose.yml`) must be edited on ub01 via SSH.
- The API Dockerfile already uses `ARG GIT_COMMIT_SHA=unknown` — follow the same pattern for the web Dockerfile.
- Vite `define` does literal text replacement, so string values MUST be wrapped in `JSON.stringify()`.
- `git rev-parse --short HEAD` won't work inside the Docker build (only `frontend/` is copied). Use `ARG VITE_GIT_COMMIT` and `ENV VITE_GIT_COMMIT=$VITE_GIT_COMMIT` so Vite can read it.
- The `.app` div in App.tsx has no CSS — add `display: flex; flex-direction: column; min-height: 100vh` so the footer is pushed to the bottom on short pages.
- The `vite.config.ts` runs in Node context — `child_process.execSync` and `fs.readFileSync` are available for local dev. For Docker builds, read from `process.env.VITE_GIT_COMMIT` with fallback to git command, with fallback to 'dev'.
- Package version comes from `package.json` — import it in vite.config.ts.
- Build date: `new Date().toISOString()` at build time.
- The repo link is `https://github.com/xpltdco/chrysopedia` (private, single-admin tool — fine to show).
  - Estimate: 45m
  - Files: frontend/vite.config.ts, frontend/src/vite-env.d.ts, frontend/src/components/AppFooter.tsx, frontend/src/App.tsx, frontend/src/App.css
  - Verify: cd frontend && npm run build 2>&1 | tail -5 && echo 'Build OK' && grep -q '__APP_VERSION__' vite.config.ts && grep -q 'AppFooter' src/App.tsx && test -f src/components/AppFooter.tsx && echo 'All checks pass'
- [x] **T02: Updated Dockerfile.web and docker-compose.yml on ub01 to pass VITE_GIT_COMMIT build arg, rebuilt and deployed — footer shows v0.1.0, build date, commit 08d7d19, and GitHub link** — Update Dockerfile.web and docker-compose.yml on ub01 to pass GIT_COMMIT_SHA as a build arg to the web service. Rebuild and deploy to verify the footer renders with real version info.

**Important context:**
- All Docker files are on ub01 at `/vmPool/r/repos/xpltdco/chrysopedia/`.
- Use SSH to edit files: `ssh ub01` then edit in `/vmPool/r/repos/xpltdco/chrysopedia/`.
- Current `docker/Dockerfile.web` is a two-stage build: `node:22-alpine` builds, `nginx:1.27-alpine` serves.
- Add `ARG VITE_GIT_COMMIT=dev` before the `RUN npm run build` line. Add `ENV VITE_GIT_COMMIT=$VITE_GIT_COMMIT` so Vite can read it via `process.env.VITE_GIT_COMMIT`.
- In `docker-compose.yml`, add `VITE_GIT_COMMIT: ${GIT_COMMIT_SHA:-dev}` to the web service's `build.args`.
- The API service already has `GIT_COMMIT_SHA: ${GIT_COMMIT_SHA:-unknown}` in its build args — follow the same pattern.
- After editing, commit the changes, then rebuild: `docker compose build chrysopedia-web && docker compose up -d chrysopedia-web`.
- After deploy, verify at http://ub01:8096 — the footer should be visible on the home page.
- If the commit SHA shows as 'dev', that's expected when `GIT_COMMIT_SHA` env var isn't set. To test with a real SHA: `GIT_COMMIT_SHA=$(git rev-parse --short HEAD) docker compose build chrysopedia-web`.
- Also push the T01 frontend changes to ub01 first — either git push from local + git pull on ub01, or copy files via SCP.
  - Estimate: 30m
  - Files: docker/Dockerfile.web, docker-compose.yml
  - Verify: ssh ub01 'cd /vmPool/r/repos/xpltdco/chrysopedia && grep -q VITE_GIT_COMMIT docker/Dockerfile.web && grep -q VITE_GIT_COMMIT docker-compose.yml && echo Docker files OK' && echo 'Verify footer at http://ub01:8096'
