Skip to Content
Architecture

Architecture

An overview of how Pluma is structured, how flag evaluation works, and how the components fit together.

Two API planes

Pluma exposes two separate API surfaces:

  • Admin API (/api/v1/*) — CRUD operations for flags, environments, projects, and SDK tokens. Authenticated via session (web UI).
  • SDK API (/sdk/v1/*) — read-only flag snapshot endpoint consumed by @pluma-flags/sdk. Authenticated via Bearer SDK token scoped to a project and environment.

Tech stack

ComponentTechnology
API serverFastify
Web UINext.js 16
DatabasePostgreSQL + Prisma
Client SDKTypeScript (@pluma-flags/sdk)
DocumentationNextra 4

How flag evaluation works

  1. The SDK fetches a flag snapshot from the SDK API.
  2. The snapshot is cached locally (default 30 s TTL) — no round-trip per flag check.
  3. Each flag is evaluated locally by the SDK using the snapshot data.
  4. Evaluation supports per-subject targeting (allow/deny lists + deterministic rollout) and parent/child flag hierarchies.

See Targeting & Caching for the full evaluation precedence and caching details.

Monorepo structure

PathDescription
apps/apiFastify API server
apps/appNext.js 16 UI
apps/docsNextra documentation site
packages/sdknpm SDK (@pluma-flags/sdk)
packages/dbPrisma schema + migrations
packages/typesShared TypeScript types

Authentication

  • Admin (web UI) — session-based authentication. Users log in through the web interface to manage flags, environments, and SDK tokens.
  • SDK — Bearer token authentication. Each SDK token is scoped to a specific project and environment. Tokens are created in the Pluma UI under Organisation → API Keys.
Last updated on