# Lesstruct — Full Documentation > Documentation site for Lesstruct. > This file concatenates every documentation page on the site in section order. > For a slim index, see `/llms.txt`. For per-page fetching, use each page's `//index.md` URL. ## Section: Docs ### Project Context Source: [/docs/project-context/index.html](/docs/project-context/index.html) Reference page for Project Context. # Project Context for AI Agents _This file contains critical rules and patterns that AI agents must follow when implementing code in this project. Focus on unobvious details that agents might otherwise miss._ --- ## Technology Stack & Versions ### Backend (Go) - **Go** 1.26 — module: `github.com/aristorinjuang/lesstruct` - **Chi** 5.2.5 — HTTP router; **httprate** 0.15.0 — per-route rate limiting - **Databases** (driver selected via `DB_DRIVER` env: `sqlite` | `postgres` | `mysql`): - **SQLite** (modernc.org/sqlite v1.50.0) — default, embedded - **PostgreSQL** (jackc/pgx/v5 v5.10.0) - **MySQL** (go-sql-driver/mysql v1.9.2) — DSN MUST contain `parseTime=true` AND `multiStatements=true` - **golang-migrate** 4.19.1 — DB migrations via `iofs` embedded filesystem, per-driver subdirs under `internal/database/migrations/{sqlite,postgresql,mysql}/` - **BurntSushi/toml** 1.6.0 — `config.toml` parsing - **joho/godotenv** 1.5.1 — `.env` loader (called from `config.Load()`) - **fsnotify** 1.10.0 — config file hot-reload - **golang-jwt** 5.3.1 — JWT auth (browser admin realm) - **bluemonday** 1.0.27 — HTML sanitization - **goldmark** 1.8.2 — Markdown parser (Markdown → TipTap JSON converter in `internal/content/markdown/`) - **wazero** 1.11.0 — WebAssembly runtime (plugin system) - **google.golang.org/genai** 1.59.0 — Google Imagen image generation - **openai/openai-go** 1.12.0 — text generation (OpenAI-compatible APIs via `AI_TEXT_GENERATION_BASE_URL`) - **deepteams/webp** 1.2.1 + **golang.org/x/image** 0.39.0 — image transcoding for media uploads - **spf13/cobra** 1.10.2 — CLI framework (`cmd/lesstruct-cli`) - **golang.org/x/crypto** 0.51.0, **golang.org/x/net** 0.55.0 - **stretchr/testify** 1.11.1 — test assertions - **mockery** — mock generation (`make mock`) - **govulncheck** — vulnerability scanning (`make vulncheck`) - **golangci-lint** v2.11.4 — linter (`make lint`); config in `.golangci.yml` ### CLI (`cmd/lesstruct-cli`) - Thin Cobra-based client over `/api/v1`; imports **no server internals** - Subcommands: `content` (create/get/list/update/delete/publish/unpublish), `media` (upload/get/list), `config` - Auth via `--api-key` flag, `LESSTRUCT_API_KEY` env, or config file (precedence in that order) - Output mode: `--output text|json` (default `text`) - Built via `make build-cli` → `bin/lesstruct-cli`; integration tests via `make test-cli` (tag `integration`) ### Admin Panel (Frontend) — `web/admin/` - **Vue 3** 3.5.31 — Composition API + `` and `` are present (otherwise the nav login/logout toggle and search dropdown break). ## Page templates (any `templates/.html` you ship) - [ ] The template defines `{{define "body"}}…{{end}}` exactly once. - [ ] The template uses the data fields listed in [Template Data Fields](theme-development.md#template-data-fields) by their documented names (`.Title`, `.PageTitle`, etc.). ## JavaScript DOM contract If you override `static/comments.js`: - [ ] The content template still has `
`. - [ ] The form has a `