Personal portfolio and resume site. Rust/Axum backend serving a SvelteKit frontend as static files at runtime via tower-http's ServeDir. The Docker multi-stage build compiles the backend and the frontend in separate stages, then copies both into the final image — the binary and the frontend assets are packaged together at image-build time, not at compile time.
- Backend: Rust (edition 2024), Axum 0.8
- Frontend: SvelteKit (Svelte 5), Tailwind CSS v4, DaisyUI v5
- Database: SQLite via rusqlite
- AI features: rig-core (Anthropic Claude), optional
- Static serving: tower-http
ServeDir(runtime, reads fromSTATIC_DIR, defaultfrontend/build)
- Rust — edition 2024
- Node.js — v22+
- just — command runner (
cargo install justorbrew install just) - Docker — optional, for containerized runs
git clone <repo-url>
cd folio
cp .env.example .envEdit .env:
ADMIN_PASSWORD— required, no default. The app will panic at startup without it.ANTHROPIC_API_KEY— optional. Leave blank to disable AI chat and job-fit analysis features.CORS_ORIGIN— defaults tohttp://localhost:3000. No change needed for local dev.EDGE_AUTH_TOKEN— required, no default, and the.env.exampleplaceholder is deliberately invalid — generate your own (EDGE_AUTH_TOKEN="folio_edge_$(openssl rand -hex 32)") before running anything. Shared secret the reverse proxy injects into every request; the app rejects any request without it.
Every request to the backend — page loads included — now requires the EDGE_AUTH_TOKEN value as an X-Folio-Edge-Auth header. A plain browser can't add that header, so browse through the Vite dev server on :5173, not the backend's own port directly.
The server needs a built frontend in frontend/build. Build it once:
cd frontend && npm run buildThe projects and articles lists are not part of the build. The server fetches them itself when it starts and keeps them fresh; it serves whatever valid lists the database already holds, so on a fresh database /projects shows its "temporarily unavailable" line until a list has arrived (or if the network is closed).
In one terminal, run the backend:
cargo runIn a separate terminal, run the Vite dev server:
just frontend-dev # serves on port 5173Open http://localhost:5173 in a browser. Vite serves pages directly (not through the backend), and its /api proxy reads EDGE_AUTH_TOKEN from .env and attaches it to every proxied request on your behalf — so this is the one entry point the origin lock doesn't block.
just runBuilds the frontend and starts the backend serving it directly on port 3000 (or whatever PORT is set to in .env). Useful for confirming the built binary serves correctly — e.g. curl -H "X-Folio-Edge-Auth: $EDGE_AUTH_TOKEN" http://localhost:3000/ — but not for interactive browsing: every page, not just /api, is behind the origin lock here, and a browser has no way to attach the header.
just dockerOr manually: docker compose up --build. App at http://localhost:8080.
SQLite database. Migrations run automatically at startup — no manual step needed.
The DB file lives at data/site.db (gitignored).
Seed with demo data:
just seedjust test # backend unit and integration tests
just e2e # end-to-end tests (requires app on localhost:8080)
just check # fmt + clippy + test (pre-commit)cmd/ Rust binary — Axum server entry point
libs/ Rust libraries — core logic, DB, AI, models, routes
frontend/ SvelteKit frontend — Svelte 5, Tailwind v4, DaisyUI v5
data/ SQLite database and seed SQL
migrations/ SQL schema migrations
e2e/ Playwright end-to-end tests
| Variable | Required | Default | Description |
|---|---|---|---|
PORT |
No | 3000 |
Port the server listens on |
DATABASE_URL |
No | data/site.db |
Path to the SQLite database file |
ADMIN_PASSWORD |
Yes | — | Password for the admin dashboard |
CORS_ORIGIN |
No | http://localhost:3000 |
Allowed CORS origin |
ANTHROPIC_API_KEY |
No | — | Anthropic API key for AI features |
EDGE_AUTH_TOKEN |
Yes | — | Shared secret the reverse proxy injects on every request; rejected without it |