A comprehensive Next.js application showcasing Google's Veo 3 video generation and Imagen 4 image generation capabilities with a professional three-tab interface, cinematography templates, and full Cloud Run deployment support.
π Live Demo: https://veo-app-jz3ep7ucoa-uc.a.run.app
- Veo 3 Integration: Generate high-quality videos from text prompts using Google's latest Veo-3 model
- Image-to-Video: Create videos from starting images + text prompts
- Professional Templates: Pre-built cinematography templates (Boutique Showcase, Studio Spotlight, Dynamic Reveal)
- Advanced Controls: Camera movements (360Β° Orbit, Bullet Time, Dolly Zoom), aspect ratios, negative prompts
- Gemini 2.5 Flash Preview: Generate stunning product visuals using Google's latest model
- Professional Styles: Multiple visual styles (Professional, Lifestyle, Artistic, Minimalist, Luxury, Social Media)
- Product Integrity: Enhanced prompts that preserve exact product characteristics
- Server-Side Serving: Optimized image display with fallback mechanisms
- π€ Agentic Chat Interface: Conversational AI agents for iterative visual refinement
- Creative Director: Focuses on artistic composition and brand aesthetics
- Product Photographer: Expert in lighting, angles, and technical photography
- Marketing Specialist: Optimizes visuals for conversion and engagement
- Interactive Refinement: Chat-based workflow for perfect visual creation
- Imagen 4.0: Generate images from text prompts using Google's Imagen model
- Multiple Formats: Support for various image formats and sizes
- Three-Tab Interface: Organized workflow with Product Selection, Prompt Management, and Review tabs
- Automatic Navigation: Smart tab switching when generating videos
- Grid/List Views: Flexible product browsing with advanced filtering
- Rating System: Thumbs up/down rating for generated content
- Video History: Track and manage generated videos
- Download & Cut: Play, download, and edit videos directly in the browser
- Cloud Run Deployment: Full containerization with Google Cloud Run support
- Artifact Registry: Modern container registry integration (GCR issues resolved)
- Environment Management: Secure API key handling and environment configuration
- Error Handling: Comprehensive error handling and logging
- Cross-Platform: Works in both browser and Node.js environments
Deploy directly to Google Cloud Run with a single command:
# Clone the repository
git clone https://github.com/jayeshvpatil/veo3-demo.git
cd veo3-demo
# Deploy to Cloud Run (includes build, push, and deploy)
./deploy/deploy.shThe script will:
- β Prompt for your GEMINI_API_KEY
- β Set up Artifact Registry automatically
- β Build and deploy the containerized app
- β Provide you with the live URL
Prerequisites:
- Node.js 18+ and npm
- GEMINI_API_KEY: Get your API key from Google AI Studio
Warning
Google Veo 3 and Imagen 4 require the Gemini API Paid tier. You'll need to upgrade from the free tier to use these models.
Setup:
# Install dependencies
npm install
# Set up environment variables
echo "GEMINI_API_KEY=your_api_key_here" > .env
# Run development server
npm run devOpen http://localhost:3000 to see the application.
- Product Selection: Browse and filter products with grid/list views
- Prompt Management: Create prompts with cinematography templates and camera controls
- Review: Rate, download, and manage generated videos
app/api/veo/generate/: Video generation with Veo-3 modelapp/api/veo/operation/: Check video generation statusapp/api/veo/download/: Download generated videosapp/api/imagen/generate/: Image generation with Imagen 4.0app/api/products/: Product data management
One-Command Deploy:
./deploy/deploy.shManual Deploy with Artifact Registry:
# Set up environment
source ./setup-env-interactive.sh
# Deploy using Artifact Registry (fixes GCR 412 errors)
./deploy-artifact-registry.shCloud Build Deploy:
# Deploy using Google Cloud Build
./deploy-cloudbuild.shAlternative Scripts:
deploy.sh- Standard deployment scriptquick-deploy.sh- Minimal quick deploymentsetup-env.sh- Environment setup helper
The application is containerized and can be deployed to any platform that supports Docker containers:
- Vercel: Deploy the Next.js app directly
- AWS ECS/Fargate: Use the provided Dockerfile
- Azure Container Instances: Deploy the container image
- Kubernetes: Use the container image with your K8s cluster
βββ app/ # Next.js App Router
β βββ api/ # API routes
β β βββ veo/ # Veo 3 video generation
β β βββ imagen/ # Imagen 4 image generation
β β βββ products/ # Product data
β βββ globals.css # Global styles
β βββ layout.tsx # Root layout
β βββ page.tsx # Main application (3-tab interface)
βββ components/ # React components
β βββ ui/ # UI components
β βββ Tabs.tsx # Tab system
β βββ ProductSelectionTab.tsx
β βββ PromptManagementTab.tsx
β βββ ReviewTab.tsx
β βββ Composer.tsx # Video generation form
β βββ VideoPlayer.tsx # Video playback
β βββ ...
βββ contexts/ # React contexts
β βββ ProductContext.tsx # Product state management
βββ lib/ # Utilities
β βββ products.ts # Product data helpers
β βββ utils.ts # Utility functions
βββ public/ # Static assets
βββ Dockerfile # Container configuration
βββ cloudbuild.yaml # Google Cloud Build config
βββ one-command-deploy.sh # One-command deployment
βββ deploy-*.sh # Various deployment scripts
- Next.js 15.3.5 - React framework with App Router
- React 19 - Latest React with concurrent features
- TypeScript 5 - Type-safe development
- Tailwind CSS 4 - Utility-first CSS framework
- Lucide React - Icon library
- rc-slider - Advanced slider components
- Gemini API - Google's AI API platform
- Veo 3 - Video generation model
- Imagen 4 - Image generation model
- Google Cloud Run - Serverless container platform
- Artifact Registry - Container image storage
- Cloud Build - CI/CD pipeline
- Docker - Containerization
- Grid/List View: Toggle between visual layouts
- Filtering: Search and filter products by category
- Selection: Click products to use in video generation
- Templates: Choose from professional cinematography templates:
- Boutique Showcase: Elegant product presentations
- Studio Spotlight: Professional studio lighting
- Dynamic Reveal: Dramatic product reveals
- Camera Controls: 360Β° Orbit, Bullet Time, Dolly Zoom, and more
- Advanced Settings: Aspect ratios, negative prompts, style controls
- Video Player: Play generated videos with full controls
- Rating System: Rate videos with thumbs up/down
- Download: Save videos locally
- History: Browse previously generated content
# Required
GEMINI_API_KEY=your_api_key_here
# Optional (for deployment)
GOOGLE_CLOUD_PROJECT=your-project-id
REGION=us-central1The application includes a multi-stage Dockerfile optimized for production:
- Build Stage: Installs dependencies and builds the app
- Runtime Stage: Minimal Alpine Linux container
- Platform: Supports linux/amd64 for Cloud Run compatibility
"412 Precondition Failed" during deployment:
- β
Fixed: Use
./one-command-deploy.shwhich uses Artifact Registry instead of deprecated GCR
"500 Internal Server Error" in deployed app:
- β Fixed: File instanceof checks replaced with cross-platform solutions
"GEMINI_API_KEY environment variable is not set":
- Set your API key in
.envfile or use the interactive setup script
Build fails with ESLint errors:
- β Fixed: All TypeScript and ESLint issues resolved
- Check the error logs:
gcloud logs tail --project=your-project-id - Review the deployment documentation in
DEPLOYMENT.md - Use the troubleshooting guides in
FIXES.md
// POST /api/veo/generate
{
prompt: string;
model?: string;
negativePrompt?: string;
aspectRatio?: string;
imageFile?: File;
imageBase64?: string;
imageMimeType?: string;
}// POST /api/veo/operation
{
name: string; // Operation name from generation
}// POST /api/veo/download
{
uri: string; // Video URI from completed operation
}// POST /api/imagen/generate
{
prompt: string;
model?: string;
}- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
- Issues: Open an issue for bug reports or feature requests
- Documentation:
- π Documentation Index - Complete documentation guide
- π Deployment Guide - Detailed deployment instructions
- β¨ Features - Feature implementation docs
- π Bug Fixes - Bug fix documentation
Built with β€οΈ using Google's Veo 3 and Imagen 4 APIs