How cammelo/sbp works
SBP serves a Git-backed blog: visitors request the README homepage or Markdown posts, which are rendered through repository data into Jinja templates; a protected sync endpoint handles repository updates. A push workflow can initiate sync, which pulls Git changes, reconciles post metadata and the file tree, then commits and pushes the SQLite database. Initialization clones the target repository and prepares the database. Source excerpts show the principal routes and sync implementation; template/static serving and several setup details are documented but their target-repository files are not part of this repository.
Main entry points: repository.py Blog repository · main.py HTTP routes · init.py Repository initializer · database.py SQLite session
Components 17
Blog serving
- HTTP routes
src/sbp/main.py - Blog repository
src/sbp/repository.py - Markdown renderer
src/sbp/markdown.py - Blog templates
- Static assets
Repository sync
- Sync handler
src/sbp/main.py - Post reconciliation
src/sbp/repository.py - Head and tree state
src/sbp/repository.py
Configuration and state
- Settings
src/sbp/config.py - SQLite session
src/sbp/database.py - Post and head records
src/sbp/models.py - Sync logging
src/sbp/logs.py
Application startup
- FastAPI app
src/sbp/__init__.py - Repository initializer
src/sbp/init.py
Other components
- Blog visitor
- Push workflow
- Git remote
Connections 20
- Blog visitor → HTTP routes: requests pages
src/sbp/main.py - HTTP routes → Blog repository: loads posts
src/sbp/main.py - Blog repository → Markdown renderer: converts Markdown
src/sbp/repository.py - HTTP routes → Blog templates: renders page
README.md - HTTP routes → Static assets: serves assets
src/sbp/main.py - HTTP routes → Settings: checks token
src/sbp/main.py - Push workflow → Sync handler: calls sync endpoint
README.md - Sync handler → Blog repository: schedules sync
src/sbp/main.py - Blog repository → Git remote: pulls and pushes
src/sbp/repository.py - Blog repository → Post reconciliation: reconciles changes
src/sbp/repository.py - Blog repository → Head and tree state: updates state
src/sbp/repository.py - Post reconciliation → SQLite session: uses sessions
src/sbp/repository.py - Head and tree state → Post and head records: reads and updates
src/sbp/repository.py - Post reconciliation → Post and head records: stores post metadata
src/sbp/repository.py - SQLite session → Settings: gets database path
src/sbp/database.py - Blog repository → Sync logging: logs sync
src/sbp/repository.py - Repository initializer → Blog repository: clones and syncs
src/sbp/init.py - Repository initializer → SQLite session: creates schema
src/sbp/init.py - Repository initializer → Settings: reads repository settings
src/sbp/init.py - FastAPI app → HTTP routes: registers routes
src/sbp/__init__.py