Back to Blog
Architecture
5 min read

One endpoint. Every surface.

Write one definition per feature. Web form, CLI command, MCP tool, native screen, cron job - all at once. No duplication.

Every feature needed a web form, a CLI command, an MCP tool for AI agents, sometimes a mobile screen. Same Zod validation, same i18n, same error handling - just dressed differently. So I built next-vibe: a framework where you write one definition.ts per feature and it renders as all of them simultaneously.

It also powers unbottled.ai - 119 AI models, user-controlled censorship. The same codebase runs as a Next.js web app, a TanStack/Vite dev server, a React Native mobile app, a CLI, an MCP server, a cron system, and a WebSocket event bus. One endpoint definition. No duplication.

Types must align. No exceptions.

These are not style preferences. They are architectural rules baked into the framework.

The rule is strict: types must align completely. If your types are wrong, your architecture is wrong. We built vibe check to enforce it - Oxlint + ESLint + TypeScript in parallel, with custom plugins for project-specific rules.

no any

Replace with a real typed interface. If you reach for any, your architecture has a hole.

no unknown

Same rule. unknown is just any with extra steps. Define the type.

no bare object

Bare object is meaningless. Write the shape you actually expect.

no as X

Type assertions are lies to the compiler. Fix the architecture instead.

no throw

Use ResponseType<T> with success(data) or fail({message, errorType}). Errors are data, not exceptions.

no hardcoded strings in JSX

The checker catches untranslated literal strings. Every string needs a translation key.

The accidental graph engine

A trading bot that cannot trade

Vibe Sense started as a trading bot. It never executed orders - it just watched prices and fired signals. When I abandoned it, the pipeline architecture survived: data sources connect to indicators, indicators feed evaluators, evaluators emit signals, signals trigger actions. Every node is an HTTP endpoint.

"Every node in the graph is just an HTTP endpoint - you can curl any step in the pipeline, test it in isolation, or call it from an AI agent. The graph engine is a scheduler, not a DSL."

Because every node is a standard endpoint, they are individually testable via CLI, accessible to AI agents via MCP, and cacheable with the same infra as everything else. The graph engine does not invent its own language. It schedules endpoints.

View on GitHub
git clone https://github.com/techfreaque/next-vibe