Loading repository data…
Loading repository data…
aayushsoni-ai / repository
FORGE is an AI-powered React app builder that turns natural language prompts into live, production-ready code in the browser — featuring a Cline SDK agentic pipeline that autonomously improves apps file-by-file via SSE streaming, self-healing error detection via Gemini, and a full credit-based subscription system with Clerk Billing.
A full-stack AI-powered React app generator where users describe what they want to build, and the AI writes production-ready React code that renders live in the browser — just like Bolt.new or Lovable.
Users get a live Sandpack preview, a persistent chat history, image upload support, and a credit-based subscription system. Pro users can trigger a Cline AI agent that autonomously improves the generated app file by file.
| Layer | Technology |
|---|---|
| Framework | Next.js 15 (App Router, TypeScript) |
| Auth + Billing | Clerk |
| Database | Supabase (via Prisma) |
| Image Storage | Supabase Storage |
| Rate Limiting | Arcjet |
| AI Model | Gemini 3.5 Flash |
| AI Agent (Improve) | Cline SDK (@cline/sdk) |
| Code Editor + Preview | Sandpack (@codesandbox/sandpack-react) |
| Styling | Tailwind CSS v4 + Shadcn UI |
| ORM | Prisma (Postgres adapter) |
<PricingTable />)has() — credits top-up on plan upgradereact-markdown and a live blinking cursor during streaming/api/gen-ai-code)thinkingConfig enabled{ assistantMessage, title, files, dependencies }/api/improve) — Pro + StarterAgent with two tools: update_file + done_improvinglifecycle: { completesRun: true } ends the agent cleanly after all files are doneSandpackProvider only remounts when file paths change, not contentspackage.jsongit clone https://github.com/aayushsoni-ai/forge.git
cd forge
npm install
Generate the Prisma client:
npx prisma generate
npx prisma db push
Run the development server:
npm run dev
Open http://localhost:3000.
Create a .env.local file in the root:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
CLERK_SECRET_KEY=
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/
DATABASE_URL=
DIRECT_URL=
ARCJET_KEY=
# Supabase
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
#Google
GEMINI_API_KEY=
# Clerk Billing
NEXT_PUBLIC_CLERK_STARTER_PLAN_ID=cplan_your_new_starter_id
NEXT_PUBLIC_CLERK_PRO_PLAN_ID=cplan_your_new_pro_id
The Prisma schema has two models:
User — synced from Clerk on first login
id, clerkId, name, email, imageUrl, credits, plan, createdAt, updatedAt
Workspace — one per AI session
id, userId (FK), title, messages (JSON), fileData (JSON), createdAt, updatedAt
fileData stores both generated files and validated dependencies as a single JSON blob.
Supabase Storage bucket: workspace-images — public, organized by userId/workspaceId/.
Give a ⭐ if this project helped you learn something new!