Execution Environment
App Router server components handle rendering and data access on the edge-adjacent runtime, while Route Handlers expose the authenticated JSON API consumed by deployed agents.
Documentation
A developer-facing reference for the ScaleSystems autonomous AI workforce platform: the execution environment, the dual-rail billing architecture, plan-tier quota enforcement, and the tooling used to verify every integration.
ScaleSystems runs on the Next.js 15 App Router execution environment, colocating server-rendered marketing surfaces, the client control dashboard, and Route Handler APIs inside a single deployable runtime. Identity is managed by Auth.js v5 using stateless JWT sessions. Each session token is enriched with the caller's plan tier and their Stripe Customer ID, so every server action and Route Handler can resolve billing context and enforce quotas without an extra database round-trip.
App Router server components handle rendering and data access on the edge-adjacent runtime, while Route Handlers expose the authenticated JSON API consumed by deployed agents.
The Auth.js v5 JWT carries the signed plan tier and stripeCustomerId claims, giving every request a self-describing billing and entitlement context.
Billing is a dual-rail design that lets customers settle in either fiat or crypto without changing the entitlement model. Both rails resolve to the same plan tier applied to the caller's Auth.js session.
Traditional card processing runs through the Stripe Checkout loop. The app creates a Checkout Session tied to the session's Stripe Customer ID, redirects the customer to Stripe's hosted page, and reconciles the resulting subscription state back onto the JWT plan claim via webhook events forwarded during development with npm run stripe:listen.
Crypto settlement is handled by the BVNK payment gateway. Requests are signed with Hawk authentication signatures and quotes are retrieved by issuing a POST /api/v1/pay/summary request. A confirmed crypto payment upgrades the same plan tier used by the Stripe rail, keeping entitlements identical across both settlement paths.
The PlanTier value on the session drives runtime quota enforcement for agent deployments and token throughput. Requests that exceed the active tier are rejected before the agent runtime is invoked.
| Plan Tier | Active Agent Limit | Token Limit | Notes |
|---|---|---|---|
| FREE | 1 active agent deployment | 50,000 tokens / month | Ideal for evaluation and single-agent prototypes. |
| STARTER | 5 active agent deployments | 500,000 tokens / month | Built for small teams running production workloads. |
| PREMIUM | Unlimited deployments | Unlimited tokens | Enterprise scale with no deployment or throughput ceilings. |
A quick reference for the custom integration-testing commands used to keep the billing and data rails verified during development.
npm run integrations:verifyRuns the end-to-end integration harness against Stripe, BVNK, and the database rails to confirm every external connection is healthy.
npm run stripe:listenStarts the local Stripe CLI webhook forwarder so Checkout and subscription events reach the app during development.
npm run db:verifyValidates the Prisma schema against the live PostgreSQL connection and confirms the plan-tier tables are reachable.