Skip to main content
This document provides a comprehensive technical overview of Seemodo’s architecture for developers who want to understand or extend the system.

System Overview

Frontend Architecture

Pages

RouteComponentPurpose
/app/page.tsxMinimal home with prompt input
/startapp/start/page.tsxVisual canvas designer
/generationapp/generation/page.tsxFull code IDE
/accountapp/account/page.tsxUser account management

Context Providers

The app uses nested React Context for state management:
ContextPurposeKey State
UserProviderUser authentication and profileUser data, auth state
SandboxProviderSandbox lifecycle managementSandbox ID, URLs, pages
EditorProviderCode editing stateCurrent file, editor content
GenerationProviderGeneration stateGenerated screens, prompts

Key Components

app/start/
├── page.tsx              # Main page with providers
├── components/
│   ├── TopHeader.tsx     # Navigation header
│   ├── LeftSidebar.tsx   # Prompt and settings
│   ├── TldrawCanvas.tsx  # tldraw integration
│   ├── SandboxPanel.tsx  # Preview and terminal
│   ├── SeemodAIPanel.tsx # AI chat interface
│   ├── ModelSelector.tsx # AI model selection
│   └── brainstorm/       # Plan mode components
└── lib/
    ├── sandbox-context.tsx
    ├── generation-context.tsx
    └── editor-context.tsx

Sandbox Architecture

Provider Factory Pattern

// lib/sandbox/factory.ts
export function createSandboxProvider(): SandboxProvider {
  const provider = process.env.SANDBOX_PROVIDER || 'modal';
  
  switch (provider) {
    case 'modal':
      return new ModalProvider();
    case 'e2b':
      return new E2BProvider();
    case 'vercel':
      return new VercelProvider();
    default:
      throw new Error(`Unknown provider: ${provider}`);
  }
}

Sandbox Lifecycle

AI Generation Flow

Code Generation Pipeline

Prompt Processing

Seemodo AI Integration

Client Architecture

// Using @opencode-ai/sdk
const client = createOpencodeClient({ baseUrl: opencodeUrl });

// Session management
const session = await client.session.create({
  body: { title: 'Seemodo Session' }
});

// Send prompt
await client.session.prompt({
  path: { id: session.id },
  body: { 
    parts: [{ type: 'text', text: message }],
    model: { providerID: 'vercel', modelID: 'claude-sonnet-4' }
  }
});

// Event stream
const eventSource = new EventSource(`${opencodeUrl}/event`);
eventSource.onmessage = (event) => {
  const data = JSON.parse(event.data);
  // Handle tool calls, text, errors
};

Tool Types

ToolDescriptionEvents
ReadRead file contentstool.read.start, tool.read.result
WriteCreate/overwrite filetool.write.result
EditModify file sectionstool.str_replace.result
BashExecute commandstool.bash.start, tool.bash.result
SearchSearch codebasetool.search.result

Data Flow

Generation Request

Tech Stack

Frontend

TechnologyPurpose
Next.js 16React framework with App Router
TypeScriptType safety
Tailwind CSSStyling
Radix UIAccessible primitives
Shadcn/uiComponent library
tldrawCanvas/wireframe editor
Framer MotionAnimations
JotaiAtomic state management
xterm.jsTerminal emulator

Backend

TechnologyPurpose
Next.js API RoutesBackend endpoints
Vercel AI SDKAI model integration
Modal LabsSandbox infrastructure
Python/FastAPIModal sandbox server
Seemodo AI SDKAI coding assistant

External Services

ServicePurpose
Google GeminiDefault AI model
Anthropic ClaudeAlternative AI model
OpenAI GPTAlternative AI model
GroqFast inference (Kimi K2)
SupabaseBackend-as-a-service

Project Structure

seemodo-app/
├── app/                        # Next.js App Router
│   ├── page.tsx               # Home page
│   ├── layout.tsx             # Root layout
│   ├── start/                 # Visual canvas
│   │   ├── page.tsx
│   │   ├── components/
│   │   └── lib/
│   ├── generation/            # Code IDE
│   ├── account/               # User account
│   └── api/                   # API routes
├── components/                 # Shared components
│   ├── ui/                    # Base UI components
│   └── shared/                # Shared features
├── lib/                       # Utilities and logic
│   ├── sandbox/               # Sandbox providers
│   ├── ai/                    # AI configuration
│   ├── subscription/          # Credits system
│   └── contexts/              # React contexts
├── config/                    # Configuration
│   └── app.config.ts
├── modal-backend/             # Modal sandbox code
│   ├── main.py               # Modal app
│   ├── server.py             # FastAPI server
│   ├── agent.py              # AI agent
│   └── vite-app/             # Template project
├── styles/                    # CSS and design system
└── types/                     # TypeScript types

Security Considerations

API Keys

  • All API keys stored in environment variables
  • Never exposed to client-side code
  • Separate keys for development/production

Sandbox Isolation

  • Each sandbox runs in isolated container
  • No network access between sandboxes
  • File system isolation
  • Encrypted tunnel URLs

Authentication

  • User sessions via Supabase Auth (when configured)
  • API routes validate authentication
  • Sandbox credentials per-session

Scalability

Horizontal Scaling

  • Next.js deploys on Vercel/similar
  • Sandboxes scale independently on Modal
  • No shared state between requests

Performance Optimizations

  • SSE streaming for real-time updates
  • HMR for instant preview updates
  • Parallel tool execution in Seemodo AI
  • Client-side caching for UI state