Package map
Complete inventory of every Go package under internal/, including what state or external services each package can write to.
This page maps every Go package under internal/ and documents its write boundaries so contributors and coding agents know which packages mutate state or contact external services. Run make check to verify this map stays in sync with the codebase.
Packages under internal/
internal/api: HTTP server, route registration, JSON request/response handling, login/demo rate limiting, and SPA static file serving. Writes: Mutates all SQLite tables via*sql.DB(users, sessions, settings, categories, locations, products, variants, barcodes, items, printers, label templates) and dispatches outbound print, UPC, OIDC, and LLM calls.internal/auth: Password hashing (bcrypt), session token generation and cookie handling,RequireAuth/RequireAdminmiddleware, and OIDC Authorization Code + PKCE flows. Writes: Inserts/updates/deletes rows inusersandsessionsin SQLite, sets/clears HTTP session cookies, and makes outbound HTTPS requests to the configured OIDC provider.internal/db: Opens the SQLite database inWALmode with foreign keys enabled and runs embedded SQL migrations. Writes: Creates and migrates SQLite schema objects andschema_migrationsrecords on disk.internal/db/migrations: Embedded.sqlmigration files (001_initial.sql,002_product_merges.sql). Writes: Read-only embedded assets executed byinternal/db.internal/demo: Public demo mode seed generator and hourly wall-clock reset manager. Writes: Clears and re-seeds household tables in SQLite whenDEMO_MODE=true.internal/docsverify: Test-only package verifying documentation parity (environment variables,docs/api.mderror catalog and live HTTP examples,internal/package map, andMakefiletargets). Writes: Test-only temporary SQLite databases undert.TempDir(); does not ship in production binaries.internal/domain: Core inventory domain types, rolling-average and open/freeze/thaw due-date calculations, and SQLite FTS5 trigram product search helpers. Writes: Queries and updates product/item domain records and FTS5 index tables via*sql.DB.internal/llm: Client for Anthropic, OpenAI, Gemini, and OpenAI-compatible (Ollama) product naming and reclassification endpoints. Writes: Makes outbound HTTP POST requests to the configured LLM API endpoint; does not write to SQLite.internal/notify: Channel-agnostic notification dispatcher, VAPID Web Push channel (RFC 8291/8292), per-user digest preferences and target store, and daily digest scheduler. Writes: Persists VAPID keys insettings, managesnotification_preferencesandnotification_targetsin SQLite, and sends outbound HTTPS POST requests to vendor Web Push endpoints.internal/printer: Pure-Go structured label layout engine, 1-bit monochrome bitmap and single-page PDF renderer, and pluggable printer drivers (ipp_zpl,raw_tcp_zpl,ipp_pdf,brother_ql_tcp,tspl_tcp,browser_pdf). Writes: Sends outbound print jobs to configured LAN printer endpoints; does not write to SQLite.internal/printer/fonts: Embedded open-source sans-serif TrueType font loaders (Go RegularandGo Bold) for pure-Go label rasterization. Writes: Read-only embedded font assets.internal/printer/templates: Embedded default structured JSON label templates (item.json,product.json,location.json). Writes: Read-only embedded assets rendered byinternal/printer.internal/upc: Client for OpenFoodFacts retail barcode lookup. Writes: Read-only outbound HTTP GET requests to OpenFoodFacts; does not write to SQLite.