Skip to content
prmanahanPublic

About

Folio Full-stack portfolio site with an AI assistant that answers questions about the owner's background and analyzes job fit against a pasted job description.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

192 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

folio

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.

Tech Stack

  • 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 from STATIC_DIR, default frontend/build)

Prerequisites

  • Rust — edition 2024
  • Node.js — v22+
  • just — command runner (cargo install just or brew install just)
  • Docker — optional, for containerized runs

Getting Started

git clone <repo-url>
cd folio
cp .env.example .env

Edit .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 to http://localhost:3000. No change needed for local dev.
  • EDGE_AUTH_TOKEN — required, no default, and the .env.example placeholder 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.

Running Locally

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.

Frontend hot-reload (recommended for browsing)

The server needs a built frontend in frontend/build. Build it once:

cd frontend && npm run build

The 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 run

In a separate terminal, run the Vite dev server:

just frontend-dev   # serves on port 5173

Open 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.

Full stack

just run

Builds 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.

Docker

just docker

Or manually: docker compose up --build. App at http://localhost:8080.

Database

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 seed

Running Tests

just test      # backend unit and integration tests
just e2e       # end-to-end tests (requires app on localhost:8080)
just check     # fmt + clippy + test (pre-commit)

Project Structure

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

Environment Variables

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

About

Folio Full-stack portfolio site with an AI assistant that answers questions about the owner's background and analyzes job fit against a pasted job description.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages