Skip to content

raghavvvgaba/Devin

Repository files navigation

Devin

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.

What It Does

  • 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

Main Flow

  1. Sign in with Clerk.
  2. Connect GitHub.
  3. Import a repository on /projects/new.
  4. Open /projects/[id] to browse issues and manage the sandbox.
  5. Open /projects/[id]/issues/[issueNumber] to work on a specific issue.
  6. Reuse the same project sandbox for file operations, commands, diffs, and AI edit preparation.

Stack

  • Next.js App Router
  • React
  • Clerk
  • Prisma + PostgreSQL
  • GitHub App / GitHub OAuth
  • E2B sandboxes
  • OpenRouter for AI edit generation

Project Structure

Prerequisites

  • Node.js
  • pnpm
  • PostgreSQL database
  • Clerk project credentials
  • GitHub App credentials
  • E2B API key
  • OpenRouter API key if you want AI edit generation enabled

Environment Variables

The app validates its environment in src/env.js.

Server-side variables:

  • DATABASE_URL
  • CLERK_SECRET_KEY
  • GITHUB_APP_ID
  • GITHUB_APP_PRIVATE_KEY
  • GITHUB_APP_CALLBACK_URL
  • GITHUB_APP_CLIENT_ID
  • GITHUB_APP_CLIENT_SECRET
  • GITHUB_APP_INSTALL_URL
  • OPENROUTER_API_KEY
  • OPENROUTER_MODEL
  • E2B_API_KEY

Client-side variables:

  • NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
  • NEXT_PUBLIC_CLERK_SIGN_IN_URL
  • NEXT_PUBLIC_CLERK_SIGN_UP_URL
  • NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL

Development

Install dependencies:

pnpm install

Run the app locally:

pnpm dev

Useful commands:

  • pnpm build Production build. This is the most reliable verification command in this repo.
  • pnpm typecheck Run TypeScript without emitting files.
  • pnpm db:migrate Create and apply Prisma development migrations.
  • pnpm db:generate Regenerate Prisma client types.
  • pnpm db:push Push schema changes without creating a migration.
  • pnpm db:studio Open Prisma Studio.

Database

The database schema lives in prisma/schema.prisma.

For a human-readable walkthrough of the models and why they exist, see docs/database.md.

Architecture

For the overall app structure, API layout, and sandbox lifecycle, see docs/architecture.md.

Tool Contracts

Canonical developer-facing tool contracts live in docs/tools.md.

  • docs/tools.md Canonical contracts for sandbox tools, including search_code.

Troubleshooting

  • pnpm build is more trustworthy than pnpm typecheck when .next/types is 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.

Contributing

If you change the Prisma schema, run:

pnpm db:migrate

Before shipping changes, prefer verifying with:

pnpm build
pnpm typecheck

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages