Skip to content

andi586/scriptflow-poc

Repository files navigation

This is a Next.js project bootstrapped with create-next-app.

ScriptFlow pipeline (prod)

Database migrations (no manual SQL in Dashboard)

  1. Add DATABASE_URL to .env.local — Supabase → Project Settings → Database → Connection string (URI; use Session mode pooler or direct; password URL-encoded if needed).
  2. Run npm run db:migrate. This applies any pending files in supabase/migrations/ in order, records them in _scriptflow_migrations, and runs NOTIFY pgrst, 'reload schema' when something new was applied (refreshes PostgREST cache).
  3. CI: On push to main, .github/workflows/supabase-migrations.yml runs the same command. Add repository secret DATABASE_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

  1. Copy .env.example.env.local and fill keys. For the New project (demo) button, set SCRIPTFLOW_DEMO_USER_ID to a real auth.users.id UUID in that Supabase project.
  2. Browse preset character templates at /character-templates (API: GET/POST /api/character-templates).

Vercel / NEL 超时

  • NEL 分析走 Server Action analyzeScriptAction(不是单独的 /api/analyze-story)。根布局 app/layout.tsx 已设 export const maxDuration = 300vercel.json 里为 app/** 配置了 maxDuration: 300 作为补充。
  • Hobby 套餐对单函数时长有上限(常为 10s),若仍报 Load failed 需升级 Pro 或接受更长耗时。
  • 懒人一键 使用 nelProfile: "lazy"精简 system 提示max_tokens 3072、默认模型 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.

Getting Started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open 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.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

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.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors