This chapter provides a high-level overview of the Folio Rails Engine architecture, including its main models, relationships, and key data flows. Use this as a reference for understanding how the engine is structured and how its core components interact.
Folio is a modular CMS engine for Ruby on Rails, designed for extensibility and maintainability. It provides:
- A flexible content model based on Atoms and Pages
- A modern admin interface (Console)
- File and media management
- User and site management
- Extensible ViewComponent-based UI
Below is a simplified diagram of the main models and their relationships in Folio:
classDiagram
Site <|-- Page
Site <|-- User
Page "1" o-- "*" Atom : has many
Page "1" o-- "*" FilePlacement : has many
FilePlacement "*" o-- "1" File : belongs to
User <|-- SiteUserLink
Page o-- Menu : navigation
File <|-- MediaFile
User <|-- NewsletterSubscription
Legend:
Site— Represents a website or subsitePage— Content page, composed of Atoms and FilesAtom— Content block (text, image, video, etc.)File— Uploaded file or media assetUser— User accountMenu— Navigation structureFilePlacement— Placement of a file on a pageNewsletterSubscription— Newsletter signupSiteUserLink— User-to-site relationship
- Pages are composed of Atoms (content blocks) and Files (media)
- Atoms are rendered using ViewComponents for flexibility and reusability
- Menus and navigation are managed via Menu and MenuItem models
- Files are uploaded via the admin console or public forms
- FilePlacements associate files with pages or atoms
- Metadata is extracted and stored for each file
- Users can belong to one or more Sites via SiteUserLink
- User roles and permissions are managed in the admin console
For more details, see the individual chapters linked above. This architecture overview will be updated as the documentation evolves.