AutoBlocksCalm automation for everyday life

Architecture (simplified)

AutoBlocks runs as four deployable services plus Postgres, orchestrated on Render per render.yaml. You interact with two browser sites; everything else runs server-side.


Technology stack (user-relevant)

LayerTechnologyYour touchpoint
Marketing siteNext.js (apps/marketing-web)autoblocks.pro
Product appNext.js (apps/product-web)autoblocks.run
APIFastify (apps/api)Session, CRUD, billing, help chat, AI
WorkerNode poll loop (apps/worker)Schedules + pending run execution
DatabasePostgreSQLTenant data, routines, runs, billing
EmailResendFailure/completion notifications
PaymentsStripeCheckout + subscription webhooks
Help + docs corpus@routines/user-docsGrounds POST /help/chat

Production services (Render)

Render nameTypeDomain / roleMonorepo path
autoblocks-mktgWebautoblocks.proapps/marketing-web
autoblocks-webWebautoblocks.runapps/product-web
autoblocks-apiWebapi.autoblocks.runapps/api
autoblocks-workerWorkerInternalapps/worker
autoblocks-postgresDatabasePrivate networkpackages/db

Public URLs are set in the autoblocks-platform env group: MARKETING_WEB_URL, PRODUCT_WEB_URL, NEXT_PUBLIC_API_URL.


High-level system diagram

flowchart TB
  subgraph browser [Your browser]
    PRO["autoblocks.pro"]
    RUN["autoblocks.run"]
  end

  subgraph render [Render platform]
    MKTG["autoblocks-mktg"]
    WEB["autoblocks-web"]
    API["autoblocks-api"]
    WRK["autoblocks-worker"]
    PG[(autoblocks-postgres)]
  end

  subgraph external [External services]
    Stripe["Stripe"]
    Resend["Resend"]
    OpenAI["OpenAI — AI assist + help"]
  end

  PRO --> MKTG
  RUN --> WEB
  MKTG -->|"POST /help/chat"| API
  WEB -->|"credentials: include"| API
  API --> PG
  WRK --> PG
  API --> Stripe
  Stripe -->|"POST /billing/webhooks/stripe"| API
  API --> Resend
  API --> OpenAI

The worker does not expose a public URL for routine operations. It polls Postgres for pending runs and schedule ticks (apps/worker/src/index.ts).


Monorepo layout (ASCII)

autoblocks.ai/
├── apps/
│   ├── marketing-web/     # autoblocks.pro
│   ├── product-web/       # autoblocks.run
│   ├── api/               # api.autoblocks.run
│   └── worker/            # background execution
├── packages/
│   ├── user-docs/         # help corpus + chat logic
│   ├── template-catalog/  # template metadata
│   ├── billing/           # plans, Stripe, entitlements
│   ├── workflow-domain/   # trigger/step types
│   └── db/                # schema + migrations
└── render.yaml            # deploy blueprint

Authentication flow

Session cookies are issued by the API after sign-up or sign-in. The product app sends credentials on each request.

sequenceDiagram
  participant User
  participant Product as product-web
  participant API as api.autoblocks.run
  participant DB as Postgres

  User->>Product: Submit signup/login form
  Product->>API: POST /auth/sign-up or /auth/sign-in
  API->>DB: Create or verify user + tenant
  API-->>Product: Set session cookie
  Product->>API: GET /auth/session (cookie)
  API-->>Product: User + tenantId
  Product-->>User: Dashboard / onboarding

Marketing /login redirects to product login (apps/marketing-web/src/app/login/route.ts).


Execution flow

Trigger kindWho starts the runWhere it runs
ManualYou — POST /routines/:id/executeAPI enqueues → worker executes
ScheduleWorker cron tickWorker inserts pending run → executes
Inbound webhookExternal POST POST /hooks/:pathTokenAPI enqueues → worker executes
flowchart LR
  Manual["Manual button"]
  Schedule["Schedule tick"]
  Webhook["Inbound webhook"]
  API["API creates pending run"]
  Worker["Worker polls + executes"]
  Activity["/activity history"]

  Manual --> API
  Schedule --> Worker
  Webhook --> API
  API --> Worker
  Worker --> Activity

Data you own (simplified)

StoreContains
User + tenantAccount, workspace membership
Routines + versionsAutoBlock definitions, triggers, steps
Execution runsStatus, logs, trigger metadata
SchedulesCron, timezone, last/next run
Webhook endpointsPath tokens linked to routines
SubscriptionsPlan, trial, Stripe IDs
NotificationsIn-app inbox items

All tenant-scoped data is isolated per workspace. Help chat on marketing does not read your tenant data.


Security notes (consumer)

TopicBehavior
CORSAPI allows marketing + product origins only
Help chatPublic endpoint; no auth; corpus-grounded answers
AI assistRequires auth + tenant membership
Webhook endpointsUnguessable path tokens; optional idempotency key
Stripe webhooksSignature verification in production

Related reading


Last updated 2026-06-04 — matches current apps/ and packages/ layout in the monorepo.