Devin is a Next.js app for importing a GitHub repository, browsing its issues, and working on those issues inside a live E2B sandbox with AI-assisted edit flows.
- Connects a user account to GitHub
- Imports a repository into the app as a project
- Lists GitHub issues for that project
- Starts one shared sandbox per project
- Lets users inspect files, run commands, view diffs, and prepare AI-assisted edits
- Persists issue chat history in Postgres through Prisma
- Sign in with Clerk.
- Connect GitHub.
- Import a repository on
/projects/new. - Open
/projects/[id]to browse issues and manage the sandbox. - Open
/projects/[id]/issues/[issueNumber]to work on a specific issue. - Reuse the same project sandbox for file operations, commands, diffs, and AI edit preparation.
- Next.js App Router
- React
- Clerk
- Prisma + PostgreSQL
- GitHub App / GitHub OAuth
- E2B sandboxes
- OpenRouter for AI edit generation
- src/app App Router pages, layouts, and API routes
- src/components UI components for project, issue, and sandbox workflows
- src/server Server-side modules for GitHub, sandbox, chat, AI, and database access
- prisma/schema.prisma Prisma data model and relations
- docs/architecture.md Higher-level frontend, API, and sandbox architecture
- docs/database.md Human-readable explanation of the Prisma models
- Node.js
pnpm- PostgreSQL database
- Clerk project credentials
- GitHub App credentials
- E2B API key
- OpenRouter API key if you want AI edit generation enabled
The app validates its environment in src/env.js.
Server-side variables:
DATABASE_URLCLERK_SECRET_KEYGITHUB_APP_IDGITHUB_APP_PRIVATE_KEYGITHUB_APP_CALLBACK_URLGITHUB_APP_CLIENT_IDGITHUB_APP_CLIENT_SECRETGITHUB_APP_INSTALL_URLOPENROUTER_API_KEYOPENROUTER_MODELE2B_API_KEY
Client-side variables:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEYNEXT_PUBLIC_CLERK_SIGN_IN_URLNEXT_PUBLIC_CLERK_SIGN_UP_URLNEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL
Install dependencies:
pnpm installRun the app locally:
pnpm devUseful commands:
pnpm buildProduction build. This is the most reliable verification command in this repo.pnpm typecheckRun TypeScript without emitting files.pnpm db:migrateCreate and apply Prisma development migrations.pnpm db:generateRegenerate Prisma client types.pnpm db:pushPush schema changes without creating a migration.pnpm db:studioOpen Prisma Studio.
The database schema lives in prisma/schema.prisma.
For a human-readable walkthrough of the models and why they exist, see docs/database.md.
For the overall app structure, API layout, and sandbox lifecycle, see docs/architecture.md.
Canonical developer-facing tool contracts live in docs/tools.md.
- docs/tools.md
Canonical contracts for sandbox tools, including
search_code.
pnpm buildis more trustworthy thanpnpm typecheckwhen.next/typesis stale.- Some TypeScript errors in this repo disappear after a successful build regenerates Next artifacts.
- Sandbox state is now persisted per project in Prisma, but the live connected E2B session still lives in memory while the server process is alive.
If you change the Prisma schema, run:
pnpm db:migrateBefore shipping changes, prefer verifying with:
pnpm build
pnpm typecheck