This is a Next.js project bootstrapped with create-next-app.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
Trigger.dev handles orchestration: long-running tasks, retries, progress tracking, and observability. e2b provides isolated Linux sandboxes for code execution with automatic cleanup. This separation keeps the API stateless while delegating execution to a dedicated orchestration layer.
Client → POST /api/run → Trigger.dev Task → e2b Sandbox → Process Execution → Cleanup → Response
- API route validates input and triggers the task
- Trigger.dev orchestrates execution and emits progress logs
- e2b utility creates sandbox, executes code, captures stdout/stderr
- Sandbox cleanup guaranteed in
finallyblock - API polls for incremental logs (500ms interval) until completion
API key sourced from E2B_API_KEY env var or optional request payload. Keys are never logged—all error messages sanitize secrets via regex. Validation occurs before sandbox creation.
- Synchronous: API blocks until completion. Long runs (>60s) should use async/webhook pattern
- Polling: 500ms interval adds latency vs true streaming
- Stateless: Each execution creates a new sandbox, no persistence
- Error details: Technical errors wrapped in user-friendly messages
- Concurrency: No built-in rate limiting for simultaneous executions
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.