Skip to content

Interactive labs

Reading about architecture is one thing. These small simulators let you push the buttons and watch what the patterns do under stress. They run on made-up data to explain the ideas, and are not measurements from a real system.

Follow one request all the way down

Send an order through the system and see which layer owns each millisecond.

POST /api/v1/orders

Interactive waterfall: see which architectural layer owns each millisecond.

trace POST /orders200 OK
135 ms to respond (195 ms total)
  1. Client · Next.js 1616 ms

    Form validated client-side with Zod matching the backend DTO schema.

  2. Gateway · TLS / Reverse Proxy8 ms

    SSL termination, CORS policy validation, and IP rate limiting applied.

  3. Tenant Scope · AsyncLocalStorage12 ms

    AsyncLocalStorage context scoped; tenant context and organization branding injected.

  4. Auth & RBAC · NestJS18 ms

    JWT verified and 5-level hierarchical RBAC permission guards verified.

  5. Cache · Redis10 ms

    Fast-path lookup for tenant entitlement and active session state.

  6. Database · PostgreSQL / MongoDB22 ms

    Tenant-segregated query execution with indexed multi-tenant constraint.

  7. Vault · Azure Blob / AWS S335 ms

    Time-limited SAS token generated for secure document vault upload.

  8. Audit Trail · Immutable Log14 ms

    Append-only activity audit log recorded with actor and timestamp.

  9. Event Dispatch · Webhook60 ms async

    Webhook event dispatched asynchronously for email notifications and downstream sync.

Synchronous path: 0 – 135 msAsynchronous dispatch: 135 – 195 ms
Client HTTP return: 135 ms

How do you keep customers' data apart?

Three tenancy strategies, what each costs, and when I pick it.

Read: Multi-tenancy in depth

database A

database B

database C

Isolation
Ops simplicity
Easy migrations
Noisy-neighbour safety

I pick this when: Multi-tier SaaS platforms bridging Platform Admins, Reseller Consultancies (white-label workspaces), and Client Portals.

In practice: Implemented on Complete HR with HRMS Services, supporting custom domains, white-label themes, and support impersonation.

Role-based access, and the response that never leaks

Choose a role. See its permissions, and what the same endpoint returns for each.

Read: 5-level hierarchical RBAC

  • View cost ratesAllowed
  • Manage billingDenied
  • Approve timesheetsAllowed
  • View reportsAllowed
  • Manage staffDenied
  • Use the client portalDenied
  • Cross-tenant accessDenied

What Manager receives from GET /staff/s_42

HTTP 200
{
  "success": true,
  "data": {
    "id": "s_42",
    "name": "A. Example",
    "team": "Delivery",
    "costRate": "38.50",
    "margin": "0.31"
  }
}

Admins and managers use a separate response class that includes the cost rate.

Rotating refresh tokens, and what a stolen one gets you

Log in, let the access token expire, refresh, then replay an old refresh token the way an attacker would.

Read: Authentication that survives review

Cookies in the browser (HttpOnly, never readable by scripts)

  • None yet. Log in.
server log
  • Waiting for a request…

An incremental event and data sync that survives failure

Fail a page halfway, rerun, and watch the checkpoint and idempotent upserts keep the data correct.

Read: Webhook event delivery pipelines

Checkpoint

0

Rows in the app

0 / 8

  • ITEM-100v1
  • ITEM-101v2
  • ITEM-102v3
  • ITEM-103v4
  • ITEM-104v5
  • ITEM-105v6
  • ITEM-106v7
  • ITEM-107v8
sync log
  • Press Run sync. Then try failing page 2 and running again.