This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Tiddlyhost (https://tiddlyhost.com/) is a hosting service for TiddlyWiki. This is the source code for the production application.
As well as TiddlyWiki, the following "TiddlyWiki-like" single-page wikis can also be created and hosted on Tiddlyhost:
- TiddlyWiki Classic (legacy)
- FeatherWiki
- Siteleteer
Tiddlyhost is a Ruby on Rails application that hosts TiddlyWiki sites with Docker-based development. The project structure includes:
rails/- Main Rails applicationdocker/- Docker configuration and volumesansible/- Deployment automationbin/- Utility scripts
# Build the development Docker image
make build-base
# Initialize Rails (sets up database, installs gems)
make rails-init
# Start the full development stack with SSL
make start# Run the full test suite
make test
# Or alternatively:
make run-tests
# Run a single test file
make onetest TEST=test/models/site_test.rb
# Run linting
make delint
# This runs both:
make haml-lint-with-todo # HAML linting
make rubocop # Ruby lintingThe local dev nginx configs in docker/nginx-conf/ are generated from the ansible Jinja2 templates in ansible/playbooks/templates/docker/nginx-conf/. Always edit the .j2 templates, then run:
make local-nginx # Regenerates docker/nginx-conf/ from templatesThe dev files are gitignored — the templates are the source of truth.
# Shell into running container
make join
# Rails console
make console
# Database migration
make db-migrate
# Clear logs and temp files
make log-clear
make tmp-clear# Install Ruby gems
make bundle-install
# Update gems
make bundle-update
# Install JavaScript packages
make yarn-install
# Update JavaScript packages
make yarn-upgradeSite- TiddlyWiki sites hosted on tiddlyhost.com with version historyTspotSite- Legacy Tiddlyspot.com sites that can be claimedUser- User accounts with Devise authenticationEmpty- Template sites (TiddlyWiki, Feather Wiki, etc.)
TiddlywikiController- Serves and saves TiddlyWiki sitesSitesController- Site management (CRUD, history, downloads)TiddlyspotController- Legacy Tiddlyspot.com compatibilityHubController+ variants - Browse/explore public sites
The app uses domain-based routing constraints:
tiddlyhost.com- Main application interfacesubdomain.tiddlyhost.com- Individual TiddlyWiki sitessubdomain.tiddlyspot.com- Legacy Tiddlyspot sites
- Uses Active Storage for file attachments
- Multiple storage services:
local1,local2,thumbs2, etc. - Site content stored as blobs with version history
- Thumbnails generated via background jobs
Settings are managed through rails/config/settings.yml and can be overridden by settings_local.yml. Key settings include:
- Host configuration for multi-domain setup
- Feature flags (e.g.,
tiddlyspot_enabled) - Storage service mappings
- Subscription plan details
Encrypted secrets are managed via Rails credentials:
# View/edit secrets
make secretsThe development environment runs in Docker containers managed using docker-compose:
app- Rails applicationdb- PostgreSQL databaseweb- Reverse proxy with SSLjobs- Rails background jobscache- Memcached
Use wildcard DNS entries in /etc/hosts for subdomain testing:
127.0.0.1 tiddlyhost.local
127.0.0.1 *.tiddlyhost.local
Uses Delayed Job for:
- Thumbnail generation (
GenerateThumbnailJob) - Attachment cleanup (
PruneAttachmentsJob)
- TiddlyWiki content is stored as compressed HTML files in Active Storage blobs
- The app supports multiple TiddlyWiki versions via "empties" (templates)
- Save history allows users to view/restore previous versions
- Subscription management via Stripe integration
- Legacy Tiddlyspot compatibility maintains existing site URLs