1. What Vibecodr Does
Vibecodr lets people publish and share runnable vibes across the feed, player, profiles, embeds, and vanity URLs. Vibes run in the browser; pulses handle privileged server-side work when needed.
The core stack is organized into:
- Web app (
apps/web) - React SPA and UI logic - API worker (
workers/api) - Edge API for data, storage, and orchestration - Dispatch worker (
workers/dispatch) - Routes pulse runs and secret/connection proxying - Pulse template (
workers/vibe-template) - Per-pulse Workers for Platforms runtime - Shared contracts (
packages/shared) - Types, schemas, plan limits, and error keys
2. Vibes
A vibe is the runnable experience attached to a post. It appears in these surfaces:
- Home feed at
/usingGET /feed/discover?mode=latest,GET /feed/following, andGET /feed/for-you - Discover at
/discover(backed byGET /feed/discover) with tag and search filtering - Profile pages at
/u/:handle(backed byGET /profile/:handle) - Player at
/player/:postIdfor full-screen runtime controls - Embeds via
https://embed.vxbe.space/e/:postId(live) andhttps://embed.vxbe.space/ea/:artifactId(pinned). The wrapper runs onembed.vxbe.spaceand loads the player fromplayer.vxbe.space. oEmbed accepts/player/:id,/post/:id,/e/:id, and/ea/:id.
Vibes run purely client-side in sandboxed iframes. They do not have access to D1, R2, KV, Durable Objects, or platform secrets. External network calls are from the browser and are restricted by the runtime CSP; privileged work must go through pulses.
Runtime budgets are enforced per surface and plan:
- maxConcurrentRunners - caps simultaneous vibes per surface
- clientStaticBootMs - boot timeout for client-only bundles
- webContainerBootHardKillMs - hard deadline for heavier runtimes
3. Project Types
Vibecodr uses file-based project type detection to classify projects based on structure.
Three Project Types
- Vibe (V) - Browser-only experience with no server code
- Pulse (P) - Server-only endpoints in
server/orsrc/server/ - Combo (C) - Frontend plus server endpoints (also consumes one slot)
Pulse files are detected from either server/weather.ts or src/server/weather.ts.
Both map to /api/weather. Pulse and Combo projects consume one deployment slot.
4. Pulses
A pulse is a server-side function running on Workers for Platforms. Pulses are the only way to run trusted backend logic with secrets, OAuth connections, or D1.
- CRUD via
/pulsesand/pulses/:id - Manual runs via
POST /pulses/:id/run, with per-plan quotas - Deployment callbacks via
/pulses/:id/wfp-statusand/pulses/:id/wfp-complete
import { definePulse } from "@vibecodr/pulse";
export default definePulse(async (input, env) => {
// env includes: kv, fetch, log, secrets, connections, event, request, waitUntil, db? (Pro only)
return { ok: true };
});
Note: env.ai and env.email are not available. Use
env.secrets.fetch() or env.connections.fetch() for external APIs.
Egress is enforced by the Outbound Worker and dispatch proxies (infra blocklist + redirect re-validation).
5. How Vibes Use Pulses
- Vibe asks the host to run a pulse via postMessage
- Player calls
POST /pulses/:id/runand receives a grant - Dispatch validates the grant, enforces quotas, and invokes the pulse worker
- Response is returned to the player and delivered back to the vibe
6. Automations, Webhooks, and Triggers
Automations are defined as triggers that dispatch pulses. Trigger kinds:
runtime_event, http_webhook, cron, and manual.
- Manage triggers via
/triggersand/triggers/:id - Validate cron via
POST /triggers/validate-cron(public) - Attach actions via
/triggers/:id/actionsand view runs via/triggers/:id/executions - Runtime event filters include
eventTypes,capsuleIds,postIds
Webhook signatures are supported with shared, GitHub, or Stripe semantics using headers
like x-vibecodr-signature, x-signature-sha256,
x-hub-signature-256, and stripe-signature.
7. Dependency Pipeline and Import Maps
Publishing compiles a capsule into an immutable artifact plus a runtime manifest with a deterministic import map.
- Dependencies are read from
package.jsonand lockfiles (package-lock.jsonorpnpm-lock.yaml) - Publish requires exact versions; unpinned ranges fail
- Published imports are mirrored at
/deps/:sha256(.js)with immutable caching @handle/slugresolves tohttps://vibecodr.space/lib/@handle/slug?v=VERSION- Draft and legacy artifacts can fall back to
https://esm.sh - Browser runtimes reject Node.js built-ins (fs, path, crypto, etc.)
8. Storage and Quotas
Storage uses R2 with a D1 index (r2_objects) for quotas, browsing, and cleanup.
Paid plans get dedicated buckets with shared-bucket fallback for reads; Free uses the shared bucket.
- Categories:
avatar,thumbnail,cover,draft,artifact_bundle,artifact_source,artifact_manifest - Visibility: avatars are
public, thumbnails arepublic_cdn(public or unlisted posts only), covers are served via the API with visibility checks, everything else is private artifact_manifestis tracked for cleanup but does not count toward quota- Downloads are served via the API with HTTP Range support (no presigned URLs)
- Scriptable files (HTML, SVG, XML) are served with CSP
script-src 'none',frame-ancestors 'none', andX-Content-Type-Options: nosniff
9. Plans and Usage Semantics
Plan limits are enforced by shared constants in PLAN_LIMITS.
- Free: 1 GB storage, 10 MB bundle, 100 files, 0 secrets, 1 connection, 3 pulses / 1,500 runs, triggers disabled
- Creator: 5 GB storage, 50 MB bundle, 500 files, 25 secrets, 3 connections, 15 pulses / 150k runs, 100 triggers/min
- Pro: 25 GB storage, 100 MB bundle, 2000 files, 200 secrets, unlimited connections, 50 pulses / 1M runs, 100 triggers/min, D1 via
env.db
Note: Pulse run quotas count server invocations, not vibe plays.
10. Recipes (Deprecated)
The recipes system (saved parameter presets) is deprecated and recipe API routes have been removed.
11. Remix Lineage
Remixes create parent-child relationships between capsules. Lineage can be queried via GET /capsules/:id/remixes.
12. Messaging
GET /conversations,POST /conversationsGET /conversations/:id/messages,POST /conversations/:id/messagesGET /conversations/:id/wsfor WebSocket upgradesGET /messages/unread-count,GET /messages/counts- Message requests:
/messages/requests,/messages/requests/:id/accept,/messages/requests/:id/reject,/messages/requests/:id/block
13. Search
GET /search?q=...&types=...&limit=...&offset=...GET /search/suggest?q=...&types=...GET /tags?q=...
14. Live Streaming (Deferred)
Live streaming is not enabled in the current codebase.
15. Social Features
Social features include follows, likes, comments, saves, blocks, and mute lists.
16. Terminology Reference
- Vibe: Client-side experience running in a sandboxed iframe
- Capsule: Internal container for vibe source files and assets
- Manifest: Capsule manifest describing entry point, runner, and capabilities
- Artifact: Immutable compiled bundle for a capsule
- Runtime Manifest: System-generated metadata used to load an artifact and its imports
- Library: Reusable module published for
@handle/slugimports - Pulse: Server-side function (Workers for Platforms)
- Secret: Encrypted key/value used via
env.secrets - Connection: OAuth integration used via
env.connections - Trigger: Automation rule that dispatches pulses
- Dependency Mirror: Immutable npm blobs at
/deps/:sha256(.js) - VXBE Runtime Host: Cross-origin runtime host like
c-<capsuleId>-rt.vxbe.space