How harshit-rv/forge works
Forge is an AI website builder: a user submits an idea in the project chat, an agent edits and runs the app in a project-specific Kubernetes sandbox, and the user watches streamed activity and a live preview. The graph follows the documented workflow and sampled wiring; some API route-to-service and agent-to-sandbox details are not shown in the excerpts, so those links are omitted where unverified.
Main entry points: page.tsx Forge web app · projects.route.ts Project routes · project.service.ts Project service · message.service.ts Message service
Components 23
Frontend
- Forge web app
frontend/app/projects/[projectId]/page.tsx - Chat workspace
frontend/components/chat/chat-panel.tsx - Code workspace
frontend/components/workspace/workspace.tsx - Live preview
frontend/components/preview/preview-panel.tsx
API
- API server
api/src/app.ts - Project routes
api/src/routes/projects.route.ts - Agent run service
api/src/services/agent-run/index.ts - Project service
api/src/services/project.service.ts - Message service
api/src/services/message.service.ts - Project records
api/src/models/Project.model.ts - Message records
api/src/models/message/Message.model.ts - Sandbox adapter
api/src/adapters/sandbox/index.ts
Agent
- AI agent
agent/src/run-agent.ts - Agent tools
agent/src/tools/tools.ts
Sandbox runtime
- Sandbox lifecycle
k8s-sandbox/src/sandbox.ts - Workspace operations
k8s-sandbox/src/workspace/index.ts
Kubernetes
- Project pod
k8s-sandbox/src/kube/pod.ts - Preview service
k8s-sandbox/src/kube/service.ts
Other components
- User
- Kubernetes API
- MongoDB
- Language model
- Preview browser
Connections 20
- User → Forge web app: uses
- Forge web app → Chat workspace: shows chat
- Chat workspace → API server: sends prompts
- Forge web app → Code workspace: opens project
- Forge web app → Live preview: shows preview
- API server → Project routes: dispatches
- Project routes → Agent run service: starts runs
- Project routes → Project service: manages projects
- Project routes → Message service: handles messages
- Project service → Project records: reads/writes
- Message service → Project service: checks ownership
- Message service → Message records: reads/writes
- Project service → Sandbox lifecycle: starts/stops
- Sandbox adapter → Workspace operations: operates workspace
- Sandbox lifecycle → Project pod: provisions
- Sandbox lifecycle → Preview service: manages service
- Project pod → Kubernetes API: creates pod
- Preview service → Kubernetes API: creates service
- Live preview → Preview browser: renders URL
- Preview browser → Preview service: loads preview