尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证正在加载完整 README。 以下为已保存的摘录。
Stripe revenue leak detection and monitoring for small SaaS teams.
Corvidet connects to a Stripe account, syncs subscription data, calculates core revenue metrics, detects a small set of concrete revenue leak patterns, and exposes that data through authenticated API routes and a Next.js dashboard. This branch is a serious MVP foundation, not a finished production system.查看完整 README ↗Stripe revenue leak detection and monitoring for small SaaS teams.
Corvidet connects to a Stripe account, syncs subscription data, calculates core revenue metrics, detects a small set of concrete revenue leak patterns, and exposes that data through authenticated API routes and a Next.js dashboard. This branch is a serious MVP foundation, not a finished production system.
The repository is beyond scaffold stage: authentication, Stripe Connect, sync, metrics snapshots, leak detection, alerts, and insights are implemented in the current branch. At the same time, several route groups and dashboard areas are still placeholders or partial integrations.
Use this README as a branch-accurate status document, not a product promise.
/api/sync-stripe-sessionANTHROPIC_API_KEY is configuredCorvidet is positioned as a revenue operations layer for founders using Stripe as their source of truth. The current MVP is strongest at:
It is not yet a full revenue intelligence platform with mature forecasting, fully automated notifications, or comprehensive recovery operations.
| Layer | Technology |
|---|---|
| App | Next.js 16 App Router, TypeScript, React 19 |
| Styling | Tailwind CSS 4 |
| Auth + Database | Supabase (Auth, Postgres, RLS) |
| Payments + Source Data | Stripe + Stripe Connect OAuth |
| AI | Anthropic API |
| Resend |
stripe_connections./api/sync-stripe-session uses the stored Stripe connection to pull live Stripe data.metrics_snapshots, refreshes revenue_leaks, and generates simple revenue_signals./api/metrics, /api/alerts, and /api/insights expose derived data for the dashboard or other clients.src/
├── app/
│ ├── api/ # Route handlers
│ ├── auth/callback/ # Supabase auth callback
│ ├── dashboard/ # Protected UI
│ ├── login/ # Auth entry page
│ └── page.tsx # Marketing landing page
├── lib/
│ ├── supabase/ # Browser/server/middleware clients
│ ├── encryption.ts # AES-256-GCM helpers
│ ├── stripe-metrics.ts # Stripe -> metrics snapshot logic
│ ├── revenue-leaks.ts # Leak detection logic
│ ├── revenue-signals.ts # MVP signal generation
│ ├── alerts.ts # Alert shaping
│ ├── insights.ts # Insights shaping
│ ├── server-clients.ts # Stripe + Supabase admin clients
│ └── server-error.ts # Standard API error responses
├── proxy.ts # Session refresh / auth guard entrypoint
└── supabase/migrations/ # Database schema
The main operational heartbeat is /api/sync-stripe-session. It:
last_sync_atThe repo currently calculates and stores:
These values are derived in src/lib/stripe-metrics.ts and persisted to metrics_snapshots.
Current leak detection is intentionally narrow and explainable. It detects:
Leak logic lives in src/lib/revenue-leaks.ts.
The current branch includes:
/api/alerts for an authenticated, normalized alert feed backed by leaks and signals/api/insights for a grounded summary of recoverable revenue, top risks, trend summary, and recommended actionsThese routes are MVP-honest and derived from persisted metrics, leaks, and signals rather than opaque analytics.
npm install
.env.localUse the variables below as a starting point. Features that depend on optional providers can remain disabled if their keys are omitted.
# Supabase
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
SUPABASE_SERVICE_KEY=
# Stripe
STRIPE_SECRET_KEY=
STRIPE_CLIENT_ID=
STRIPE_CONNECT_REDIRECT_URI=http://localhost:3000/api/stripe/connect
STRIPE_WEBHOOK_SECRET=
STRIPE_BILLING_WEBHOOK_SECRET=
STRIPE_GROWTH_PRICE_ID=
STRIPE_BUSINESS_PRICE_ID=
# AI
ANTHROPIC_API_KEY=
# Email
RESEND_API_KEY=
RESEND_FROM_EMAIL=
# Security / ops
ENCRYPTION_KEY=
CRON_SECRET=
# App
NEXT_PUBLIC_APP_URL=http://localhost:3000
Notes:
ENCRYPTION_KEY must be 64 hex characters.ANTHROPIC_API_KEY is missing, AI routes will not work.Example key generation:
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
http://localhost:3000/auth/callbacksupabase/migrations/ (see Database migrations below).http://localhost:3000/api/stripe/connectnpm run dev
Open http://localhost:3000.
npm run dev
npm run build
npm run lint
NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEYSUPABASE_SERVICE_KEYSTRIPE_SECRET_KEYSTRIPE_CLIENT_IDSTRIPE_CONNECT_REDIRECT_URIENCRYPTION_KEYNEXT_PUBLIC_APP_URLSTRIPE_WEBHOOK_SECRET: Stripe Connect webhook verificationSTRIPE_BILLING_WEBHOOK_SECRET: Stripe billing webhook verificationSTRIPE_GROWTH_PRICE_ID: checkout for the Growth planSTRIPE_BUSINESS_PRICE_ID: checkout for the Business planANTHROPIC_API_KEY: AI analyze / copilot routesRESEND_API_KEY: email sending helpersRESEND_FROM_EMAIL: custom sender addressCRON_SECRET: authenticated cron endpointsThis repo contains a mix of implemented routes and placeholder routes.
api/stripe/connectapi/stripe/syncapi/sync-stripe-sessionapi/metricsapi/leaks/actionsapi/leaks/connectionsapi/leaks/run-scanapi/alertsapi/insightsapi/churn/analyzeapi/user/connection-statusapi/create-checkoutapi/create-portalapi/ai/analyzeapi/ai/copilotapi/healthapi/cron/sync-allapi/cron/*api/recoveries/*api/leaks/notificationsapi/leaks/email-reportapi/leaks/streamapi/churn/interveneapi/scenarios/createapi/benchmarks/*api/usage/currentapi/user/profileapi/admin/data-modeThe route tree is broader than the truly finished feature set. Read the implementation before assuming a route group is production-ready.
Key tables in the shipped schema:
| Table | Purpose |
|---|---|
user_profiles | Profile, plan tier, Stripe billing customer mapping |
stripe_connections | Connected Stripe accounts and encrypted OAuth tokens |
metrics_snapshots | Daily revenue metrics per connection |
revenue_leaks | Detected leak records with severity and recoverable revenue |
revenue_signals | Lightweight persisted signals / alerts |
recovery_events | Intended recovery event log, currently not fully aligned with all route usage |
usage_events | Product and operational event logging |
All tables use Supabase Row Level Security. The service-role client is used only in trusted server contexts such as sync, billing, and webhook flows.
The repo uses the Supabase CLI to manage schema as versioned SQL files under supabase/migrations/. The CLI is invoked via npx, no global install needed.
Migrations use a sequential prefix, not the CLI's default <timestamp>_ format. Existing files:
supabase/migrations/001_initial_schema.sql
supabase/migrations/002_update_plan_tiers.sql
supabase/migrations/003_monthly_reports.sql
supabase/migrations/004_audit_requests.sql
New migrations continue the sequence: 005_, 006_, etc. Use a short, lowercase, snake_case name describing the change (e.g. 005_rls.sql, 006_quota_function.sql).
Do not run
supabase db pullagainst the linked project — it would emit a<timestamp>_remote_schema.sqlfile that duplicates the schema already captured in the sequential files.
# Authenticate the CLI with your Supabase account (interactive, opens browser)
npx supabase login
# Link the local repo to the remote project (writes project ref into supabase/config.toml)
npx supabase link --project-ref <YOUR_PROJECT_REF>
# Diff local migrations against the linked remote schema
npx supabase db diff
# Lint migrations locally before opening a PR (CI runs the same check)
npx supabase db lint --level error
# Apply pending local migrations to the linked remote project
npx supabase db push
supabase/migrations/<NNN>_<short_name>.sql with the next sequential number.create table if not exists, create index if not exists, etc.).npx supabase db lint --level error locally — fix any issues before pushing..github/workflows/db.yml) re-runs the lint against your branch.npx supabase db push to apply the migration to the linked Supabase project.If you run a local Supabase instance (npx supabase start), you can reapply all migrations from scratch with:
npx supabase db reset
This drops the local database, replays every migration in order, and runs supabase/seed.sql.
src/app/api and src/lib over relying on historical docs.What this branch is today:
What it is not yet: