There are two separate directories: the CMS source (this repo) and user sites.
Users never edit these files. This is the Publr core.
publr/
├── build.zig # Zig build configuration
│
├── src/
│ ├── main.zig # Entry point, CLI
│ ├── http.zig # HTTP server, router, WebSocket
│ ├── db.zig # SQLite wrapper
│ ├── auth.zig # Sessions, password hashing
│ ├── cms.zig # Content types, entries
│ ├── media.zig # Upload, resize, serve
│ ├── api.zig # JSON API handlers
│ ├── plugin.zig # Plugin interface definition
│ │
│ ├── cli/ # CLI commands
│ │ ├── init.zig # `publr init`
│ │ ├── serve.zig # `publr serve`
│ │ ├── build.zig # `publr build`
│ │ └── plugin.zig # `publr plugin add/remove/list`
│ │
│ ├── templates/ # Admin UI (Zig)
│ │ ├── layout.zig
│ │ ├── entries.zig
│ │ ├── media.zig
│ │ └── types.zig
│ │
│ ├── blocks/ # Phase 2
│ │ ├── block.zig
│ │ ├── paragraph.zig
│ │ ├── heading.zig
│ │ └── image.zig
│ │
│ ├── rtc/ # Phase 3
│ │ ├── websocket.zig
│ │ ├── ot.zig
│ │ └── presence.zig
│ │
│ └── build/ # Phase 4
│ ├── parser.zig # .publr template parser
│ ├── generator.zig # Static site generator
│ └── assets.zig # Asset pipeline
│
├── static/
│ ├── admin.js
│ ├── admin.css
│ └── editor.js # Phase 2: Block editor
│
└── vendor/
├── sqlite3.c
├── sqlite3.h
├── stb_image.h
├── stb_image_resize2.h
└── stb_image_write.h
This is what users create and manage. They use CLI commands, never touch source.
my-site/
├── publr.zon # Site config + plugin list
│
├── plugins/ # Downloaded plugins (like node_modules)
│ ├── code-field/
│ │ ├── plugin.zig
│ │ └── ...
│ └── webhook/
│ └── plugin.zig
│
├── themes/ # Site templates (.publr files)
│ └── default/
│ ├── layouts/
│ │ └── base.publr
│ ├── pages/
│ │ ├── index.publr
│ │ └── [slug].publr
│ └── components/
│ └── header.publr
│
├── data/
│ └── publr.db # SQLite database
│
└── .publr/ # Auto-generated (gitignored)
└── plugins.zig # Generated plugin imports
- src/main.zig — Start here. CLI parsing, server init.
- src/http.zig — Router implementation, middleware pattern.
- src/db.zig — SQLite bindings, query helpers.
- src/templates/entries.zig — Example of HTML generation pattern.
- static/admin.js — All frontend interactivity.