{"id":51065446,"url":"https://github.com/pfa230/labeler","last_synced_at":"2026-06-23T06:02:09.565Z","repository":{"id":366636741,"uuid":"1122079737","full_name":"pfa230/labeler","owner":"pfa230","description":"Self-hosted REST service that renders labels from declarative YAML templates (Rust/axum + Typst)","archived":false,"fork":false,"pushed_at":"2026-06-22T16:38:22.000Z","size":1581,"stargazers_count":0,"open_issues_count":12,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-22T18:23:20.823Z","etag":null,"topics":["homelab","label-printing","labels","qr-code","rust","self-hosted","typst"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pfa230.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-24T04:26:56.000Z","updated_at":"2026-06-22T16:38:26.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pfa230/labeler","commit_stats":null,"previous_names":["pfa230/labeler"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/pfa230/labeler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfa230%2Flabeler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfa230%2Flabeler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfa230%2Flabeler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfa230%2Flabeler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pfa230","download_url":"https://codeload.github.com/pfa230/labeler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfa230%2Flabeler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34677403,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["homelab","label-printing","labels","qr-code","rust","self-hosted","typst"],"created_at":"2026-06-23T06:02:08.629Z","updated_at":"2026-06-23T06:02:09.560Z","avatar_url":"https://github.com/pfa230.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Labeler\n\nA REST service that renders labels from declarative YAML templates. It produces a single label as PNG\n(for continuous-roll printers) or a sheet of labels as PDF (for pre-cut label sheets), by generating\n[Typst](https://typst.app/) source on the fly and compiling it in-process.\n\n## Quickstart (Docker)\n\n```bash\ndocker run -p 8080:8080 ghcr.io/pfa230/labeler:edge\n```\n\n## Run\n\n```bash\ncargo run            # serves on 0.0.0.0:$PORT (default 8080)\n```\n\n## Web UI\n\nA React + TypeScript SPA in `ui/` (Vite, Tailwind). The backend serves its build at `/`.\n\n```bash\nnpm --prefix ui install            # once\nnpm --prefix ui run dev            # Vite dev server (proxies /api to cargo run on :8080)\nnpm --prefix ui run build          # build to ui/dist (then `cargo run` serves it at /)\n```\n\nIn production the binary serves `ui/dist`; the Docker multi-stage build bundles the UI (see Deployment\nbelow).\n\n## Deployment\n\nRun the whole thing with Docker:\n\n```bash\ndocker compose up -d --build      # serves on http://localhost:${HOST_PORT:-8080}\n```\n\nSee [`docs/DEPLOY.md`](docs/DEPLOY.md) for configuration, persistent volumes and backups, and CUPS/IPP\nprinting setup.\n\nYAML templates are loaded from `templates/` at startup; an invalid template stops the service from\nstarting. Starter templates: `avery5163` (US Letter sheet); the Brother continuous-tape set\n`brother_12mm` / `brother_18mm` / `brother_24mm` (text only) plus `brother_18mm_qr` / `brother_24mm_qr`\n(QR + text); and `homebox-qr`, a Homebox asset label whose QR links to an item, demonstrating variable\ninterpolation.\n\n## Endpoints\n\nAll routes are under `/api` (the root is reserved for the web UI); unknown `/api/*` → `404 NotFound`.\n\n- `GET /api/health` → `{ \"status\": \"ok\" }`\n- `GET /api/templates` → list of template summaries\n- `GET /api/templates/{id}` → detailed template schema\n- `GET /api/templates/{id}/source` → raw stored template YAML\n- `POST /api/render/label` → rendered PNG/PDF for a single template (preview / one-off)\n- `POST /api/batch` → render/print a batch (single → ZIP or per-label jobs, sheet → paginated PDF or job)\n- `GET /api/openapi.json` → OpenAPI document\n- `GET /api/docs/` → Swagger UI\n\n`scripts/render_avery_horizontal.sh` posts a sample request to a running server and writes a PDF. All\n`/api` routes require authentication (ADR-0017), so export `LABELER_API_TOKEN` (create one in the UI\nunder Settings) before running it; the script sends it as `Authorization: Bearer $LABELER_API_TOKEN`.\n\n## Error model\n\nAll errors are JSON with a stable schema:\n\n```json\n{\n  \"error\": {\n    \"code\": \"TemplateNotFound\",\n    \"message\": \"No template with id 'xyz' was found\",\n    \"details\": { \"template\": \"xyz\" }\n  }\n}\n```\n\n## Development\n\n```bash\ncargo fmt\ncargo clippy --all-targets --all-features\ncargo test\n```\n\n[`CONTRIBUTING.md`](CONTRIBUTING.md) has the contributor workflow. The full API and template spec is in\n[`docs/SPEC.md`](docs/SPEC.md); design decisions are recorded as [ADRs](docs/adr/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpfa230%2Flabeler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpfa230%2Flabeler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpfa230%2Flabeler/lists"}