Alder

Architecture

How a visit becomes a balance

Alder is a multi-tenant loyalty workspace. Each merchant owns a program, locations, guests, rewards, and a ledger. Platform admin sees tenants and plans, not the cashier.

System

CounterRule engineMember cardMerchant tenant storeguests · rewards · ledger · offers

The browser keeps the workspace in local storage. Prisma describes the same tables so a database can replace the store without changing the product shape.

Tenants

  • Super Admin

    Merchants, plans, platform activity. No guest editor.

  • Merchant

    One business. Program, team, rewards, offers, analytics.

  • Staff

    Same business, counter only. No billing or program edits.

  • Customer

    One card at one café. Redeem and read offers.

Business flow

01

Scan

The guest opens /join/{slug} from the counter QR.

02

Enroll

A customer record is created inside that merchant only.

03

Visit

Staff posts spend. The rule engine adds points or a stamp, plus any live offer.

04

Redeem

If the balance covers an active reward, the ledger deducts the cost.

Data flow

Write

Enroll, visit, redeem, and settings call the in-memory store, then persist JSON locally.

Scope

Every guest, reward, and transaction carries a merchant id. Queries filter on it.

Read

Dashboards derive totals from the same ledger. Nothing is fetched from a network API.

Rule engine

  1. 1

    If the merchant is paused, or the guest is paused, the visit is rejected.

  2. 2

    Points model: floor(spend × points per dollar) + points per visit.

  3. 3

    Stamp model: one stamp per visit, regardless of spend.

  4. 4

    Each live campaign whose dates include today adds its bonus points or stamps.

  5. 5

    Redemption requires an active reward and a balance at least equal to its cost. The ledger stores a negative line.

  6. 6

    Void reverses the line. A posted line cannot be deleted until it is void.

Visit flowchart

LookupActive?ModelOfferLedger