Skip to content

Repository files navigation

Zyro Logo

Zyro

AI-Powered Web Application Generator

Transform natural language prompts into fully functional, live Next.js applications β€” instantly.

Features β€’ How It Works β€’ Architecture β€’ Getting Started β€’ Tech Stack


✨ Features

πŸ€– Multi-Provider AI Support

Generate applications using your preferred AI provider:

  • Google Gemini (gemini-2.0-flash)
  • OpenAI (gpt-4o-mini)
  • Anthropic Claude (claude-3-5-sonnet, claude-3-5-haiku)
  • xAI Grok (grok-2-latest)
  • OpenRouter (devstral-2512, mistral-7b-instruct)

πŸ”’ Secure Key Management

Encrypted API key storage with AES-256-GCM encryption. Bring your own API keys β€” stored securely with your user account.

πŸ–₯️ Live Sandboxed Execution

Each generation runs in an isolated E2B sandbox with:

  • Pre-configured Next.js 15.3.3 environment
  • Full file system access
  • Terminal command execution
  • Hot module reloading
  • Isolated port 3000 preview

πŸ’¬ Conversational Development

Iterate on your applications through natural conversation:

  • Multi-turn context retention
  • Incremental feature additions
  • Real-time code modifications

🎨 Production-Ready Output

Generated apps include:

  • TypeScript throughout
  • Tailwind CSS styling
  • shadcn/ui components (pre-installed)
  • Responsive layouts
  • Accessibility best practices

🧠 How It Works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                              USER PROMPT                                     β”‚
β”‚                    "Build a todo app with dark mode"                        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                     β”‚
                                     β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                           ZYRO ORCHESTRATION                                 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚   Clerk     β”‚    β”‚    tRPC     β”‚    β”‚   Inngest   β”‚    β”‚   Prisma    β”‚  β”‚
β”‚  β”‚    Auth     │───▢│     API     │───▢│   Events    │───▢│   Storage   β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                     β”‚
                                     β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                           AI AGENT NETWORK                                   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                              β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚   β”‚                        CODE AGENT                                     β”‚  β”‚
β”‚   β”‚  β€’ System prompt with Next.js/Tailwind/shadcn expertise              β”‚  β”‚
β”‚   β”‚  β€’ Tools: terminal, createOrUpdateFile, readFile                     β”‚  β”‚
β”‚   β”‚  β€’ Iterates until <task_summary> generated                           β”‚  β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                     β”‚                                        β”‚
β”‚                                     β–Ό                                        β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                         β”‚
β”‚   β”‚  Title Generator   β”‚     β”‚ Response Generator β”‚                         β”‚
β”‚   β”‚  (3-word summary)  β”‚     β”‚  (User message)    β”‚                         β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                         β”‚
β”‚                                                                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                     β”‚
                                     β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                           E2B SANDBOX                                        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                              β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚   β”‚  Isolated Next.js 15.3.3 Environment                                 β”‚  β”‚
β”‚   β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€  β”‚
β”‚   β”‚  πŸ“ /home/user                                                       β”‚  β”‚
β”‚   β”‚  β”œβ”€β”€ app/                     ← Generated pages & components         β”‚  β”‚
β”‚   β”‚  β”‚   β”œβ”€β”€ page.tsx                                                    β”‚  β”‚
β”‚   β”‚  β”‚   β”œβ”€β”€ layout.tsx                                                  β”‚  β”‚
β”‚   β”‚  β”‚   └── [components].tsx                                            β”‚  β”‚
β”‚   β”‚  β”œβ”€β”€ components/ui/           ← Pre-installed shadcn components      β”‚  β”‚
β”‚   β”‚  β”œβ”€β”€ lib/utils.ts             ← Utilities (cn, etc.)                 β”‚  β”‚
β”‚   β”‚  └── package.json                                                    β”‚  β”‚
β”‚   β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€  β”‚
β”‚   β”‚  πŸ–₯️  Dev server running on port 3000 with hot reload                β”‚  β”‚
β”‚   β”‚  πŸ”§  npm available for dependency installation                       β”‚  β”‚
β”‚   β”‚  πŸ“‚  Full file system read/write access                              β”‚  β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                                                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                     β”‚
                                     β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                           LIVE PREVIEW                                       β”‚
β”‚              https://[sandbox-id].e2b.dev β€’ Shareable URL                   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ—οΈ Architecture

System Overview

Zyro is built as a modern, event-driven system using Next.js 15 with a sophisticated agent-based AI backend:

zyro/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                    # Next.js 15 App Router
β”‚   β”‚   β”œβ”€β”€ (home)/             # Authenticated routes
β”‚   β”‚   β”œβ”€β”€ api/                # API endpoints (tRPC, Inngest)
β”‚   β”‚   └── projects/           # Project views
β”‚   β”‚
β”‚   β”œβ”€β”€ components/             # UI Components
β”‚   β”‚   β”œβ”€β”€ ui/                 # shadcn/ui components
β”‚   β”‚   β”œβ”€β”€ code-view/          # Code editor & preview
β”‚   β”‚   β”œβ”€β”€ file-explorer.tsx   # File tree navigation
β”‚   β”‚   └── tree-view.tsx       # Directory structure
β”‚   β”‚
β”‚   β”œβ”€β”€ modules/                # Feature modules
β”‚   β”‚   β”œβ”€β”€ home/               # Dashboard
β”‚   β”‚   β”œβ”€β”€ projects/           # Project management
β”‚   β”‚   β”œβ”€β”€ messages/           # Chat interface
β”‚   β”‚   └── api-keys/           # Key management
β”‚   β”‚
β”‚   β”œβ”€β”€ inngest/                # Background job processing
β”‚   β”‚   β”œβ”€β”€ functions.ts        # AI agent orchestration
β”‚   β”‚   β”œβ”€β”€ client.ts           # Inngest client
β”‚   β”‚   └── utils.ts            # Sandbox utilities
β”‚   β”‚
β”‚   β”œβ”€β”€ trpc/                   # Type-safe API layer
β”‚   β”‚   β”œβ”€β”€ routers/            # API route definitions
β”‚   β”‚   β”œβ”€β”€ server.tsx          # Server utilities
β”‚   β”‚   └── client.tsx          # Client utilities
β”‚   β”‚
β”‚   β”œβ”€β”€ lib/                    # Shared utilities
β”‚   β”‚   β”œβ”€β”€ prisma.ts           # Database client
β”‚   β”‚   β”œβ”€β”€ ai-keys/            # Encryption utilities
β”‚   β”‚   └── utils.ts            # Helper functions
β”‚   β”‚
β”‚   └── prompt.ts               # AI system prompts
β”‚
β”œβ”€β”€ prisma/
β”‚   └── schema.prisma           # Database schema
β”‚
└── sandbox-template/           # E2B sandbox config
    └── nextjs/                 # Next.js template

Data Models

model Project {
  id        String    @id @default(uuid())
  name      String
  userId    String
  messages  Message[]
  createdAt DateTime  @default(now())
  updatedAt DateTime  @updatedAt
}

model Message {
  id        String      @id @default(uuid())
  content   String
  role      MessageRole // USER | ASSISTANT
  type      MessageType // RESULT | ERROR
  projectId String?
  Fragment  Fragment?
}

model Fragment {
  id         String @id @default(uuid())
  messageId  String @unique
  sandboxUrl String          # Live preview URL
  sandboxId  String?         # E2B sandbox identifier
  title      String          # AI-generated title
  files      Json            # Generated file contents
}

model UserAiProviderKey {
  id         String     @id @default(uuid())
  userId     String
  provider   AiProvider // GEMINI | OPENAI | ANTHROPIC | GROK | OPENROUTER
  iv         Bytes              # Encryption IV
  ciphertext Bytes              # Encrypted key
  authTag    Bytes              # Auth tag
  last4      String             # Display hint
}

AI Agent System

The core of Zyro is an Inngest Agent Kit powered network:

Agent Purpose Model
Code Agent Generates and modifies application code Provider's primary model
Title Generator Creates 3-word fragment titles Provider's fast model
Response Generator Writes user-friendly completion messages Provider's fast model

Available Tools:

Tool Description
terminal Execute shell commands (npm install, etc.)
createOrUpdateFile Write files to the sandbox
readFile Read existing file contents

πŸš€ Getting Started

Prerequisites

  • Node.js 18+ with pnpm
  • PostgreSQL database
  • Clerk account for authentication
  • E2B account for sandbox execution
  • Inngest account for event processing

Installation

  1. Clone the repository

    git clone https://github.com/riaz37/zyro.git
    cd zyro
  2. Install dependencies

    pnpm install
  3. Configure environment

    cp .env.example .env.local
    # Database
    DATABASE_URL="postgresql://user:pass@host:5432/zyro"
    
    # Clerk Authentication
    NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="pk_..."
    CLERK_SECRET_KEY="sk_..."
    
    # E2B Sandbox
    E2B_API_KEY="e2b_..."
    
    # Inngest
    INNGEST_EVENT_KEY="..."
    INNGEST_SIGNING_KEY="..."
    
    # Encryption (generate with: openssl rand -hex 32)
    ENCRYPTION_KEY="..."
  4. Initialize database

    pnpm prisma migrate dev
    pnpm prisma generate
  5. Start development server

    pnpm dev
  6. Start Inngest dev server (separate terminal)

    npx inngest-cli@latest dev

Open http://localhost:3000 to start generating!


πŸ”§ Tech Stack

Core Framework

Technology Version Purpose
Next.js 16.0.10 React framework with App Router
React 19.2.3 UI library
TypeScript 5.9.3 Type safety

AI & Agents

Technology Purpose
Inngest Agent Kit Multi-agent orchestration
E2B Sandboxed code execution

Database & API

Technology Purpose
Prisma ORM & migrations
PostgreSQL Database
tRPC Type-safe API
TanStack Query Data fetching

UI & Styling

Technology Purpose
Tailwind CSS Utility-first CSS
shadcn/ui UI components
Radix UI Accessible primitives
Lucide Icons

Auth & Infrastructure

Technology Purpose
Clerk Authentication
Inngest Event-driven background jobs
Sonner Toast notifications

πŸ“ Example Prompts

Try these prompts to see Zyro in action:

Prompt What You'll Get
"Create a todo app with dark mode" Full CRUD todo list with theme toggle
"Build a weather dashboard with charts" Dashboard layout with data visualization
"Make a portfolio website with contact form" Multi-section portfolio with form validation
"Create a music player interface" Audio player UI with playlist management
"Build a Kanban board like Trello" Drag-and-drop task management
"Design a Twitter/X clone feed" Social media feed with interactions

πŸ”’ Security

  • Encrypted API Keys: User API keys are encrypted with AES-256-GCM before storage
  • Isolated Sandboxes: Each code generation runs in an isolated E2B sandbox
  • Authentication: All routes protected with Clerk authentication
  • Input Validation: Zod schemas validate all API inputs

πŸ“œ Scripts

Command Description
pnpm dev Start dev server with Turbopack
pnpm build Build for production
pnpm start Start production server
pnpm lint Run ESLint
pnpm prisma studio Open Prisma database GUI
pnpm prisma migrate dev Run database migrations

🀝 Contributing

Contributions are welcome! Please see our Contributing Guide for details.

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

πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.


Built with ❀️ by riaz37

About

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages