A Next.js application demonstrating the v0 Platform API. Features project management, chat history, and app generation with live previews.
-
Install dependencies:
pnpm install
-
Configure environment:
cp .env.example .env
Add your v0 API key to
.env
:V0_API_KEY=your_api_key_here
Get your API key from v0.dev/settings
-
Run development server:
pnpm dev
- Project and chat management
- Real-time app generation using v0 Platform API
- Live preview of generated applications
- Session storage for improved performance
- Responsive design with floating prompt interface
GET /api/validate
- API key validationGET /api/projects
- List projectsGET /api/projects/[id]
- Get project with chatsPOST /api/generate
- Generate app from promptGET /api/chats/[id]
- Get chat detailsDELETE /api/chats/[id]
- Delete chatPOST /api/chats/fork
- Fork existing chat
- Framework: Next.js 15
- UI: React 19, Tailwind CSS 4
- Fonts: Geist (via next/font/google)
- API: v0-sdk
- Language: TypeScript
app/
├── api/ # API routes
├── components/ # Shared components
├── projects/[projectId]/ # Project pages
│ ├── chats/[chatId]/ # Chat pages
│ └── components.tsx # Project dropdowns
└── globals.css # Global styles with Geist font
Variable | Required | Description |
---|---|---|
V0_API_KEY |
Yes | Your v0 Platform API key |
# Install dependencies
pnpm install
# Run development server
pnpm dev
# Build for production
pnpm build
# Start production server
pnpm start