Videa Docs

Project Structure

Overview of the codebase layout and key directories.

Directory Overview

├── app/[locale]/              # i18n routes
│   ├── (auth)/                # Auth pages (login, signup, forgot-password)
│   ├── (marketing)/           # Public pages (home, pricing, blog, contact)
│   ├── (protected)/           # Authenticated pages (dashboard, profile, credits)
│   ├── (admin)/               # Admin panel (users, subscriptions, credits)
│   ├── demo/                  # AI demo pages (chat, image, video)
│   └── docs/                  # Documentation (Fumadocs)
├── app/api/                   # API routes
│   ├── auth/                  # Better Auth + custom auth endpoints
│   ├── payments/creem/        # Creem checkout + webhook
│   ├── chat/                  # Chat API (streaming)
│   ├── image/                 # Image generation API
│   ├── video/                 # Video generation API (async)
│   ├── admin/                 # Admin operations API
│   └── cron/                  # Scheduled tasks (credit grants)
├── components/                # Reusable UI components
├── features/                  # Feature modules (auth, admin, forms, navigation)
├── lib/                       # Core business logic
│   ├── auth.ts                # Better Auth config
│   ├── db/                    # Database connection and schema
│   ├── credits.ts             # Credit system logic
│   ├── payments/creem.ts      # Creem payment integration
│   ├── billing/               # Subscription and credit scheduling
│   ├── volcano-engine/        # Volcano Engine API wrappers
│   └── email.ts               # Email sending logic
├── constants/                 # Constants
│   ├── billing.ts             # Pricing plans and credit packs
│   ├── tier.ts                # User tier definitions
│   └── website.ts             # Site metadata
├── content/docs/              # Documentation content (MDX)
├── messages/                  # i18n translation files (en, zh)
└── drizzle/                   # Database migration files

Route Groups

GroupPathAccessPurpose
(auth)/login, /signupPublicAuthentication flows
(marketing)/, /pricing, /blogPublicMarketing and SEO pages
(protected)/dashboard, /profileAuth requiredUser app features
(admin)/admin/*Admin roleManagement panel
demo/demo/*PublicAI feature demos
docs/docs/*PublicDocumentation

Key Files

FilePurpose
lib/auth.tsBetter Auth configuration with registration hooks
lib/credits.tsCredit deduction, refund, and balance check
lib/db/schema.tsComplete database schema (Drizzle ORM)
constants/billing.tsPricing plans, credit amounts, Creem product IDs
lib/payments/creem.tsCreem API integration (checkout, webhooks)
proxy.tsNext.js proxy for i18n routing
i18n.config.tsLocale configuration

On this page