Skip to content

Latest commit

 

History

102 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenDevGen

OpenDevGen is a Turborepo-based monorepo housing an autonomous AI coding agent system. The platform allows users to interact with an AI coding agent that executes tasks within isolated code sandboxes and automatically creates pull requests.

📸 Application Showcase (Mock Data)

Here is the application interface demonstrating the full flow:

1. Repository Selection & New Session

The dashboard interface allows developers to select their connected GitHub repository and prompt the autonomous coding agent. 1. Repository Selection

2. Agent Conversation Workspace

The agent outlines its step-by-step reasoning and shows execution chips in real-time as it reads files, edits code, runs tests, and pushes commits. 2. Conversation Workspace

3. Live Code Diff Viewer (Expanded Execution)

Any file edit step can be expanded to display an interactive, side-by-side git diff showing exact code changes and deletions/additions. 3. Live Code Diff

4. Automated Pull Request Creation

Once the agent completes all verification and tests, it automatically pushes the code branch and opens a Pull Request on GitHub. 4. Pull Request Creation


🏗️ Project Structure

The project is structured as a monorepo managed by Turborepo and Bun as the package manager:

  • apps/backend: The Hono API server powered by the Bun runtime (port 8000). It orchestrates the AI agent loops, manages database sessions, and interfaces with the isolated sandbox environments.
  • apps/web: A Next.js 16 frontend app (port 3000) built using the App Router. It uses route groups like (app) for logged-in agent interactions and (auth) for authentication.
  • packages/types: Shared TypeScript definitions (@repo/types) used by both frontend and backend.
  • packages/eslint-config: Shared linting configurations (@repo/eslint-config) conforming to ESLint 9+ flat configs.
  • packages/typescript-config: Shared TypeScript compiler configurations (@repo/typescript-config).

🛠️ Tech Stack & Conventions

  • Runtime & Engine: Bun (>=1.3.4)
  • Backend Framework: Hono
  • Frontend Framework: Next.js 16 (App Router)
  • Styling: Tailwind CSS & Framer Motion for animations
  • Database: MongoDB (via Mongoose)
  • Language: Strict TypeScript with verbatimModuleSyntax enabled in the backend

🚀 Getting Started

1. Prerequisites

Ensure you have Bun installed:

bun --version

2. Run the Mock Showcase Flow (Recommended)

We have provided a script that seeds your local database with the complete mock flow (connecting account, agent steps, test execution, code diffs, and pull request creation) and starts the development servers:

# Run the mock showcase setup and start servers
./scripts/run-mock-flow.ps1

Once the servers start, open your browser and navigate to:

  • Sign-in page: http://localhost:3000/sign-in
  • Mock Credentials:
    • Email: developer@opendevgen.mock
    • Password: password123
  • Mock Session Direct URL: http://localhost:3000/s/implement-rate-limiting-middleware

3. Manual Local Development Setup

Backend (apps/backend/.env)

Copy the template from apps/backend/.env.example and define the required variables:

# Server Config
NODE_ENV=development
PORT=8000
BASE_URL=http://localhost:8000
FRONTEND_ORIGIN=http://localhost:3000

# Database
MONGO_URI=mongodb://localhost:27017/opendevgen

# Auth & GitHub Integration
JWT_SECRET=your_jwt_secret_key
JWT_EXPIRES_IN=7d
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
GITHUB_OAUTH_STATE_SECRET=your_github_oauth_state_secret
GITHUB_TOKEN_ENCRYPTION_KEY=your_github_token_encryption_key

# Sandbox Config (docker for local dev, daytona for remote/cloud)
SANDBOX_PROVIDER=docker
DAYTONA_API_KEY=

# AI Provider Keys (at least one is required)
MISTRAL_API_KEY=your_mistral_api_key
GROQ_API_KEY=your_groq_api_key
GOOGLE_GENERATIVE_AI_API_KEY=your_google_gemini_api_key

Frontend (apps/web/.env)

Copy the template from apps/web/.env.example and point it to the backend URL:

BACKEND_URL=http://localhost:8000

CLI Commands

Run the following commands from the root directory of the monorepo:

bun run dev            # Start both backend and frontend dev servers
bun run build          # Compile and build all packages/apps
bun run format         # Prettier format codebase
bun run lint           # ESLint analysis
bun run check-types    # Type-check TypeScript code

⚙️ Architecture Highlights

AI Agent Loop

  • Fallback Chain: The orchestrator resolves LLMs via a fallback chain (Mistral → Groq → Gemini). If a model fails or is unconfigured, the runner falls back to the next available provider.
  • Orchestration: The loop runs step-by-step up to AGENT_MAX_STEPS (default: 15), giving the agent tools to read files, run terminal commands, search directories, and perform biological database queries if needed.

Isolated Sandboxes

  • Docker (Local): Recommended for local development. Requires a running Docker daemon. Backend registers process shutdown hooks to clean up local containers on termination.
  • Daytona (Cloud): Recommended for production/cloud environments (e.g., Vercel + Render) to prevent Out of Memory (OOM) failures and system load. Sandbox workspaces are spun up dynamically on Daytona's remote environment.

About

AI coding agent platform allows users to interact with an AI coding agent that executes tasks within isolated code sandboxes and automatically creates pull requests.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages