Astro + tRPC + Drizzle app scaffold template
Go to file
noelorin c236f50ec6 feat(web): watch rematch candidates, import persist, danmaku filters 2026-09-26 21:03:01 +08:00
app feat(web): watch rematch candidates, import persist, danmaku filters 2026-09-26 21:03:01 +08:00
assets/brand chore(product): checkpoint working tree before dandanplay alignment 2026-09-26 18:36:16 +08:00
docs/superpowers chore(product): checkpoint working tree before dandanplay alignment 2026-09-26 18:36:16 +08:00
e2e chore(product): checkpoint working tree before dandanplay alignment 2026-09-26 18:36:16 +08:00
packages feat(web): watch rematch candidates, import persist, danmaku filters 2026-09-26 21:03:01 +08:00
.dockerignore chore(docker): runtime env defaults, healthcheck, ignore review artifacts 2026-09-26 02:58:47 +08:00
.env.example chore(product): checkpoint working tree before dandanplay alignment 2026-09-26 18:36:16 +08:00
.gitignore chore(product): checkpoint working tree before dandanplay alignment 2026-09-26 18:36:16 +08:00
.node-version chore: initial app template scaffold 2026-09-24 15:21:45 +08:00
.prettierrc chore: initial app template scaffold 2026-09-24 15:21:45 +08:00
.yarnrc.yml chore: initial app template scaffold 2026-09-24 15:21:45 +08:00
AGENTS.md chore(product): checkpoint working tree before dandanplay alignment 2026-09-26 18:36:16 +08:00
DESIGN.md chore(product): checkpoint working tree before dandanplay alignment 2026-09-26 18:36:16 +08:00
Dockerfile chore(product): checkpoint working tree before dandanplay alignment 2026-09-26 18:36:16 +08:00
README.md chore(product): checkpoint working tree before dandanplay alignment 2026-09-26 18:36:16 +08:00
biome.json chore(product): checkpoint working tree before dandanplay alignment 2026-09-26 18:36:16 +08:00
commitlint.config.mjs chore: initial app template scaffold 2026-09-24 15:21:45 +08:00
lefthook.yml chore: initial app template scaffold 2026-09-24 15:21:45 +08:00
package.json chore(product): checkpoint working tree before dandanplay alignment 2026-09-26 18:36:16 +08:00
playwright.config.ts chore(product): checkpoint working tree before dandanplay alignment 2026-09-26 18:36:16 +08:00
tsconfig.base.json chore: initial app template scaffold 2026-09-24 15:21:45 +08:00
turbo.json chore: initial app template scaffold 2026-09-24 15:21:45 +08:00
yarn.lock feat(web): watch rematch candidates, import persist, danmaku filters 2026-09-26 21:03:01 +08:00
全流程链路测试报告.md chore(product): checkpoint working tree before dandanplay alignment 2026-09-26 18:36:16 +08:00

README.md

帆幕 — 私有影音库 · 弹幕观影 · 网盘挂载

帆幕(Fanmu) 是自建私有影音库:WebDAV/OpenList 挂载片源、媒体库扫描与 Bangumi 刮削、ArtPlayer 播放与弹幕(开放网络 + 本地 XML),多用户进度与权限。

基于 monorepo 分层(types → models → db → dao → trpc → web),本仓库按产品仓维护。

.
├── app/
│   └── web/           @app/web      — Astro SSR + React islands + i18n 路由
├── packages/
│   ├── types/         @app/types    — Zod 入参 schema + 共享 DTO
│   ├── models/        @app/models   — Drizzle 表定义(唯一 schema 源)
│   ├── db/            @app/db       — libSQL/Turso 连接单例 + drizzle-kit
│   ├── dao/           @app/dao      — 数据访问层
│   ├── trpc/          @app/trpc     — tRPC 路由 + service
│   ├── ui/            @app/ui       — shadcn 风格基础组件 + Storybook
│   ├── design-tokens/ @app/design-tokens
│   ├── seo-geo/       @app/seo-geo  — SEO/GEO 纯函数
│   ├── i18n/          @app/i18n     — zh-CN / en 文案与 locale 工具
│   └── adsense/       @app/adsense  — AdSense 加载(可选)
└── docs/

快速开始

yarn install

cp .env.example .env
# 填入 TURSO_DATABASE_URL / TURSO_AUTH_TOKEN / PUBLIC_SITE_URL

yarn db:push          # 推 schema
yarn dev:web          # Astro :4321

技术栈

层 技术
前端 Astro 7 + React 19 islands
API tRPC v11
ORM Drizzle + @libsql/client(Turso)
样式 Tailwind CSS 4 + design-tokens
校验 Zod 4
工程 TypeScript 7 · Biome · Yarn 4 · Turbo

分层(必须遵守)

web → trpc → dao → db → models,横切 types。禁止循环依赖;跨包只走 package.json 的 exports。

新增业务实体请按既有分层接线:types schema → models 表 → dao 查询 → trpc service/router → web 页面。细节见根目录 AGENTS.md。