Vision: A spec-driven, lovable alternative that turns explicit specifications into reliable, scalable code.
DevilDev is a spec-driven architecture workspace that helps developers generate, inspect, and iterate on software architecture using natural-language specifications and existing repositories.
Instead of jumping straight to code, DevilDev focuses on making architecture explicit-breaking systems into clear phases, components, and relationships that can be reasoned about, evolved, and reviewed before implementation.
Modern AI coding tools jump straight to code. DevilDev does the opposite.
DevilDev is built for developers who want to think clearly about systems before writing code. It helps you:
- Turn vague ideas into explicit architecture using structured, spec-driven generation
- Understand existing codebases by reverse-engineering architecture from repositories
- Iterate safely by evolving architecture in phases instead of rewriting everything
- Create a shared mental model that humans and AI can reason about together
DevilDev is intentionally focused on architecture today—not code generation—because clear architecture is the hardest part to fix later.
DevilDev’s vision is to build any piece of software not just websites - using explicit, spec-driven workflows instead of opaque, one-shot code generation.
Today, DevilDev generates architecture and documentation from specifications. In the future, those same specifications will drive the creation of the entire software system, built phase by phase with human review at every step.
The goal is not to generate code quickly, but to generate correct, maintainable, non-garbage software by treating specifications as the source of truth:
spec → architecture → modules → implementation
DevilDev is designed to work across all kinds of software:
- backend services
- distributed systems
- developer tools
- internal platforms
- libraries and infrastructure
By keeping every phase explicit and reviewable, DevilDev aims to make AI-assisted software development trustworthy, predictable, and genuinely useful, while remaining simple and enjoyable to work with.
Use the Local Setup instructions below to configure your environment, webhooks, and required third-party keys before running the app locally.
- Next.js (App Router), React, TypeScript
- PostgreSQL + Prisma
- Clerk for auth and webhooks
- GitHub App integration
- Supabase for vector store
- LangChain for agent orchestration
- Inngest for background jobs
- Dodo Payments for subscriptions
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher recommended)
- npm, yarn, pnpm, or bun package manager
- PostgreSQL database (local or cloud-hosted)
- Git for version control
# Clone the repository
git clone https://github.com/lak7/devildev.git
cd devildev
# Install dependencies
npm install
# or
yarn install
# or
pnpm install
# or
bun install- Sign up for a free account at ngrok
- Install ngrok:
# macOS brew install ngrok # Or download from https://ngrok.com/download
- Authenticate ngrok:
ngrok config add-authtoken YOUR_AUTH_TOKEN
- Start ngrok tunnel (in a separate terminal, keep it running):
ngrok http 3000
- Copy the HTTPS URL (e.g.,
https://abc123.ngrok.io) - you'll use this for webhook endpoints
Note: The public URL will change each time you restart ngrok unless you use an ngrok static URL. Choose a static URL when possible to avoid updating webhook URLs in your service dashboards after every restart.
- Go to Clerk Dashboard
- Create a new application (use Development mode)
- Copy your Publishable Key and Secret Key (they start with
pk_test_andsk_test_) - Set up webhook endpoint:
- Go to Webhooks in Clerk Dashboard
- Click Add Endpoint
- Enter your ngrok URL:
https://your-ngrok-url.ngrok.io/api/webhook/clerk - Select events:
user.created,user.updated,user.deleted - Copy the Signing Secret to
CLERK_WEBHOOK_SECRETin.env.local - Important: Update this URL whenever your ngrok URL changes
- Create a GitHub App: go to GitHub Settings → Developer settings → GitHub Apps → New GitHub App. Use your ngrok URL for the homepage and callback (e.g.,
https://your-ngrok-url.ngrok.ioandhttps://your-ngrok-url.ngrok.io/api/github/callback). - In your GitHub App settings, go to Webhooks
- Set webhook URL:
https://your-ngrok-url.ngrok.io/api/webhook/github - Set webhook secret to
GITHUB_WEBHOOK_SECRETin.env.local - Select events:
installation,installation_repositories
- Create a project at Supabase
- Go to Settings → API
- Copy Project URL to
SUPABASE_URL - Copy anon/public key to
SUPABASE_KEY - Set up the vector store table (see Supabase Vector documentation)
- Set up a PostgreSQL database:
- Update
DATABASE_URLin.env.localwith your connection string
CRITICAL: Dodo webhooks are required to update subscription status when payments are processed.
- In your Dodo Payments dashboard, go to Webhooks
- Add webhook endpoint:
https://your-ngrok-url.ngrok.io/api/webhook/dodo - Copy the webhook secret to
DODO_WEBHOOK_KEYin.env.local - Important: Update this URL whenever your ngrok URL changes
Inngest is required for core functionality including architecture generation and reverse architecture generation.
- Sign up for a free account at Inngest
- Create a new app in the Inngest dashboard
- For local development, set the app URL to your ngrok URL:
https://your-ngrok-url.ngrok.io/api/inngest - Copy your Event Key and Signing Key from the dashboard
- Add them to
.env.localasINNGEST_EVENT_KEYandINNGEST_SIGNING_KEY - Start Inngest Dev Server in a separate terminal:
This handles function execution locally. Keep this running while developing.
npx inngest-cli@latest dev
Create a .env.local file in the root directory:
# Database Configuration (Required)
DATABASE_URL="postgresql://user:password@localhost:5432/devildev?schema=public"
# Clerk Authentication (Required)
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_...
CLERK_SECRET_KEY=sk_test_...
CLERK_WEBHOOK_SECRET=whsec_...
# OpenAI API (Required)
OPENAI_API_KEY=sk-...
# Parallel API (Required)
PARALLEL_API_KEY=your_parallel_api_key
# Base URL (Required for local - use your ngrok URL)
NEXT_PUBLIC_BASE_URL=https://your-ngrok-url.ngrok.io
# Supabase Vector Store (Required for document retrieval)
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your_supabase_anon_key
# Dodo Payments (Required for subscription features)
NEXT_PUBLIC_DODO_PAYMENT_LINK=https://pay.dodopayments.com/...
DODO_WEBHOOK_KEY=your_dodo_webhook_secret
NEXT_PUBLIC_DODO_PAYMENT_CANCEL_LINK=https://your-ngrok-url.ngrok.io/cancel
# Inngest (Required - for background job processing)
INNGEST_EVENT_KEY=your_inngest_event_key
INNGEST_SIGNING_KEY=your_inngest_signing_key
# GitHub App Integration (Optional - for GitHub App migration)
GITHUB_APP_ID=your_github_app_id
GITHUB_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----"
GITHUB_WEBHOOK_SECRET=your_github_webhook_secret
GITHUB_APP_SLUG=your_app_slug
GITHUB_APP_FLOW_ENABLED=false
GITHUB_APP_NEW_USERS=false
# Optional: GitHub App Logging
GITHUB_APP_LOGGING=falseGenerate Prisma Client and run migrations:
# Generate Prisma Client
npx prisma generate
# Run database migrations
npx prisma migrate dev
# (Optional) View database in Prisma Studio
npx prisma studioImportant: Make sure you have these running:
- ngrok (Terminal 1) - provides public URL for webhooks
- Inngest Dev Server (Terminal 2) - handles background jobs
- Next.js dev server (Terminal 3) - your application
# Terminal 1: Start ngrok (keep running)
ngrok http 3000
# Terminal 2: Start Inngest Dev Server (keep running)
npx inngest-cli@latest dev
# Terminal 3: Start Next.js dev server
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devWe welcome contributions. See our Contributing Guide for details.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
