How jaikarans2003/okvevo-web works
OkVevo is an AI video-creation product, with Firebase-backed accounts, a chat-led Nia workflow, video generation, and subscription billing. The README describes the AI Studio stages and external agent/rendering services, but the supplied tree does not include the documented workspace or agent-service directories; those appear as external, documented systems rather than inferred local implementations. The graph also shows the sampled Next.js gateway and billing flows. Arrows are limited to README statements or relationships visible in the supplied excerpts and source index.
Main entry points: completions/route.ts Chat gateway · update-subscription/route.ts Subscription routes · AuthForm.tsx Sign-in UI · debit.ts Credit metering
Components 22
Accounts & data
- Sign-in UI
src/components/shared/AuthForm.tsx - Auth state
src/hooks/useAuth.ts - User profiles
src/services/userService.ts - Firebase client
src/config/firebase.ts - Firebase data & assets
src/lib/firebase-admin.ts
Video creation
- Nia workspace
src/app/nia/page.tsx - Agent service
- OpenRouter LLM
- Video rendering
AI gateway
- Chat gateway
src/app/api/gateway/chat/completions/route.ts - Gateway auth
src/lib/gateway/auth.ts - Credit metering
src/lib/gateway/debit.ts - Usage pricing
src/lib/gateway/pricing.ts - Stream responses
src/lib/gateway/sse.ts
Billing
- Subscription UI
src/components/shared/payment/RazorpayCheckout.tsx - Subscription routes
src/app/api/razorpay/update-subscription/route.ts - Billing state
src/lib/billing/userSoT.ts - Plan catalog
src/config/razorpay.ts - Payment webhook
src/app/api/razorpay/webhook/route.ts - Credit balances
src/lib/gateway/debit.ts
Other components
- Creator
- Razorpay
Connections 25
- Creator → Sign-in UI: signs in
README.md - Sign-in UI → Firebase client: authenticates with
src/components/shared/AuthForm.tsx - Sign-in UI → User profiles: creates profiles
src/components/shared/AuthForm.tsx - Auth state → Firebase client: observes auth
src/hooks/useAuth.ts - Auth state → User profiles: loads profile
src/hooks/useAuth.ts - Creator → Nia workspace: describes video
README.md - Nia workspace → Agent service: proxies chat
README.md - Agent service → OpenRouter LLM: streams responses
README.md - Agent service → Video rendering: requests rendering
README.md - Agent service → Firebase data & assets: stores assets
README.md - Creator → Chat gateway: sends chat
src/app/api/gateway/chat/completions/route.ts - Chat gateway → Gateway auth: verifies identity
src/app/api/gateway/chat/completions/route.ts - Chat gateway → Credit metering: meters usage
src/app/api/gateway/chat/completions/route.ts - Chat gateway → Usage pricing: prices usage
src/app/api/gateway/chat/completions/route.ts - Chat gateway → Stream responses: streams output
src/app/api/gateway/chat/completions/route.ts - Credit metering → Firebase data & assets: updates balances
src/lib/gateway/debit.ts - Credit metering → Usage pricing: calculates charges
src/lib/gateway/debit.ts - Creator → Subscription UI: manages plan
README.md - Subscription UI → Subscription routes: requests changes
- Subscription routes → Billing state: loads billing state
src/app/api/razorpay/update-subscription/route.ts - Subscription routes → Plan catalog: resolves plan
src/app/api/razorpay/update-subscription/route.ts - Subscription routes → Razorpay: updates subscription
src/app/api/razorpay/update-subscription/route.ts - Razorpay → Payment webhook: sends events
- Payment webhook → Credit balances: grants credits
src/app/api/razorpay/webhook/route.ts - Payment webhook → Firebase data & assets: syncs subscription
src/app/api/razorpay/webhook/route.ts