PaperStudio/Imprint System
UsuarioSoporteDeveloper

Imprint System

One mother, many imprints. A printing-press metaphor for spawning child projects from a single Docuget codebase without forking.

An imprint is a child project rendered from a YAML manifest. The mother codebase is never modified — docuget imprint build reads imprint.yaml, selects the API modules listed under modules.api, bundles owned assets (branding/, guides/, templates/), and writes a self-contained dist/ with a Dockerfile, compose.yaml, .env.template and metadata.

Same content-as-data philosophy as the guides and templates systems. Same regenerate-on-demand cycle as prisma generate.

Why

You have a side project that needs only some of Docuget's modules with custom branding and content. Forking is heavy and forks drift. An imprint is a thin manifest that stays in lockstep with the mother.

Manifest

imprint:
  id: knowledge-toolkit
  name: "Knowledge Toolkit"
  docuget_version: v0.10.0
  source:
    mode: local # https-public | ssh | pat | local
    path: /home/me/docuget_api_rest # for local mode

modules:
  api: [core, guides, templates, video]
  frontend: [guides_viewer, video_player]

services:
  postgres: { enabled: true, version: "16" }
  minio: { enabled: optional }

auth:
  mode: local

outputs:
  - { format: website, deploy: docker }
  - { format: pdf, deploy: r2 }

core is always required (auth, users, companies, files). Other modules are opt-in.

CLI

docuget imprint init knowledge-toolkit --from=knowledge_toolkit
docuget imprint validate knowledge-toolkit
docuget imprint build knowledge-toolkit
docuget imprint up knowledge-toolkit -d
docuget imprint logs knowledge-toolkit -f
docuget imprint down knowledge-toolkit
docuget imprint list

Source modes

How the build step obtains the mother source code:

Mode Use case
https-public (default) Open-source reference deploy. Fails on private repos.
ssh Private repo via BuildKit --mount=type=ssh. Needs SSH_AUTH_SOCK.
pat Private repo via BuildKit secret. Needs DOCUGET_GH_TOKEN env var.
local COPY . /app from a host checkout. Best for dev iteration.

docuget imprint up automatically enables BuildKit and forwards the right flags (--ssh default or --secret id=ghtoken,env=DOCUGET_GH_TOKEN) based on source.mode.

Build pipeline

  1. Wipe previous dist/ so deleted source files actually disappear.
  2. Render Dockerfile, compose.yaml, .env.template, README.md from the manifest.
  3. Write imprint.json with the resolved manifest + _meta block.
  4. Copy owned assets (branding/, guides/, templates/) into dist/.
  5. Render guides if the imprint declares the guides module — invokes the mother renderer with GUIDES_ROOT pointing at the imprint's own guides directory. Outputs land in dist/guides/output/.
  6. Write .generated marker warning humans not to hand-edit.

Asset serving

The api container mounts bundled assets read-only at /imprint:

Path Maps to
/imprint/imprint.json resolved manifest + metadata
/imprint/branding/ logos, theme.yaml, etc.
/imprint/guides/ source guides + output/ rendered formats
/imprint/templates/ bundled template assets

A static-file router on api-rest exposes these over HTTP:

Route Returns
GET /v1/imprint imprint.json
GET /v1/imprint/branding/<file> branding asset
GET /v1/imprint/templates/<file> template asset
GET /v1/imprint/guides module/locale index
GET /v1/imprint/guides/<module>/<file> rendered guide (<lang>.html/pdf/json/revealjs.html)

On the mother server IMPRINT_ASSETS_DIR is unset, so every /v1/imprint route returns 404. The router lives in the core module but is dead code outside an imprint.

Module catalogue

145 routes across 14 modules:

Module Routes Notes
core 73 always required
comms 13 messaging, chat, integrations
finances 11 money_movs, hledger journal export
fleet 11 vehicles, drivers, trips
inventory 9 items, stock, warehouses
facturacion 8 Mexican invoicing, CFDI 4.0
workflows 6 business processes
dpp 3 document processing pipeline
ccom 3 conversational commerce
intranet 3 internal pages
alerts 1
health-edu 1
render 1

IMPRINT_MODULES=core,guides,finances at boot time filters which routers mount.

Status

Phase Status
P0 Route registry refactor in api-rest shipped
P1 init/validate/build/list CLI shipped
P2 docker compose orchestration (up/down/logs/ps) shipped
P3 Bundle assets + render guides during build (knowledge-toolkit dogfood) shipped
Source modes for private repos (ssh/pat/local) shipped
P4 Migration subsetting + imprint upgrade pending
P5 Frontend MODULE_MAP pruning + branding hooks pending
P6 imprint publish (R2 / Docker registry / Deno Deploy) pending

See also

  • Guides system — same content-as-data philosophy
  • Plan: docuget-skills/plans/platform/imprint/plan_summary.md
  • Guide: docuget imprint build then open dist/guides/output/imprint/en/guide.html