From 627ba5496a786440460d6f4700dc16daf553d4d4 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Sun, 1 Feb 2026 13:10:34 +0000 Subject: [PATCH] Add docker build --- .dockerignore | 13 +++++ .github/workflows/docker.yml | 49 ++++++++++++++++++ CLAUDE.md | 97 ++++++++++++++++++++++++++++++++++++ Dockerfile | 25 ++++++++++ 4 files changed, 184 insertions(+) create mode 100644 .dockerignore create mode 100644 .github/workflows/docker.yml create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..f6d86cf --- /dev/null +++ b/.dockerignore @@ -0,0 +1,13 @@ +data/ +data_sources/ +.venv +**/node_modules +**/dist +server-rs/target +.git +.task +.claude +__pycache__ +*.parquet +analyses/ +*.log diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..c934dca --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,49 @@ +name: Docker + +on: + push: + branches: [main] + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=raw,value=latest + type=sha,prefix=sha-,format=short + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/CLAUDE.md b/CLAUDE.md index 3042601..2934117 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -117,6 +117,103 @@ React 18 + TypeScript. deck.gl `H3HexagonLayer` over MapLibre GL. TailwindCSS. N - Properties pane uses feature names from API response (human-readable), not hardcoded field names - Proxy: dev server on :3030 proxies `/api` to :8001; also handles VS Code `/proxy/PORT` patterns +## Frontend Design Guide (STRICT — must be followed for all UI changes) + +The frontend uses Tailwind's `darkMode: 'class'` strategy. The `dark` class is toggled on ``. Every visible element must have both light and dark styles. **Never add a light-only color class without its `dark:` counterpart.** Run `task build:frontend` after any UI change to verify. + +### Theme System + +- **State**: `App.tsx` owns a `theme` state (`'light' | 'dark' | 'system'`), persisted in `localStorage` under the key `theme`, default `'system'`. +- **Effective theme**: When `'system'`, resolved via `window.matchMedia('(prefers-color-scheme: dark)')`. A `change` listener re-renders on OS preference flip. +- **Toggle cycle**: light → dark → system → light. Three-way, not binary. +- **Flash prevention**: `index.html` contains an inline `