Skip to main content

Architecture

Presentum separates presentation logic into five clear layers:
1

Fetch candidates

Your app fetches presentations from Firebase Remote Config, APIs, or local sources.
2

Feed to engine

Convert to items and feed to Presentum using setCandidates or setCandidatesWithDiff.
3

Guards process

Engine runs all guards in sequence to determine eligibility, apply rules, and update state.
4

State committed

New state is committed and observers are notified.
5

Outlets rebuild

Outlets watching affected surfaces rebuild with new active items.
6

User interacts

User dismisses or converts, which records to storage and may trigger guard re-evaluation.

The five layers

1. Payloads

Domain data - campaigns, tips, app updates

2. Guards

Business logic - eligibility, targeting, scheduling

3. Engine

State management - slots, transitions, history

4. Storage

Persistence - impressions, dismissals, conversions

5. Outlets

UI rendering - widgets without business logic

Key concepts

Surfaces

Where presentations appear. Named locations in your UI:
Learn more ->

Payloads

What you show. Your domain objects:
Learn more ->

Items

Concrete decisions: “show this payload with this option on this surface”:
Learn more ->

Slots

Each surface has one slot containing:
  • Active item - Currently displayed (or null)
  • Queue - FIFO list of items waiting
Learn more ->

Guards

Business logic that decides what gets shown:
Learn more ->

Data flow

1

Fetch candidates

Your app fetches presentations from Firebase, APIs, or local sources.
2

Feed to engine

Convert to items and feed to Presentum.
3

Guards process

Engine runs all guards to determine eligibility.
4

State committed

New state is committed and observers notified.
5

Outlets rebuild

Outlets watching affected surfaces rebuild.
6

User interacts

User dismisses or converts, triggering new guard evaluation.

Production example

Here’s how a production app structures everything:
See full implementation ->

Next steps

Surfaces

Define UI locations

Payloads

Create domain objects

Guards

Build eligibility logic

Outlets

Render presentations