Skip to content

Architecture and concepts ​

This page is the platform view. For blocks, code releases and embedding seen from the site's code and from an app, read Concepts on the SDK docs site.

For a detailed walkthrough aimed at Drupal and integration developers, read How Foliwake works: source ingestion, S3 records, URL resolution, publication, caching and rollback.

Publishing and delivery are different paths ​

Publication turns selected content and frontend code into retained releases. A visitor request reads those releases; it does not fetch Markdown or run a Git checkout.

Content sources (local Markdown, Git on GitHub or GitLab, Google Drive Markdown, Google Docs, Drupal; several per site) and the site's blocks, styles and templates in Git go into the Foliwake server. It syncs, prepares a preview, publishes the pages you select and releases new code into your S3 or R2 bucket: published versions of the site and code, and pictures. The delivery service, in Docker or as a Cloudflare Worker, reads only that bucket. A CDN or cache (Cloudflare, Varnish or your CDN), cleared for the changed pages after each publication, serves browsers and your app, which shows the pages inside its own interface.Content sources (local Markdown, Git on GitHub or GitLab, Google Drive Markdown, Google Docs, Drupal; several per site) and the site's blocks, styles and templates in Git go into the Foliwake server. It syncs, prepares a preview, publishes the pages you select and releases new code into your S3 or R2 bucket: published versions of the site and code, and pictures. The delivery service, in Docker or as a Cloudflare Worker, reads only that bucket. A CDN or cache (Cloudflare, Varnish or your CDN), cleared for the changed pages after each publication, serves browsers and your app, which shows the pages inside its own interface.

Foliwake keeps three inputs distinct: Markdown pages and their local images, frontend JavaScript/CSS, and publication state. A page has a stable id for commands and a path for visitors. Its HTML is validated and rendered from Markdown and supported component blocks.

The local development server reads working files. A preview saves valid drafts to a separate channel; public access requires protection configured by the operator. Publishing selects page IDs and creates an immutable content release in an S3-compatible bucket. The live delivery service reads the bucket's current release; it does not read working files. CDNs call it the origin. Unpublished edits stay drafts.

Local Markdown, Git Markdown, Google Docs, Drupal articles and Markdown in a Google Drive folder are available as sources. Varnish is the supported cache; Cloudflare parts (purge by tag, a Worker delivery service) are available in the code, and other CDN adapters are planned. The next diagram shows requests travelling in the opposite direction, from visitors toward storage.

What serves a visitor? ​

A browser or your app asks the CDN or cache; on a miss it asks the delivery service (Docker or a Cloudflare Worker), which reads one published version from your bucket and puts the stored page into the site's frame with that version's code. The live site serves whole pages, pages for your app to show in its own interface, code and pictures. After a publication the changed pages are cleared from the cache; code and pictures never change. Sources, Git and the Foliwake server are not on this path.A browser or your app asks the CDN or cache; on a miss it asks the delivery service (Docker or a Cloudflare Worker), which reads one published version from your bucket and puts the stored page into the site's frame with that version's code. The live site serves whole pages, pages for your app to show in its own interface, code and pictures. After a publication the changed pages are cleared from the cache; code and pictures never change. Sources, Git and the Foliwake server are not on this path.

On a cache miss, the cache asks the delivery service for the page. The Node.js delivery service resolves the selected release, reads its content and supplies links to that release's frontend assets. Responses return through the cache to the visitor. Foliwake does not push every stored file into a CDN in advance.

refs/live.json is the small pointer that selects the current content and code releases. Publication uploads immutable files first and then changes that pointer with a conditional write. Preview uses a separate refs/preview.json.

Content and code have separate release controls ​

Frontend code has its own release. Foliwake captures code from a clean Git commit of the configured frontend repository. New code goes live through the preview: every page is rebuilt against it, you review it, and Release makes code and pages live as one site release. Publishing selected pages keeps the live code. A branch preview pairs the saved preview content with code from that branch. See roll out frontend code and branch previews.

Content: edit in any source, sync and review the preview, select the pages and publish them; the rest stay drafts and the live code is kept. Code: push to main, the code is saved as a fixed version and every page is rebuilt in the preview; the release, automatic when the checks pass or by hand, makes pages and code live together. Roll back one step returns to the version before. A pushed branch gets its own preview address with that code and the preview content, and never goes live.Content: edit in any source, sync and review the preview, select the pages and publish them; the rest stay drafts and the live code is kept. Code: push to main, the code is saved as a fixed version and every page is rebuilt in the preview; the release, automatic when the checks pass or by hand, makes pages and code live together. Roll back one step returns to the version before. A pushed branch gets its own preview address with that code and the preview content, and never goes live.

The main preview address serves the content and code pair recorded in that preview. It does not silently switch to the default development branch.

All frontend branch previews share the saved preview content; they select different code releases. They are not separate content branches. Cached or already-open pages retain links to their versioned code assets.

code rollback restores code while keeping current content. A full release rollback restores the earlier content and code pair. There is no page-level rollback yet.

State and recovery ​

The configured stateDir holds workflow state such as pending operations and cache invalidations. Keep backups of both the bucket and the state directory, plus your source files. See configuration and storage before changing either location.

The engine runs from this checkout as a TypeScript build. Site components remain plain JavaScript and CSS. The public documentation site you are reading is a separate VitePress project; it is not Foliwake's site runtime.