STRIPE_SECRET_KEY and the seven other STRIPE_* vars appear zero times outside
src/ and zero times in .env.example, so isStripeReady() could only ever return
false. Three API routes, a checkout route, a tier grid and a "Manage
subscription" button were all gated on it and permanently unreachable.
Confirmed empty in production before touching the schema:
select count(*) filter (where stripe_customer_id is not null),
count(*) filter (where stripe_subscription_id is not null),
count(*) from users;
→ 0 | 0 | 7
So this removes no data and, more to the point, changes nothing a user sees:
every code path already fell through to the branch below it.
WHAT STAYS. Plans are real and untouched. They are granted through the
OrangeCat/Bitcoin rail (/api/orangecat/entitlement -> recordOcBillingGrant),
with the expiry cron reverting a lapsed pass to free. The pricing CTA cascade
loses only its unreachable middle step: free -> TBA -> [stripe] -> BTC ->
start-free.
WHAT WAS ACTIVELY WRONG. Because isStripeReady() was false, the one part of
Billing that DID render was a notice telling the reader to "add
STRIPE_SECRET_KEY and price IDs" — an environment variable shown to a person
who does not deploy the app and could not act on it. That is the same mistake
NotificationsPill's comment already calls out. Billing now states the plan and
links to /pricing.
Removed: lib/stripe.ts, api/stripe/{checkout,portal,webhook}, api/checkout/
[plan], getUserByStripeCustomerId, two user columns (migration 0063), two
entries from the user-client-view redaction lists, the api/stripe/webhook entry
in proxy.ts's public matcher, the stripe npm dependency, and the smoke/auth
probes for routes that no longer exist.
BillingSettings drops "use client" — with the handlers gone it holds no state,
no effect and no search-param read.
Two mentions deliberately KEPT because they are not the rail: the placeholder
prose describing what a user might build ("Simple dashboard, automated
reminders, Stripe payments…") and the demo project's stack string.
pnpm run verify green. 28 files, 519 deletions.
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
FleetCrown
FleetCrown is an execution operating system for builders who run many projects at once. It is the engineering pillar of a three-pillar stack:
| Pillar | Product | Role |
|---|---|---|
| Economy | OrangeCat | Bitcoin-native funding, entities, and the public timeline |
| Engineering | FleetCrown (this repo) | Agent fleets, project execution, and the deploy pipeline for the whole stack |
| Governance | Solon | Bitcoin-signed proposals, votes, and self-verifying decisions |
The ties are real: FleetCrown dogfoods OrangeCat (OIDC login, publish
bus, stakeholder graph, shared BTC wallet) — sibling-product integration; FleetCrown's agent Loki is a
registered voting member in Solon, casting Bitcoin-signed votes from its own
box (scripts/solon/cast-vote.ts) with decision webhooks landing at
/api/solon/events; and .github/workflows/selfhost-deploy.yml is the shared
CD pipeline that ships all three products to production.
The product thesis is simple: AI agents are becoming cheap execution capacity, but serious users still need a trustworthy command center. FleetCrown provides the state, queues, handoffs, guardrails, and business context around that capacity.
Production: https://fleetcrown.orangecat.ch Status: live, pre-1.0. Hosted on Hetzner.
What It Does
- Agent operations: launch, monitor, switch, and dispatch Claude, Codex, Gemini, Cursor, Grok, and OpenClaw across real project workspaces.
- Hybrid control plane: hosted Next.js app owns auth, database, product UI, and team state; a local daemon owns Zellij, shell, git, and agent CLIs.
- Project execution memory: per-project handoffs, queues, recent outcomes, lifecycle signals, git state, and saved context are visible in one place.
- Builder life OS: goals, people, habits, events, money, prompts, and thoughts live beside the work system rather than in disconnected apps.
- Economy-aware: Loki pulls open demand from sibling product OrangeCat and searches the economy by meaning (OrangeCat embeds the query server-side), so finding what already exists and building what's missing is one flow.
- Operational trust: runtime signals are persisted, versioned, and explained in the UI so users can tell the difference between active work, an open terminal, and historical handoff context.
Product And Economic Model
FleetCrown is designed as a high-retention SaaS for power users and small teams. It uses OrangeCat economic services (typed relations, shared wallet). Both projects live on the OrangeCat platform with typed relations. The economic model is built around durable workflow ownership, not one-off AI novelty.
Designed economic model (planned monetization).
| Layer | Value | Planned monetization (not billed) |
|---|---|---|
| Individual builder | One FleetCrown for projects, agents, commitments, and execution memory | Pro subscription (planned) |
| Team / studio | Shared project state, team visibility, agent dispatch, audit trail | Per-seat team plan (planned) |
| Agent runtime | Local daemon connects private machines to the hosted control plane | Paid runtime seats / usage tiers (planned) |
| Execution intelligence | Prompt routing, queue reasoning, outcomes, continuation policies | Premium automation tier (planned) |
| Enterprise / investor diligence | Operating telemetry, governance, security, and project health | Managed deployment / annual contract (planned) |
See docs/business-model.md for positioning, pricing logic, expansion loops, and defensibility.
Architecture At A Glance
Hosted control plane (self-hosted Next.js on Hetzner, Caddy in front)
Auth, database, UI, team state, command queue, runtime snapshots
Local runtime (user machine)
Zellij tabs, agent CLIs, git, shell tools, daemon, hook bridge
Data layer (Postgres / Drizzle)
User projects, runtime state, orchestration events, prompt queues,
goals, people, habits, events, billing, memories
Key design rules:
- SSOT first: schema, navigation, agent registry, runtime snapshots, prompt queues, and design tokens each have one canonical owner.
- Cloud/local separation: browser workflows stay cloud-safe; shell and terminal work happens only through the authenticated local daemon.
- Runtime truth beats assumptions: Control reflects live daemon pushes, process detection, Zellij tabs, and timestamped handoff files.
- Agent-agnostic direction: Claude-era compatibility remains where needed, but adapters and registry definitions are the migration path.
Stack
- Next.js 16.2.6 App Router, React 19, TypeScript strict
- PostgreSQL 17 with Drizzle ORM and schema-inferred types
- NextAuth v5 with GitHub OAuth and local owner-key support for private installs
- Tailwind CSS 4 with a tokenized dark-first design system
- Zellij + local daemon for terminal runtime control
- Self-hosted on Hetzner (
bitbaumbox, Caddy + systemd) — production deploys viascripts/deploy-hetzner.sh(build → rsync → restart); cron jobs run on the box - Husky + GitHub Actions for type, lint, and audit checks
Repository Map
src/app/ App routes and API endpoints
src/components/control/ Agent operations UI
src/components/*/ Domain surfaces: today, people, projects, goals, etc.
src/config/ Navigation, prompts, categories, product constants
src/db/schema/ Drizzle schema SSOT
src/db/queries/ Data access by domain
src/lib/ Runtime, auth, orchestration, formatting, utilities
home/ Local-first orchestration self-tests and runtime model
scripts/ Daemon, install, smoke, migration, and verification tools
docs/ Architecture, business model, cloud/local workflows
drizzle/ Generated schema migrations
packages/agent/ Hosted installer CLI
content/ Public essays and whitepaper content
Quality Bar
Every change should preserve:
pnpm run verify— the one canonical gate. CI runs it verbatim, so green local verify means green CI. Its step list lives inpackage.json(scripts.verify); this file deliberately does not restate it.pnpm run build
This used to enumerate an ad-hoc subset of test scripts. Every such list drifts from the real gate — three docs ended up teaching three different, all-weaker bars — so the rule is now: name the gate, never its contents.
pnpm run smoke
CI runs type/lint/design/self-test checks on pushes and pull requests. A
scheduled audit workflow fails on high or critical dependency vulnerabilities.
Production deploys to the Hetzner box run via scripts/deploy-hetzner.sh
(build → rsync → restart fleetcrown-app).
Local Development
pnpm install
docker compose up db -d
cp .env.example .env.local
pnpm run db:push # local scratch DB only — never a shared/prod database
pnpm run dev
Minimum local .env.local:
DATABASE_URL=postgresql://fleetcrown:changeme@localhost:5432/fleetcrown
AUTH_SECRET=replace-me
GITHUB_CLIENT_ID=replace-me
GITHUB_CLIENT_SECRET=replace-me
On a fresh database, visit /setup to create the first user.
Local Agent Runtime
Agent dispatch from the hosted app needs a connected machine:
curl -fsSL https://fleetcrown.orangecat.ch/api/agent/install | node - init --base-url https://fleetcrown.orangecat.ch
The runtime requires Zellij and at least one supported CLI on PATH: claude,
codex, gemini, agent (Cursor), grok, or openclaw.
See docs/development/cloud-local-workflows.md for the full matrix of browser-only vs local-runtime workflows.
Important Docs
- Business model
- Architecture principles
- Debt reduction roadmap
- Cloud vs local workflows
- Responsive design (mobile/tablet)
- Postgres portability
- Local orchestration runtime
Security And Operations
- Secrets stay out of Git; use
.env.exampleas the contract. - Production uses direct and pooled Postgres URLs separately.
- Local daemon access should use per-user
ck_*agent tokens. - Legacy shared daemon tokens require an explicit server-side opt-in flag.
- Private surfaces can be PIN-gated server-side.
- Dependency audit runs daily and high+ findings block the audit workflow.
See SECURITY.md for reporting and operational expectations.