Catmint Framework
A strongly-typed, full-stack React framework built on Vite. Catmint provides file-based routing, React Server Components, server functions, middleware, layouts, caching, and deployment adapters — all with first-class TypeScript support.
Features
- File-based routing with dynamic segments, catch-all routes, and route groups
- React Server Components with streaming SSR and client hydration
- Server functions via
createServerFnwith automatic client-side fetch compilation - Middleware with onion-model execution and
inherit: falseboundaries - Layouts that persist across sibling navigation with nested layout chains
- Caching with
cachedRoute,staticRoute, and cache invalidation - API endpoints with HTTP method handlers and typed parameters
- Environment variables with build-time enforcement of server/client boundaries
- Head & metadata via
<Head>component andgenerateMetadataexport - Error handling with
ErrorBoundary, status pages, andstatusResponse() - Forms with progressive enhancement and CSRF protection
- Internationalization with locale detection and routing strategies
- Telemetry via OpenTelemetry with
trace()and structured logging - Security with CSP generation, nonce injection, and CSRF tokens
- Testing utilities for pages, server functions, endpoints, and middleware
- Deployment adapters for Node.js, Vercel, and Cloudflare Workers
Quick Start
# Create a new project
pnpm create catmint my-app
# Navigate to project
cd my-app
# Start development server
pnpm dev
Modes
| Mode | Description | Output |
|---|---|---|
fullstack | Pages + API endpoints + server functions | Server bundle + client assets |
frontend | Static pages only, no server runtime | Static HTML/JS/CSS |
backend | API endpoints only, no page rendering | Server bundle only |
