diff --git a/.dockerignore b/.dockerignore index 08bd5ee..9bd9084 100644 --- a/.dockerignore +++ b/.dockerignore @@ -14,3 +14,4 @@ config/*_ed25519.pub dday *.out *.db +frontend/target diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6640174..10a9a8d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,6 +31,23 @@ jobs: - name: test (race) run: go test -race ./... + # The committed frontend/dist artifacts are what ships; this job only proves + # the Rust frontend still compiles (fmt + clippy + wasm build). + frontend: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: rustup target add wasm32-unknown-unknown + - uses: Swatinem/rust-cache@v2 + with: + workspaces: frontend + - name: cargo fmt + run: cargo fmt --manifest-path frontend/Cargo.toml --check + - name: cargo clippy + run: cargo clippy --manifest-path frontend/Cargo.toml --target wasm32-unknown-unknown -- -D warnings + - name: build (wasm32) + run: cargo build --manifest-path frontend/Cargo.toml --release --target wasm32-unknown-unknown + docker: runs-on: ubuntu-latest steps: diff --git a/.gitignore b/.gitignore index d55b433..41521a5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,14 @@ /dday *.out +# Rust frontend build tree (frontend/dist IS committed — the Go binary embeds it) +/frontend/target/ + # Secrets — never commit matrix.env .env /config/*_ed25519 /config/*_ed25519.pub + +# Local SQLite DB from dev runs +/dday.db* diff --git a/Makefile b/Makefile index 7634efe..98f7f52 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ IMAGE ?= dday:latest PORT ?= 3329 MATRIX_ENV ?= matrix.env -.PHONY: help run dev build docker up down logs fmt vet tidy test keys \ +.PHONY: help run dev build frontend docker up down logs fmt vet tidy test keys \ check check-keys matrix-hello matrix-send bot help: ## Show this help @@ -12,9 +12,12 @@ help: ## Show this help run: ## Run the web server locally on $(PORT) PORT=$(PORT) go run . -dev: ## Run the web server serving index.html from disk (live edits) +dev: ## Run the web server serving frontend/dist from disk (rebuild via `make frontend`) PORT=$(PORT) STATIC_DIR=. go run . +frontend: ## Rebuild the Rust+ratatui WASM frontend into frontend/dist (committed) + ./scripts/build-frontend.sh + build: ## Build the web server binary CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o dday . diff --git a/README.md b/README.md index f411329..ec585f4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # D-Day -Statyczny landing page unconference **D-Day**. +Landing page unconference **D-Day** — terminal w przeglądarce: Rust + [ratatui](https://ratatui.rs) + WebAssembly ([Ratzilla](https://github.com/ratatui/ratzilla)). Memory safe ✨ - **Kiedy:** sobota 8 sierpnia 2026, 14:00–22:00 - **Gdzie:** Hakierspejs, Zielona 30 LU3, Łódź @@ -9,9 +9,23 @@ Statyczny landing page unconference **D-Day**. ## Rozwój -Pojedynczy plik `index.html`, bez zależności. Otwórz lokalnie w przeglądarce albo hostuj przez GitHub Pages. +Frontend mieszka w `frontend/` — crate Rust renderujący cały interfejs jako TUI +(ratatui) do DOM przez Ratzillę. Zbudowane artefakty (`frontend/dist/`: +`index.html`, `dday_web.js`, `dday_web_bg.wasm`) **są commitowane** — binarka Go +je embeduje, więc `go build` i obraz Dockera nie wymagają toolchaina Rusta. -Link do formularza zapisów podmień w `index.html` (szukaj `TODO` w sekcji ` + +
+ + +