Editon is a next-generation AI-driven online code editor built with Next.js 15, Prisma, WebContainers, Monaco Editor, and NextAuth.
It brings an IDE-like experience to the browser — enhanced with AI chat, code review, code optimization, intelligent autocomplete (FIM), GitHub integration, and live runtime execution using WebContainers.
- AI chat assistant with multiple modes:
- 💬 Chat
- 🔍 Code Review
- 🔧 Fix Code
- ⚡ Optimize Code
- Intelligent code completion using Qwen 2.5 Coder (FIM-based predictions).
- Fill-in-the-middle autocompletion like Cursor & GitHub Copilot.
- Run Node.js code directly in the browser.
- Real terminal embedded inside the editor.
- Live preview panel with hot reload.
- Multi-file & folder explorer.
- File operations: Create, Rename, Delete files/folders.
- Syntax highlighting for all major languages.
- Smooth & responsive UI.
- Secure OAuth login (GitHub, Google).
- Full session management via NextAuth.
- Dashboard to manage projects & templates.
- Add GitHub repositories.
- Load project templates from GitHub.
- Future support for committing, pushing & syncing code.
Includes a huge library of front-end, back-end & full-stack templates, such as:
- Angular, Vue, Next.js, React
- Expres, Node
The project follows a modular architecture using the Next.js App Router, separating business logic (modules/) from UI components and routing.
halcyonic-01-edition/
├── app/ # Next.js App Router (Routing & Layouts)
│ ├── (root)/ # Marketing/Landing page routes
│ ├── api/ # Server-side API endpoints
│ │ ├── auth/ # NextAuth authentication handlers
│ │ ├── chat/ # AI Chat streaming endpoints
│ │ ├── code-completion/ # Intelligent code completion logic
│ │ ├── github/ # GitHub repo integration
│ │ └── template/ # Starter boilerplate logic
│ ├── auth/ # Authentication pages (Login/Register)
│ ├── dashboard/ # Protected user dashboard
│ └── playground/ # Main IDE interface (Monaco Editor)
│
├── components/ # Shared UI Components
│ ├── providers/ # Global state & theme providers
│ └── ui/ # Shadcn UI primitive components
│
├── hooks/ # Global Custom React Hooks
│
├── lib/ # Utilities, DB clients, and helpers
│
├── modules/ # Feature-Based Architecture (Business Logic)
│ ├── ai-chat/ # AI Assistant sidebar & logic
│ ├── auth/ # Auth forms and server actions
│ ├── dashboard/ # Dashboard widgets and layout logic
│ ├── home/ # Landing page specific components
│ ├── playground/ # Editor state, file tree, & settings
│ └── webcontainers/ # In-browser Node.js runtime logic
│
├── prisma/ # Database Schema & Migrations
│
├── vibecode-starters/ # Template definitions for new projects
│
├── auth.ts # NextAuth initialization
├── auth.config.ts # OAuth & Session configuration
├── middleware.ts # Edge middleware for route protection
└── routes.ts # Centralized route definitions
Each request is processed with:
- Full conversation history
- System prompt based on mode
- AI model: qwen2.5-coder:7b
Modes:
| Mode | Purpose |
|---|---|
| chat | General programming Q/A |
| review | Find bugs, issues, vulnerabilities |
| fix | Identify + fix broken code |
| optimize | Improve performance & readability |
The editor sends:
- Full content before cursor
- Full content after cursor
- Cursor metadata
- Programming language + framework detection
Using FIM prompt format: <|fim_prefix|> BEFORE_CODE <|fim_suffix|> AFTER_CODE <|fim_middle|>
Model returns the missing middle part → becomes the suggestion.
This creates Copilot-like inline completions.
- Next.js 15 + App Router
- React 19
- Tailwind CSS (v4)
- Shadcn UI
- Monaco Editor
- Zustand (state management)
- Lucide Icons
- Next.js API routes
- Prisma ORM
- MongoDB (via Prisma)
- NextAuth (JWT strategy)
- Qwen 2.5 Coder (7B)
- Ollama backend (
localhost:11434)
- WebContainers by Stackblitz
- XTerm.js terminal
git clone https://github.com/Halcyonic-01/Editon.git
cd ai-vibe-code-editor2️⃣ Install dependencies
npm install3️⃣ Environment variables
Create a .env file:
AUTH_GITHUB_ID=
AUTH_GITHUB_SECRET=
AUTH_GOOGLE_ID=
AUTH_GOOGLE_SECRET=
NEXTAUTH_SECRET=
DATABASE_URL=
AUTH_SECRET=4️⃣ Setup Prisma
npx prisma generate
npx prisma db push5️⃣ Run AI Model (Ollama)
ollama run qwen2.5-coder:7b6️⃣ Start the development server
npm run dev- 🔐 OAuth: Secure integration with GitHub + Google.
- 🔄 PrismaAdapter: Used for handling persistent user accounts.
- 🚧 Middleware: Protects private routes (e.g., dashboard, playground).
- 🪪 Sessions: JWT-based session management.
- 👤 Custom Token: Session token extended to include user
role+userId.
- ✨ Hero Section: Features a modern gradient aesthetic.
- 🌓 Theme: Built-in Light/Dark mode toggles.
- 📊 Dashboard: Clean, modern interface built with shadcn/ui.
- 📱 Layouts: Fully responsive design for all devices.
- ⚡ Editor: Lightning-fast coding experience.
Contributions are welcome! You can help the project by:
- 🐛 Submitting issues.
- 📝 Suggesting new templates.
- 🤖 Improving AI prompts.
- 🔌 Adding new integrations.
If you like the project, please give it a ⭐ on GitHub!