⚡ 全栈类型安全 · T3 Stack

ClawGet 控制台、官网、文档站正是基于这套现代工具链构建 —— 快速、可靠、可扩展
$ npm create t3-app@latest

🚀 创建一个新的 T3 项目 —— 所有模块可选,按需组合

📦 什么是 T3 Stack?

Theo 创建的 Web 开发技术栈,聚焦于简洁性、模块化、全栈类型安全 [citation:1]。核心包含 Next.jsTypeScript,并围绕它们搭配了业内顶尖的库,但保持每个部分可选——按需调换 [citation:1][citation:4]。

Next.js

React 框架,提供服务端渲染、静态生成、API 路由。让 UI 开发快速且高度优化,引导开发者做出正确决策 [citation:8]。

SSR/SSGApp RouterFile-based routing
TS

TypeScript

不是可选项——是基石。提供实时反馈、智能补全,让代码更健壮。“类型安全让你更快写代码” [citation:8]。

严格模式端到端类型
🎨

Tailwind CSS

实用优先的 CSS 框架,被誉为“禅式 CSS”。无需命名 class,快速构建美观界面,且保持完全定制自由 [citation:8]。

原子类响应式
🔗

tRPC

端到端类型安全 API,无需 REST 或 GraphQL 样板。通过 TypeScript 自动推断前后端类型,开发体验极佳 [citation:1][citation:8]。

无 schema轻量
🗄️

Prisma

下一代 Node.js/TS ORM。从数据库 schema 生成类型,保证从数据库到应用的类型安全。提供 Prisma Studio 图形化操作 [citation:8]。

ORM类型安全迁移工具
🔐

NextAuth.js

为 Next.js 量身定制的身份验证方案。支持 OAuth、邮箱、众多数据库适配器,无需自己构建安全措施 [citation:8]。

OAuth适配器session

🧠 T3 核心理念

1

解决问题,而不是堆砌

每个被加入的工具必须解决核心技术中的特定痛点。因此不会包含状态管理库(如 zustand),但会深度集成 Prisma、tRPC 这类解决类型安全与数据流问题的库 [citation:1][citation:4]。

2

负责任地“尝鲜”

在风险较低的部分采用前沿技术(如 tRPC,本质只是一堆函数,移除容易);但对数据库等核心层选择成熟方案(SQL),避免被新技术的陷阱拖累 [citation:1][citation:7]。

3

类型安全不可妥协

全栈类型安全是 T3 的承诺。TypeScript + tRPC 保证前后端类型一致,Prisma 保证数据库类型安全。任何削弱类型安全的决定都不应出现在这个栈中 [citation:1][citation:9]。

🧩 create-t3-app · 脚手架 CLI

它不是普通的模板,而是一个交互式命令行工具,由经验丰富的 T3 开发者构建。运行后根据你的选择(tRPC?Prisma?NextAuth?)生成最小化、模块化的项目骨架 [citation:3][citation:4]。所有选项均可选——这正是模块化的核心 [citation:1]。

npm create t3-app@latest [dir]以指定目录名称创建项目
--noGit不初始化 git 仓库
-y, --default跳过提问,使用全部默认选项 (相当于全选)
--noInstall生成项目但不安装依赖

⚙️ 实验性 CI 模式(无人值守生成)

搭配 --CI 标志可使用如下选项精确控制技术栈:

--trpc / --prisma / --drizzle
--nextAuth / --tailwind
--dbProvider (mysql, postgres, sqlite…)
--appRouter (使用 Next.js App Router)

示例:pnpm dlx create-t3-app@latest --CI --trpc --tailwind --nextAuth --drizzle --dbProvider postgres [citation:2]


🦞 ClawGet 为什么采用 T3 Stack?

🌐 官网 & 控制台

ClawGet 的官网、用户仪表盘、帮助文档均基于 T3 Stack 构建。借助 Next.js 的国际化路由快速部署多语言页面;Tailwind 实现官网“龙虾色”UI;TypeScript 保证前后端类型一致,对接 OpenClaw Python 核心时错误率降低。

⚡ 与 OpenClaw 核心的配合

T3 层主要负责用户交互、任务编排界面,通过 REST/WebSocket 与 Python 智能体通信。类型安全让 API 契约清晰,联调效率倍增。未来可借助 tRPC 实现内部工具的类型安全调用。

📈 扩展性

Prisma 管理用户、线索、任务等关系数据,与 PostgreSQL 无缝协作;NextAuth 轻松接入多种认证(Google、GitHub),为未来多租户做好准备。

“我们不重复造轮子,我们站在巨人的肩膀上专注获客智能。” —— ClawGet 工程团队

📚 学习资源

T3 Stack 官方文档、Discord 社区活跃,YouTube 有创始人的深度讲解 [citation:3][citation:9]。

访问 create.t3.gg →

🔹 Discord:t3.gg/discord [citation:6]

🔹 GitHub:t3-oss/create-t3-app

🔹 部署指南:Vercel / Netlify / Docker [citation:6]

⚡ Full-stack type safety · T3 Stack

ClawGet Console, website, and docs are built on this modern toolchain — fast, reliable, and scalable.
$ npm create t3-app@latest

🚀 Create a new T3 project — every module is optional, choose what you need.

📦 What is the T3 Stack?

Created by Theo, the T3 Stack focuses on simplicity, modularity, and end-to-end type safety [citation:1]. It centers around Next.js and TypeScript, with best-in-class optional libraries you can swap as needed [citation:1][citation:4].

Next.js

A React framework providing SSR/SSG and API routes. It enables fast UI development and strong optimization while guiding good defaults [citation:8].

SSR/SSGApp RouterFile-based routing
TS

TypeScript

Not optional — the foundation. It gives instant feedback and autocomplete for more robust code. “Type safety helps you ship faster” [citation:8].

Strict modeEnd-to-end types
🎨

Tailwind CSS

A utility-first CSS framework. Build polished UIs quickly without naming classes, while staying fully customizable [citation:8].

UtilitiesResponsive
🔗

tRPC

End-to-end type-safe APIs without REST/GraphQL boilerplate. TypeScript inference keeps client and server types aligned [citation:1][citation:8].

No schemaLightweight
🗄️

Prisma

A next-gen Node.js/TS ORM. It generates types from your schema and keeps database interactions type-safe, with Prisma Studio for inspection [citation:8].

ORMType-safeMigrations
🔐

NextAuth.js

Authentication for Next.js with OAuth/email and many adapters, so you don’t have to build security from scratch [citation:8].

OAuthAdaptersSession

🧠 Core T3 Principles

1

Solve problems, don’t collect tools

Every tool must solve a concrete pain point. That’s why it may omit generic state libraries, but deeply integrates Prisma/tRPC to address data flow and type safety [citation:1][citation:4].

2

“Try new things” responsibly

Use cutting-edge tech where risk is low (e.g., tRPC is “just functions” and easy to remove), while keeping mature choices for the core (SQL) [citation:1][citation:7].

3

Type safety is non‑negotiable

End-to-end type safety is the promise. TypeScript + tRPC keeps types consistent; Prisma makes database access type-safe. Don’t compromise this principle [citation:1][citation:9].

🧩 create-t3-app · CLI scaffold

Not a simple template, but an interactive CLI built by experienced T3 developers. It generates a minimal, modular project based on your selections (tRPC? Prisma? NextAuth?) [citation:3][citation:4]. Everything is optional — modularity is the point [citation:1].

npm create t3-app@latest [dir]Create a project in the given directory
--noGitDo not initialize a git repository
-y, --defaultSkip prompts and use defaults
--noInstallGenerate without installing dependencies

⚙️ Experimental CI mode (non-interactive)

With --CI, you can control the stack with flags:

--trpc / --prisma / --drizzle
--nextAuth / --tailwind
--dbProvider (mysql, postgres, sqlite…)
--appRouter (Next.js App Router)

Example: pnpm dlx create-t3-app@latest --CI --trpc --tailwind --nextAuth --drizzle --dbProvider postgres [citation:2]


🦞 Why does ClawGet use the T3 Stack?

🌐 Website & Console

ClawGet’s website, dashboard, and docs are built with the T3 Stack. Next.js helps deliver multilingual pages; Tailwind matches our brand UI; TypeScript keeps contracts consistent for faster iteration.

⚡ Working with the core agent

The T3 layer focuses on user experiences and orchestration. Clear, typed contracts make integration and iteration much faster.

📈 Scalability

Prisma manages relational data cleanly; NextAuth simplifies authentication options — preparing us for multi-tenant growth.

“We don’t reinvent wheels — we stand on giants’ shoulders and focus on acquisition intelligence.” — ClawGet Engineering

📚 Learning resources

T3 has great docs, an active Discord, and deep dives on YouTube [citation:3][citation:9].

Visit create.t3.gg →

🔹 Discord: t3.gg/discord [citation:6]

🔹 GitHub: t3-oss/create-t3-app

🔹 Deployment: Vercel / Netlify / Docker [citation:6]