This is a Next.js project bootstrapped with create-next-app.
- Add
DATABASE_URLto.env.local— Supabase → Project Settings → Database → Connection string (URI; use Session mode pooler or direct; password URL-encoded if needed). - Run
npm run db:migrate. This applies any pending files insupabase/migrations/in order, records them in_scriptflow_migrations, and runsNOTIFY pgrst, 'reload schema'when something new was applied (refreshes PostgREST cache). - CI: On push to
main,.github/workflows/supabase-migrations.ymlruns the same command. Add repository secretDATABASE_URL(same URI) so migrations apply automatically — no copy-paste in SQL Editor.
Single-file apply (advanced): npm run db:migrate:file -- path/to/file.sql
- Copy
.env.example→.env.localand fill keys. For the New project (demo) button, setSCRIPTFLOW_DEMO_USER_IDto a realauth.users.idUUID in that Supabase project. - Browse preset character templates at
/character-templates(API:GET/POST /api/character-templates).
- NEL 分析走 Server Action
analyzeScriptAction(不是单独的/api/analyze-story)。根布局app/layout.tsx已设export const maxDuration = 300;vercel.json里为app/**配置了maxDuration: 300作为补充。 - Hobby 套餐对单函数时长有上限(常为 10s),若仍报
Load failed需升级 Pro 或接受更长耗时。 - 懒人一键 使用
nelProfile: "lazy":精简 system 提示、max_tokens3072、默认模型claude-haiku-4-5-20251001(可用NEL_LAZY_MODEL改为 Sonnet)。Pro 模式仍为完整 Sentinel + Sonnet。 - 若 300s 仍不够:可再拆异步任务或 NEL streaming;当前未实现流式响应。
Supabase CLI (optional alternative): after supabase link, npx supabase db push pushes the same migration files to the linked project.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.