A high-performance, minimalist HTML/CSS/JS playground with AI-powered code generation, offloaded to Trigger.dev for reliable long-running tasks.
- Live Preview: Real-time rendering of your code.
- AI Assistant: Generate and update code using OpenRouter (Gemini, Claude, GPT-4, etc.).
- Background Tasks: Long AI generations are offloaded to Trigger.dev to bypass Cloudflare Worker limits.
- Real-time Streaming: Watch the AI write code in real-time even when running in the background.
- Modern UI: Sleek dark mode, responsive layout, and CodeMirror editor.
- Node.js (v18+)
- OpenRouter API Key
- Trigger.dev Account
-
Install Dependencies:
npm install
-
Environment Variables: Create a
.envfile in the root directory:NUXT_OPEN_ROUTER_KEY=your_openrouter_api_key TRIGGER_SECRET_KEY=your_trigger_secret_key # Set to true to bypass Trigger.dev and use direct streaming (subject to CF limits) # DISABLE_TRIGGER_DEV=false
To run the project locally, you need two terminal sessions:
-
Nuxt Dev Server: Starts the frontend and API routes.
npm run dev
-
Trigger.dev Dev Worker: Starts the local worker to handle background AI tasks.
npm run trigger:dev
Before deploying the frontend, you must deploy your tasks to Trigger.dev:
npm run trigger:deployNote: Make sure to add your NUXT_OPEN_ROUTER_KEY to the environment variables in the Trigger.dev dashboard for your project.
The project is optimized for Cloudflare Pages.
Build the app:
npm run buildDeploy to Cloudflare:
npm run deployEnsure the following variables are set in your Cloudflare Pages dashboard:
NUXT_OPEN_ROUTER_KEYTRIGGER_SECRET_KEY
- Framework: Nuxt 3 (Vue 3, TypeScript)
- Editor: CodeMirror 6
- Styling: Tailwind CSS
- AI: OpenRouter SDK
- Task Orchestration: Trigger.dev v3 (Realtime Streams)
- Deployment: Cloudflare Pages / Workers