A complete frontend web application for an AI Video Generator service with user authentication, credit system, and Telegram bot integration.
- User Authentication: Sign up, sign in, and session management with Supabase
- Credit System: Users start with 5 free credits and can purchase more
- Telegram Integration: Unique connection keys for bot integration
- Payment Processing: Stripe integration for credit purchases
- Responsive Design: Modern, mobile-first design with Tailwind CSS
- Protected Routes: Dashboard access only for authenticated users
- Frontend: React 18 + TypeScript + Vite
- Styling: Tailwind CSS with custom gradients and animations
- Backend: Supabase (Auth + Database)
- Payments: Stripe
- Icons: Lucide React
The application uses a profiles table that extends Supabase's built-in authentication:
- id (uuid, references auth.users)
- email (text)
- credits (integer, default 5)
- telegram_connection_key (text, unique)
- telegram_connected (boolean, default false)
- created_at (timestamptz)
- updated_at (timestamptz)- Create a new Supabase project at supabase.com
- Click "Connect to Supabase" in the top right of this application
- The database migration will create the necessary tables and policies
Create a .env file based on .env.example:
VITE_SUPABASE_URL=your-supabase-project-url
VITE_SUPABASE_ANON_KEY=your-supabase-anon-keyFor payment processing, you'll need to:
- Create a Stripe account
- Get your publishable and secret keys
- Implement server-side webhook handling for successful payments
- Update the credit balance in Supabase after successful payments
npm install
npm run dev- HomePage: Landing page with hero section and feature explanation
- SignUpPage: User registration with automatic profile creation
- LoginPage: User authentication
- Dashboard: Main user area with credit balance, video creation, and Telegram connection
- AuthProvider: React context for authentication state management
- Row Level Security (RLS) enabled on all tables
- Users can only access their own data
- Automatic profile creation on signup
- Protected routes for authenticated content
- Video generation workflow integration
- Telegram bot command handling
- Payment webhook processing
- Video history and management
- Advanced user settings
MIT License - feel free to use this as a foundation for your own projects!