Configs2026年7月7日·1 分钟阅读

Blitz.js — The Full-Stack React Framework with Zero-API Data Layer

Full-stack React framework built on Next.js that eliminates the need for a separate API layer by letting you import server code directly into components.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Blitz.js Overview
直接安装命令
npx -y tokrepo@latest install f50c2c51-7a45-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

Blitz.js is a full-stack React framework that extends Next.js with a zero-API data layer, authentication, and code scaffolding. It lets you write server-side logic and import it directly into React components as if calling a local function, removing the need for REST or GraphQL endpoints.

What Blitz.js Does

  • Provides RPC-style server functions that are callable directly from React components
  • Includes built-in authentication with session management and multiple strategies
  • Scaffolds models, queries, mutations, and pages with a single CLI command
  • Extends Next.js with conventions for organizing full-stack code in one repo
  • Ships a recipe system for installing third-party integrations like Tailwind or Material UI

Architecture Overview

Blitz compiles server-side query and mutation functions into API endpoints at build time. When a component imports a server function, the bundler replaces the import with an HTTP call, keeping the developer experience of direct function calls while maintaining a clean client-server boundary. Prisma is the default ORM.

Self-Hosting & Configuration

  • Install globally with npm or use npx to scaffold a new project interactively
  • Configure the database via DATABASE_URL in .env — PostgreSQL and SQLite work out of the box
  • Run blitz prisma migrate dev to apply schema changes during development
  • Deploy to Vercel, Render, Railway, or any Node.js-compatible platform
  • Customize the auth setup in app/blitz-server.ts and app/blitz-client.ts

Key Features

  • Zero-API data layer that turns server functions into typesafe RPC calls
  • Built-in auth with login, signup, password reset, and session management
  • Code scaffolding CLI that generates models, queries, mutations, and forms
  • Full TypeScript support with end-to-end type inference from database to UI
  • Recipe system for one-command installation of common libraries and patterns

Comparison with Similar Tools

  • Next.js — UI framework without opinions on data or auth; Blitz adds the full-stack layer
  • RedwoodJS — full-stack React with GraphQL; Blitz uses direct RPC instead
  • Create T3 App — scaffolds a Next.js + tRPC stack; Blitz provides its own zero-API abstraction
  • Remix — focuses on web fundamentals and loaders; Blitz emphasizes RPC and code generation

FAQ

Q: Is Blitz.js still actively maintained? A: Yes. The project evolved from a monolithic framework into a toolkit of packages that can be used with any Next.js app.

Q: Can I use Blitz with an existing Next.js project? A: Yes. Blitz provides an adapter package that adds the zero-API layer and auth to existing Next.js apps.

Q: Which databases are supported? A: Any database supported by Prisma, including PostgreSQL, MySQL, SQLite, SQL Server, and CockroachDB.

Q: How does it compare to tRPC? A: Both provide typesafe RPC. Blitz bundles auth and scaffolding into a complete framework, while tRPC is a standalone library.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产