Skip to content

Latest commit

Β 

History

33 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎬 Glitch x Google Hackathon: AI-Powered Video Editor

An intelligent, agentic video editing platform combining a modern Next.js frontend with a FastAPI backend powered by Google Gemini AI. The system intelligently routes video processing tasks across multiple AI providers based on semantic user prompts.

✨ Features

  • πŸ€– AI-Driven Decision Making: Gemini-powered agent analyzes user prompts and intelligently routes tasks
  • 🎯 Multi-Provider Support: Dynamically adapts between Veo, Nanobanana, and Lyria APIs for optimal results
  • βœ‚οΈ Interactive Video Editor: Real-time timeline editing with live preview and media panel
  • πŸ—οΈ Modular Architecture: Clean separation between frontend, backend, and AI adapters
  • πŸ’¬ Conversational History: Track and retrieve session-based AI interactions
  • πŸ”„ Hot-Reload Development: Next.js dev server + FastAPI auto-reload for rapid iteration

πŸ› οΈ Tech Stack

Backend

  • Framework: FastAPI
  • Language: Python 3.13+
  • AI: Google Gemini API
  • Validation: Pydantic
  • Server: Uvicorn
  • Cache: Redis
  • Async: Python asyncio

Frontend

  • Framework: Next.js 16
  • UI Library: React 19
  • Styling: Tailwind CSS v4
  • Language: TypeScript
  • Icons: FontAwesome
  • Linting: ESLint

πŸ“‚ Project Structure

glitch-google-hackathon_26/
β”œβ”€β”€ agentic-monorepo-backend/
β”‚   β”œβ”€β”€ backend/
β”‚   β”‚   β”œβ”€β”€ main.py                    # FastAPI app entry
β”‚   β”‚   β”œβ”€β”€ agent/
β”‚   β”‚   β”‚   └── gemini_agent.py        # Gemini decision logic
β”‚   β”‚   β”œβ”€β”€ router/
β”‚   β”‚   β”‚   └── model_router.py        # Smart model routing
β”‚   β”‚   β”œβ”€β”€ adapters/
β”‚   β”‚   β”‚   β”œβ”€β”€ veo/
β”‚   β”‚   β”‚   β”œβ”€β”€ nanobanana/
β”‚   β”‚   β”‚   └── lyria/
β”‚   β”‚   β”œβ”€β”€ schemas/
β”‚   β”‚   β”‚   β”œβ”€β”€ agent_output.py
β”‚   β”‚   β”‚   └── prompt_request.py
β”‚   β”‚   └── utils/
β”‚   β”‚       β”œβ”€β”€ config.py
β”‚   β”‚       β”œβ”€β”€ helpers.py
β”‚   β”‚       └── system_prompt.txt
β”‚   └── requirements.txt
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”‚   β”œβ”€β”€ page.tsx               # Main entry
β”‚   β”‚   β”‚   β”œβ”€β”€ layout.tsx
β”‚   β”‚   β”‚   └── editor/
β”‚   β”‚   └── components/
β”‚   β”‚       β”œβ”€β”€ Editor.tsx             # Frame editor
β”‚   β”‚       β”œβ”€β”€ Timeline.tsx           # Keyframe timeline
β”‚   β”‚       β”œβ”€β”€ MediaPanel.tsx         # Asset management
β”‚   β”‚       β”œβ”€β”€ PreviewArea.tsx        # Live preview
β”‚   β”‚       β”œβ”€β”€ AiAssistant.tsx        # Prompt UI
β”‚   β”‚       └── ExportModal.tsx        # Output export
β”‚   β”œβ”€β”€ package.json
β”‚   └── tsconfig.json
└── README.md

πŸš€ Quick Start

Prerequisites

  • Node.js >= 20 (for frontend)
  • Python >= 3.13 (for backend)
  • pip or npm (package managers)

Backend Setup

From agentic-monorepo-backend/:

# Create virtual environment
python3 -m venv .venv

# Activate venv
source .venv/bin/activate        # macOS/Linux
# or
.venv\Scripts\activate           # Windows

# Upgrade pip
python -m pip install --upgrade pip

# Install dependencies
python -m pip install -r requirements.txt

Environment Variables

Create a .env file in agentic-monorepo-backend/:

GEMINI_API_KEY=your_gemini_api_key_here
REDIS_URL=redis://username:password@host:port

Run Backend

cd agentic-monorepo-backend
source .venv/bin/activate
python -m uvicorn backend.main:app --reload --host 127.0.0.1 --port 8000

Expected Output:

INFO:     Will watch for changes in these directories: ['.../agentic-monorepo-backend']
INFO:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
INFO:     Application startup complete.

Access:

  • API: http://localhost:8000
  • Docs: http://localhost:8000/docs (Swagger UI)

Frontend Setup

From frontend/:

# Install dependencies
npm install

# Run development server
npm run dev

Expected Output:

> next dev
- ready started server on 0.0.0.0:3000, url: http://localhost:3000
- event compiled client and server successfully

Access:

  • UI: http://localhost:3000

πŸ“‘ API Reference

POST /prompt - Process User Prompt

Submit a video editing prompt for AI analysis and execution.

Request:

curl -X POST "http://localhost:8000/prompt" \
  -H "Content-Type: application/json" \
  -d '{
    "user_prompt": "Generate a 30-second promo video with upbeat music",
    "session_id": "optional-session-uuid"
  }'

Response:

{
  "session_id": "550e8400-e29b-41d4-a716-446655440000",
  "decision": {
    "model": "veo",
    "reasoning": "Veo is best for video generation tasks",
    "parameters": {...}
  },
  "output": {
    "status": "success",
    "result": {...}
  }
}

GET /conversations/{session_id} - Retrieve Session History

Fetch all conversation messages for a session.

Request:

curl "http://localhost:8000/conversations/550e8400-e29b-41d4-a716-446655440000"

Response:

{
  "session_id": "550e8400-e29b-41d4-a716-446655440000",
  "conversations": [
    {
      "role": "user",
      "content": "Generate a video",
      "timestamp": "2026-03-28T10:30:00Z"
    },
    {
      "role": "assistant",
      "content": "I'll use Veo for this task...",
      "timestamp": "2026-03-28T10:30:05Z"
    }
  ]
}

πŸ› οΈ Development

Backend Development

cd agentic-monorepo-backend
source .venv/bin/activate

# Run with auto-reload
python -m uvicorn backend.main:app --reload

# Run tests (if available)
pytest

# Code formatting
black backend/

# Type checking
mypy backend/

Frontend Development

cd frontend

# Start dev server with hot-reload
npm run dev

# Build for production
npm run build

# Start production server
npm start

# Lint code
npm run lint

🚒 Deployment

Docker (Optional)

Backend Dockerfile:

FROM python:3.13-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8000"]

Frontend Dockerfile:

FROM node:20-alpine
WORKDIR /app
COPY package*.json .
RUN npm ci
COPY . .
RUN npm run build
CMD ["npm", "start"]

πŸ“ Environment Variables Reference

Backend (.env)

Variable Description Example
GEMINI_API_KEY Google Gemini API key AIza...xyz
REDIS_URL Redis connection string redis://user:pass@host:6379

Frontend

No environment variables required by default. API calls default to http://localhost:8000.


🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is part of the Glitch x Google Hackathon 2026. All rights reserved.


πŸ‘₯ Team

  • Backend: FastAPI + Gemini Agent Architecture
  • Frontend: Next.js Video Editor UI
  • AI Integration: Multi-provider routing (Veo, Nanobanana, Lyria)

About

An intelligent, agentic video editing platform combining Next.js frontend with a FastAPI backend powered by Google Gemini AI. The system intelligently routes video processing tasks across multiple AI providers (Veo, Nanobanana, Lyria) based on semantic analysis.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages