You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An AI-powered code generation platform built as a Turborepo monorepo. Users describe what they want to build, and the system generates production-ready code files in an isolated sandbox environment.
Appwit enables users to generate complete web applications from natural language prompts. The platform leverages:
LangGraph State Machine for orchestrating multi-step AI workflows
E2B Sandboxes for secure, isolated code execution and file management
LLM Integration supporting Anthropic Claude and OpenAI models
Real-time Streaming for progressive file generation feedback
Architecture
System Architecture
graph TB
subgraph Client["Frontend (Next.js)"]
UI[Web Interface]
Editor[Monaco Editor]
Preview[Sandbox Preview]
end
subgraph Server["Backend (Express/Bun)"]
API[REST API]
Auth[Auth Middleware]
Orchestrator[LangGraph Orchestrator]
end
subgraph Agent["AI Agent Pipeline"]
Planner[Planner Node]
Coder[Coder Node]
Theme[Theme Applicator]
Cmd[Command Handler]
Writer[Writer Node]
Reviewer[Reviewer Node]
end
subgraph External["External Services"]
LLM[LLM Provider<br/>Claude / OpenAI]
E2B[E2B Sandbox]
DB[(PostgreSQL)]
S3[S3 Storage]
end
UI --> API
API --> Auth
Auth --> Orchestrator
Orchestrator --> Agent
Agent --> LLM
Agent --> E2B
API --> DB
API --> S3
Preview --> E2B
Loading
UML Sequence Diagram: Code Generation Flow
sequenceDiagram
actor User
participant Frontend
participant API as Backend API
participant Orchestrator
participant LLM as LLM Provider
participant E2B as E2B Sandbox
User->>Frontend: Enter prompt
Frontend->>API: POST /prompt/stream
API->>E2B: Create sandbox
E2B-->>API: Sandbox instance
API->>Orchestrator: Start streaming pipeline
Note over Orchestrator: Planning Phase
Orchestrator->>LLM: Analyze prompt
LLM-->>Orchestrator: Task plan
Orchestrator-->>Frontend: Stream: plan_complete
Note over Orchestrator: Code Generation Phase
loop For each batch
Orchestrator->>LLM: Generate code
LLM-->>Orchestrator: File contents
Orchestrator->>E2B: Write files progressively
Orchestrator-->>Frontend: Stream: file_created
end
Note over Orchestrator: Command Execution
Orchestrator->>E2B: Run npm commands
E2B-->>Orchestrator: Command output
Orchestrator-->>Frontend: Stream: executing
Note over Orchestrator: Review Phase
Orchestrator->>E2B: List files
E2B-->>Orchestrator: File list
Orchestrator-->>Frontend: Stream: review_complete
alt Issues Found AND retryCount < 1
Orchestrator->>LLM: Regenerate missing files
end
Orchestrator-->>Frontend: Stream: done
Frontend->>E2B: Connect to preview URL
E2B-->>Frontend: Live preview
Frontend-->>User: Display result