How samuraigpt/seedance-2-generator works
Seedance 2 Generator is a web workspace for creating and archiving AI videos, with account authentication, API-key access, and credit-based purchases. The main workflow is to sign in, submit text or visual references (optionally uploading files), generate a video asynchronously, check its status, and view saved creations. Stripe checkout replenishes credits. The graph includes the documented studio, archive, and billing branches; some UI-to-route relationships are documented rather than visible in the sampled UI source, and the MuAPI webhook’s processing behavior is not inferred.
Main entry points: auth.js Authentication · ai.js AI Generation and Polling · billing.js Billing Service · prisma.js Prisma Client
Components 25
Workspace
- Video Studio
src/app/page.js - Creations Gallery
src/app/gallery/page.js - Sign-in Page
src/app/login/page.js - Navigation and API Keys
src/components/Navbar.js - Pricing Page
src/app/pricing/page.js
Application API
- Auth Route
src/app/api/auth/[...nextauth]/route.js - Generation API
src/app/api/seedance/route.js - Status API
src/app/api/seedance/check-status/route.js - Upload API
src/app/api/upload/route.js - Creations API
src/app/api/creations/route.js - API Key Route
src/app/api/user/apikey/route.js - Checkout Route
src/app/api/checkout/route.js - Stripe Checkout Route
src/app/api/stripe/checkout/route.js - Stripe Webhook Route
src/app/api/stripe/webhook/route.js
Domain Services
- AI Generation and Polling
src/lib/services/ai.js - Billing Service
src/lib/services/billing.js - Credit Management
src/lib/services/user.js - Service Configuration
src/lib/config.js
Identity and Data
- Authentication
src/lib/auth.js - Prisma Client
src/lib/prisma.js - PostgreSQL Data
prisma/schema.prisma
Other components
- User
- MuAPI
- Stripe
- Google OAuth
Connections 36
- User → Video Studio: uses
README.md - User → Creations Gallery: views archive
README.md - User → Sign-in Page: signs in
README.md - User → Pricing Page: chooses credits
README.md - Video Studio → Generation API: submits generation
README.md - Video Studio → Upload API: uploads references
README.md - Video Studio → Status API: checks progress
README.md - Creations Gallery → Creations API: loads creations
README.md - Navigation and API Keys → API Key Route: saves API key
src/components/Navbar.js - Sign-in Page → Auth Route: authenticates
- Generation API → Authentication: checks session
src/app/api/seedance/route.js - Generation API → AI Generation and Polling: dispatches generation
src/app/api/seedance/route.js - Status API → AI Generation and Polling: checks status
src/app/api/seedance/check-status/route.js - Upload API → Authentication: checks session
src/app/api/upload/route.js - Upload API → MuAPI: uploads file
src/app/api/upload/route.js - Upload API → Service Configuration: reads API key
src/app/api/upload/route.js - Creations API → Authentication: checks session
src/app/api/creations/route.js - Creations API → Prisma Client: reads creations
src/app/api/creations/route.js - API Key Route → Authentication: checks session
src/app/api/user/apikey/route.js - API Key Route → Prisma Client: updates user
src/app/api/user/apikey/route.js - Checkout Route → Authentication: checks session
src/app/api/checkout/route.js - Checkout Route → Billing Service: creates checkout
src/app/api/checkout/route.js - Stripe Checkout Route → Billing Service: creates checkout
src/app/api/stripe/checkout/route.js - Stripe Webhook Route → Billing Service: handles event
src/app/api/stripe/webhook/route.js - Auth Route → Authentication: uses options
src/app/api/auth/[...nextauth]/route.js - Authentication → Prisma Client: reads and writes users
src/lib/auth.js - Authentication → Google OAuth: offers sign-in
src/lib/auth.js - AI Generation and Polling → MuAPI: submits and polls
src/lib/services/ai.js - AI Generation and Polling → Credit Management: deducts or refunds
src/lib/services/ai.js - AI Generation and Polling → Prisma Client: stores generation state
src/lib/services/ai.js - AI Generation and Polling → Service Configuration: reads endpoints
src/lib/services/ai.js - Billing Service → Stripe: creates sessions
src/lib/services/billing.js - Billing Service → Credit Management: adds purchased credits
src/lib/services/billing.js - Billing Service → Service Configuration: reads plans and secrets
src/lib/services/billing.js - Credit Management → Prisma Client: updates credits
src/lib/services/user.js - Prisma Client → PostgreSQL Data: persists records