Generate a small, realistic project scaffold from a short feature description. Paste a spec, click Generate, preview the resulting files, and download them as a ZIP.
Built with Next.js 16 (App Router), React 19, TypeScript, Tailwind CSS v4, and the OpenAI API.
Prerequisites: Node.js 18+ and an OpenAI API key.
- Install dependencies
npm install- Configure environment
Create .env.local in the project root with your OpenAI key:
echo "OPENAI_API_KEY=sk-..." > .env.local- Run the dev server
npm run devOpen http://localhost:3000 and paste a short feature spec. Click “Generate Scaffold” to create files, preview them in the UI, and use “Download ZIP” to export.
- Backend: The API route
src/app/api/scaffold/route.tscalls OpenAI with your spec and returns a typed JSON payload containing:summary: brief description of the generated projectarchitectureNotes: high-level guidance and rationalefiles[]: an array of{ path, description, content }
- Frontend:
src/app/page.tsxlets you:- Enter a feature spec and trigger generation
- Browse the file list and preview contents
- Download everything as
scaffold.zipviaDownloadZipButton
- Model: Set in
src/app/api/scaffold/route.ts(default:gpt-4o-mini). - Runtime: The route uses the Edge runtime by default. If you prefer Node.js (e.g., for local mocking), change
export const runtime = "edge";to"nodejs". - Tailwind CSS v4: Enabled by
@tailwindcss/postcss(seepostcss.config.mjs). The global CSS imports Tailwind via@import "tailwindcss";insrc/app/globals.css.
npm run dev # Start dev server (http://localhost:3000)
npm run build # Production build
npm run start # Start production server
npm run lint # Lint the projectSet OPENAI_API_KEY in your hosting environment (e.g., Vercel Project Settings → Environment Variables). Deploy the app, then visit the URL to use the generator.
- Costs and privacy: Requests are sent to OpenAI using your API key; usage is billed to your account. Do not commit API keys.
- Tailwind classes not applying? Ensure
src/app/globals.cssincludes@import "tailwindcss";and rebuild. - Large outputs: For very big scaffolds, the UI shows a preview and lets you download the ZIP to inspect locally.