chronicle

module
v0.0.0-...-255d4e7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2026 License: AGPL-3.0

README

Chronicle

A self-hosted worldbuilding platform for tabletop RPG campaigns.

Chronicle gives game masters and players a shared space to build worlds, track lore, manage calendars, visualize timelines, and run campaigns — all on your own server, with no paywall, no forced public content, and full control over your data.

Screenshots coming soon — Chronicle features a rich entity editor, interactive calendar, D3.js timeline, Leaflet.js map viewer, drag-and-drop page layouts, and customizable dashboards.


Why Chronicle?

Chronicle is purpose-built for tabletop RPGs, open source, and designed to be self-hosted from day one. No paywalls, no forced public content, no vendor lock-in — your world, your server, your data.


Features

Worldbuilding
  • Pages & Categories — Create any content type (characters, locations, factions, items, etc.) with custom categories and dynamic field schemas
  • Rich Text Editor — TipTap-powered WYSIWYG with @mentions, backlinks, GM secrets, and an insert menu
  • Relations — Bi-directional entity relationships with typed connections ("is spouse of", "leads", "enemy of")
  • Entity Hierarchy — Parent/child nesting with tree views and breadcrumb navigation
  • Tags — Color-coded tags with DM-only visibility controls
  • Custom Attributes — Per-category field templates (text, number, select, checkbox, URL) with per-entity overrides
  • Drag-and-Drop Page Layouts — Visual layout editor for entity profile pages — no other tool has this
Calendar & Time
  • Custom Calendars — Define months, weekdays, moons, seasons, eras, and leap year rules for any fantasy calendar system
  • Real-Life Sync — Optional Gregorian calendar mode synced to real-world dates
  • Events — Single-day, multi-day, and recurring events with visibility controls, entity linking, and category icons
  • Import/Export — Import from Simple Calendar, Calendaria, Fantasy-Calendar, or Chronicle JSON
Timeline
  • Interactive D3 Visualization — SVG-rendered timeline with zoom, pan, and minimap
  • Eras — Named time periods with colored bars spanning year ranges
  • Standalone Events — Calendar-free events for campaigns without formal calendars
  • Event Clustering — Overlapping events automatically group for readability
Maps
  • Leaflet.js Maps — Upload custom map images and place interactive markers
  • Entity-Linked Markers — Pin entities to map locations with click-through navigation
  • DM-Only Markers — Hide map pins from players
Game Sessions
  • Session Scheduling — Plan game nights with date, location, and status tracking
  • RSVP — Going / Maybe / Can't buttons with attendee tracking
  • Entity Linking — Tag which pages were relevant to each session
Campaign Management
  • Roles — Owner (GM), Scribe (co-GM), and Player roles with granular permissions
  • Customizable Dashboards — Drag-and-drop dashboard blocks (recent pages, calendar preview, timeline, maps, stats)
  • Customizable Sidebar — Reorder, rename, and add custom navigation links
  • Category Dashboards — Per-category landing pages with their own layouts
  • Public Campaigns — Optionally make campaigns publicly viewable
  • "View as Player" — Toggle to see your campaign as players see it
Player Notes
  • Per-Entity Notes — Private notes attached to any page
  • Shared Notes — Share notes with the campaign (with edit locking)
  • Version History — View and restore previous note versions
  • Checklists — Quick checklist blocks within notes
REST API
  • API v1 — Full CRUD for entities, entity types, tags, relations, calendar, events, maps, drawings, tokens, layers, fog, media, and notes
  • API Key Auth — Per-campaign API keys with read/write/sync permissions and device fingerprint binding
  • Addon Discovery — External tools can detect which features are enabled per campaign
  • Bulk Operations — Bulk tag assignment and entity type reassignment (up to 200 per request)
  • Sync Protocol — Sync mappings, WebSocket real-time events, and bidirectional Foundry VTT integration
Admin & Security
  • Startup Health Checks — Automatic migration validation, schema verification, DB connectivity checks, and security audit on every server start
  • Pre-Migration Backups — Optional mysqldump with gzip before schema changes, with automatic rotation
  • User Management — Admin dashboard for users, campaigns, storage, and security
  • Audit Logging — Full activity trail for all campaign mutations
  • Rate Limiting — Per-route rate limits on auth and upload endpoints
  • Session Security — Redis-backed sessions with force-logout and session termination
  • Database TLS — Configurable TLS encryption for database connections (DB_TLS_MODE)
  • IDOR Protection — Campaign-scoped access checks on every route
  • Argon2id — Password hashing with modern algorithm

What's in v0.1

  • Worldbuilding with custom entity types and rich text editor
  • Interactive calendar with events, seasons, moons, and eras
  • Map viewer with markers, drawings, and fog of war
  • Timeline visualization
  • Session planning with RSVP tracking
  • Bestiary with community sharing and ratings
  • Full REST API for integrations

Screenshots

Screenshots coming soon — see the feature list above for what Chronicle offers today.


Quick Start

For production deployment, backups, upgrades, and rollback procedures, see docs/deployment.md.

# Clone the repository
git clone https://github.com/chronicle-app/chronicle.git
cd chronicle

# Set required secrets
export SECRET_KEY=$(openssl rand -base64 32)
export DB_PASSWORD=your-secure-password
export MYSQL_ROOT_PASSWORD=your-root-password

# Start the full stack
docker compose up -d

# Chronicle is now running at http://localhost:8080
# The first user to register becomes the site admin.
From Source

Prerequisites: Go 1.24+, Node.js (for Tailwind), MariaDB 10.11+, Redis 7+

# Clone and setup
git clone https://github.com/chronicle-app/chronicle.git
cd chronicle
cp .env.example .env       # Edit with your database credentials

# Start dependencies
make docker-up              # MariaDB + Redis via Docker

# Generate templates and CSS
make generate               # Runs templ generate + tailwindcss

# Run the server
make dev                    # Hot reload with air
# or
make run                    # Direct run

Database migrations run automatically on startup. The first user to register becomes the site admin.


Development

make help            # Show all available commands
make dev             # Start dev server with hot reload (air)
make build           # Production binary build
make test            # Run all tests
make test-unit       # Unit tests only
make lint            # Run golangci-lint
make generate        # Regenerate Templ + Tailwind
make docker-up       # Start MariaDB + Redis
make docker-down     # Stop containers
Project Structure
cmd/server/          # Application entrypoint
internal/
  plugins/           # Feature apps (auth, campaigns, entities, calendar, ...)
  systems/           # Game system content packs (installed via package manager)
  widgets/           # Reusable UI components (editor, tags, relations, notes, ...)
  templates/         # Templ layouts and shared components
  middleware/        # HTTP middleware (auth, CSRF, logging, recovery)
  apperror/          # Domain error types
  config/            # Environment configuration
  database/          # Database connection and helpers
static/
  js/                # Client-side JavaScript (boot.js, widgets, search, shortcuts)
  css/               # Tailwind input + compiled output
  img/               # Static assets
db/migrations/       # Sequential SQL migration files
Architecture

Chronicle uses a three-tier extension architecture:

Tier Purpose Example
Plugin Feature app with handler/service/repo/templates auth, campaigns, entities, calendar, maps
System Game system content pack (installed via package manager) drawsteel, dnd5e, pathfinder2e
Widget Reusable UI component (self-contained JS + API) editor, tags, relations, notes

Request flow: Router → Middleware → Handler → Service → Repository → MariaDB

See .ai/architecture.md for the full architecture document.


Tech Stack

Layer Technology
Backend Go 1.24, Echo v4
Templates Templ (type-safe Go templates)
Frontend HTMX, Alpine.js
Editor TipTap (ProseMirror-based)
CSS Tailwind CSS
Timeline D3.js
Maps Leaflet.js
Database MariaDB 10.11
Cache/Sessions Redis 7
Deployment Docker, multi-stage builds

Inspiration & Credits

Chronicle was developed with reference to several existing worldbuilding and note-taking platforms in the TTRPG space. We're grateful to the broader community for establishing patterns and conventions that inform what users expect from tools like these.

Notable platforms we studied during development include World Anvil, Kanka, LegendKeeper, and Obsidian. All design and code in Chronicle is original work.


Contributing

Chronicle is in active early development (pre-alpha). Contribution guidelines will be established as the project matures. In the meantime, feel free to open issues for bug reports or feature suggestions.


License

This project is licensed under the GNU Affero General Public License v3.0.

Directories

Path Synopsis
cmd
foundry-error-catalog command
foundry-error-catalog regenerates the canonical JSON artifact describing every error code the foundry_vtt plugin can emit.
foundry-error-catalog regenerates the canonical JSON artifact describing every error code the foundry_vtt plugin can emit.
server command
Package main is the entry point for the Chronicle server.
Package main is the entry point for the Chronicle server.
internal
app
Package app is the application bootstrap and dependency injection root.
Package app is the application bootstrap and dependency injection root.
apperror
Package apperror provides domain-specific error types for Chronicle.
Package apperror provides domain-specific error types for Chronicle.
concurrency
Package concurrency provides optimistic-concurrency primitives shared across plugins.
Package concurrency provides optimistic-concurrency primitives shared across plugins.
config
Package config handles loading application configuration from environment variables.
Package config handles loading application configuration from environment variables.
database
Package database — healthcheck.go Comprehensive startup health checks that run after migrations to catch configuration, schema, and security issues before the server accepts traffic.
Package database — healthcheck.go Comprehensive startup health checks that run after migrations to catch configuration, schema, and security issues before the server accepts traffic.
extensions
Package extensions — adapters.go bridges external service interfaces to the applier's narrower interfaces.
Package extensions — adapters.go bridges external service interfaces to the applier's narrower interfaces.
middleware
Package middleware provides HTTP middleware for the Chronicle Echo server.
Package middleware provides HTTP middleware for the Chronicle Echo server.
permissions
Package permissions provides shared role constants and permission checks for use across services and repositories that cannot import the campaigns package due to circular dependency constraints.
Package permissions provides shared role constants and permission checks for use across services and repositories that cannot import the campaigns package due to circular dependency constraints.
plugins/addons
Package addons manages the extension framework — installable addons (plugins, systems, widgets, integrations) with per-campaign enable/disable controls.
Package addons manages the extension framework — installable addons (plugins, systems, widgets, integrations) with per-campaign enable/disable controls.
plugins/admin
Package admin — database_health.go defines the admin-local contracts the Database page's Health and Backups tabs render.
Package admin — database_health.go defines the admin-local contracts the Database page's Health and Backups tabs render.
plugins/ai_workspace/aiexport
Package aiexport renders a campaign's owner-scoped content into a single markdown document suitable for pasting into AI tools (Claude, ChatGPT, NotebookLM, etc).
Package aiexport renders a campaign's owner-scoped content into a single markdown document suitable for pasting into AI tools (Claude, ChatGPT, NotebookLM, etc).
plugins/ai_workspace/importer
Package importer parses AI-generated markdown into per-page ParsedPage structs, classifies each (full / defaults / conflict / new category / parse error), and prepares the review-screen data the operator inspects before committing.
Package importer parses AI-generated markdown into per-page ParsedPage structs, classifies each (full / defaults / conflict / new category / parse error), and prepares the review-screen data the operator inspects before committing.
plugins/ai_workspace/importer/htmlconv
Package htmlconv converts sanitized HTML to a Chronicle-shaped ProseMirror JSON document.
Package htmlconv converts sanitized HTML to a Chronicle-shaped ProseMirror JSON document.
plugins/ai_workspace/prompt
Package prompt builds the "Copy AI Prompt" output for the AI Workspace settings tab.
Package prompt builds the "Copy AI Prompt" output for the AI Workspace settings tab.
plugins/armory
handler.go provides HTTP endpoints for the Armory gallery.
handler.go provides HTTP endpoints for the Armory gallery.
plugins/audit
Package audit provides an audit log plugin that records user actions within campaigns.
Package audit provides an audit log plugin that records user actions within campaigns.
plugins/auth
loghash provides email hashing for debug-log correlation.
loghash provides email hashing for debug-log correlation.
plugins/backup
Package backup provides the admin-facing UI for triggering whole-database backups and inspecting prior runs.
Package backup provides the admin-facing UI for triggering whole-database backups and inspecting prior runs.
plugins/bestiary
Package bestiary provides the Community Bestiary plugin for sharing homebrew creatures across a Chronicle instance.
Package bestiary provides the Community Bestiary plugin for sharing homebrew creatures across a Chronicle instance.
plugins/calendar
api_errors.go — typed errors for the public Foundry-facing calendar API.
api_errors.go — typed errors for the public Foundry-facing calendar API.
plugins/campaigns
Package campaigns — export.go defines the JSON structure for campaign exports.
Package campaigns — export.go defines the JSON structure for campaign exports.
plugins/designlab
Package designlab provides the admin-only "Design Lab" page.
Package designlab provides the admin-only "Design Lab" page.
plugins/entities
block_registry.go provides a self-registering system for entity page block types.
block_registry.go provides a self-registering system for entity page block types.
plugins/foundry_vtt
Package foundry_vtt is the Foundry-VTT-specific sub-plugin that extends the generic packages plugin via the PostInstallHook extension point (added in C-FMC-5a).
Package foundry_vtt is the Foundry-VTT-specific sub-plugin that extends the generic packages plugin via the PostInstallHook extension point (added in C-FMC-5a).
plugins/maps
Package maps provides the interactive maps addon for campaigns.
Package maps provides the interactive maps addon for campaigns.
plugins/media
Package media manages file uploads, storage, and serving for Chronicle.
Package media manages file uploads, storage, and serving for Chronicle.
plugins/npcs
handler.go provides HTTP endpoints for the NPC gallery.
handler.go provides HTTP endpoints for the NPC gallery.
plugins/packages
Package packages provides the package manager plugin for Chronicle.
Package packages provides the package manager plugin for Chronicle.
plugins/restore
Package restore provides the admin-facing UI for restoring a previous backup.
Package restore provides the admin-facing UI for restoring a previous backup.
plugins/sessions
Package sessions provides the game session tracking addon for campaigns.
Package sessions provides the game session tracking addon for campaigns.
plugins/settings
Package settings manages site-wide configuration and storage limit overrides.
Package settings manages site-wide configuration and storage limit overrides.
plugins/smtp
Package smtp provides outbound email functionality for Chronicle.
Package smtp provides outbound email functionality for Chronicle.
plugins/syncapi
egress_sanitize.go — defense-in-depth sanitization on /api/v1/* response payloads.
egress_sanitize.go — defense-in-depth sanitization on /api/v1/* response payloads.
plugins/timeline
Package timeline provides the timeline addon for campaigns.
Package timeline provides the timeline addon for campaigns.
plugins/widgetbindings
block_host.go — DOM-id helpers for the re-render seam (C-WIDGET-BINDING-P4b).
block_host.go — DOM-id helpers for the re-render seam (C-WIDGET-BINDING-P4b).
sanitize
Package sanitize provides HTML sanitization for user-generated content.
Package sanitize provides HTML sanitization for user-generated content.
systems
campaign_handler.go adds HTTP endpoints for campaign owners to upload, view, and remove custom game systems.
campaign_handler.go adds HTTP endpoints for campaign owners to upload, view, and remove custom game systems.
templates/components
Package components provides reusable Templ UI components shared across plugins.
Package components provides reusable Templ UI components shared across plugins.
templates/layouts
assets.go — cache-busted static asset URLs (C-CAL-MOBILE-VIEWS-FIX, absorbing the long-planned C-ASSET-VERSIONING).
assets.go — cache-busted static asset URLs (C-CAL-MOBILE-VIEWS-FIX, absorbing the long-planned C-ASSET-VERSIONING).
timeutil
Package timeutil provides DST-correct conversions between zone-local wall-clock times and absolute instants, plus helpers for projecting a recurring weekly pattern onto a concrete calendar week in a viewer's zone.
Package timeutil provides DST-correct conversions between zone-local wall-clock times and absolute instants, plus helpers for projecting a recurring weekly pattern onto a concrete calendar week in a viewer's zone.
websocket
Package websocket provides a campaign-scoped WebSocket hub for real-time bidirectional communication between Chronicle and external clients (Foundry VTT).
Package websocket provides a campaign-scoped WebSocket hub for real-time bidirectional communication between Chronicle and external clients (Foundry VTT).
widgets/calendar_block
Package calendar_block renders the calendar Block: one component, four zones (Nameplate / Instrument / docked Ledger / Shelf), size class taken from HOST width and density taken from MEASURED COLUMN width, both in CSS container queries rather than Go.
Package calendar_block renders the calendar Block: one component, four zones (Nameplate / Instrument / docked Ledger / Shelf), size class taken from HOST width and density taken from MEASURED COLUMN width, both in CSS container queries rather than Go.
widgets/calendar_v2
Package calendar_v2 provides reusable widget components shared by the calendar plugin's V2 surface and any downstream consumer (Chronicle-DnD-5.5e, Chronicle-Draw-Steel, AI Workspace event imports).
Package calendar_v2 provides reusable widget components shared by the calendar plugin's V2 surface and any downstream consumer (Chronicle-DnD-5.5e, Chronicle-Draw-Steel, AI Workspace event imports).
widgets/entity_notes
Package entity_notes implements the player-facing entity-page notes widget.
Package entity_notes implements the player-facing entity-page notes widget.
widgets/notes
Package notes implements the player notes widget for Chronicle.
Package notes implements the player notes widget for Chronicle.
widgets/posts
Package posts implements the entity posts widget for Chronicle.
Package posts implements the entity posts widget for Chronicle.
widgets/relations
Package relations implements the entity relations widget for Chronicle.
Package relations implements the entity relations widget for Chronicle.
widgets/tags
Package tags implements the tags widget for Chronicle.
Package tags implements the tags widget for Chronicle.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL