Writebook (37signals)
ONCE brand publishing tool โ textbook for delegated_type and edit history management
GitHub: projectcues/writebook (ONCE official code)
Writebook is a web-based publishing tool released under 37signals' ONCE brand. You can write books, manage chapters, and publish online.
Please refer to the Korean version for the detailed directory structure and pattern analysis, including: delegated_type for polymorphic content management (Page/Section/Picture), Edit records for tracking edit history, Access records for permission management (reader/editor), DB-based Session model, the same Authentication concern pattern as Campfire, and CRUD mapping patterns for Publication, Bookmark, and Move resources.
Architecture Diagram
delegated_type Structure (ERD)
Leaf serves as common interface (title, position, status)
State = Record (Edit / Access / Session)
Browse history with previous / next
Authorization without Pundit
Session management without Devise
Authentication Flow (Same as Campfire)
Campfire vs Writebook
Key Points
Open projectcues/writebook repository on GitHub
config/routes.rb โ check resource structure and nesting patterns
app/models/leaf.rb โ understand delegated_type pattern
app/models/leafable.rb โ analyze polymorphic interface module
app/models/edit.rb โ check edit history management pattern
app/models/access.rb โ check access permission record pattern
app/models/session.rb โ check DB-based session management
app/controllers/concerns/authentication.rb โ compare with Campfire pattern
app/controllers/books/publications_controller.rb โ check CRUD mapping
Pros
- ✓ Learn real-world delegated_type pattern usage
- ✓ See edit history management implemented as records
- ✓ Understand consistent 37signals patterns by comparing with Campfire
- ✓ Access control implemented as records (without Pundit)
- ✓ Production implementation of DB-based session management
- ✓ Elegant slug-based URL routing implementation
Cons
- ✗ Uses Resque+Redis โ older stack, not Solid Queue
- ✗ No Action Cable โ Campfire is better for learning real-time features
- ✗ Writebook is a relatively simple app (CRUD-centric)
- ✗ Private ONCE license โ fork/modification restrictions