AI-powered cloud-based code editor with WebContainer integration.
Editron is a modern web-based code editor that runs entirely in your browser. It provides a VS Code-like experience with AI-powered code suggestions and the ability to run Node.js applications directly in the browser using WebContainer technology.
- AI Code Intelligence - Smart code completions and suggestions powered by Groq AI
- Browser-based Development - Full coding environment in your browser, no local setup required
- WebContainer Integration - Run Node.js apps directly in the browser
- Multiple Frameworks - Support for React, Next.js, Vue, Angular, Express, and more
- Monaco Editor - VS Code editor experience with syntax highlighting
- GitHub Authentication - Secure login with your GitHub account
- Real-time Preview - See your changes instantly
- Project Management - Create, save, and manage multiple projects
- Node.js 18+
- MongoDB database
- GitHub OAuth App
-
Clone the repository
git clone https://github.com/shrivarshapoojari/Editron.git cd Editron/editron -
Install dependencies
npm install
-
Set up environment variables
Create a
.env.localfile in the root directory:# Database DATABASE_URL="your_mongodb_connection_string" # NextAuth AUTH_SECRET="your_auth_secret_key" NEXTAUTH_URL="http://localhost:3000" # GitHub OAuth AUTH_GITHUB_ID="your_github_client_id" AUTH_GITHUB_SECRET="your_github_client_secret" # Groq AI GROQ_API_KEY="your_groq_api_key"
-
Set up the database
npx prisma generate npx prisma db push
-
Run the development server
npm run dev
-
Open your browser
Navigate to
http://localhost:3000
- Go to GitHub Settings > Developer settings > OAuth Apps
- Create a new OAuth App with:
- Homepage URL:
http://localhost:3000 - Authorization callback URL:
http://localhost:3000/api/auth/callback/github
- Homepage URL:
- Copy the Client ID and Client Secret to your
.env.localfile
- Sign up at Groq Console
- Create an API key
- Add the API key to your
.env.localfile
- xterm.js - Terminal emulator in browser
- Turbopack - Fast bundler for development
- Groq AI - Fast AI inference for code completion
- Sonner - Beautiful toast notifications
Before you begin, ensure you have the following installed:
- Node.js (v18.0.0 or higher)
- npm or yarn or pnpm
- Git
- MongoDB Atlas account (free tier available)
- GitHub account (for OAuth)
- Groq API account (for AI features)
git clone https://github.com/shrivarshapoojari/Editron.git
cd Editron/editron# Using npm
npm install
# Using yarn
yarn install
# Using pnpm
pnpm installCreate a .env file in the root directory and add the following variables:
# Database Configuration
DATABASE_URL="your_mongodb_connection_string"
# Authentication Configuration
AUTH_SECRET="your_nextauth_secret_key"
AUTH_GITHUB_ID="your_github_oauth_app_id"
AUTH_GITHUB_SECRET="your_github_oauth_app_secret"
# AI Configuration
GROQ_API_KEY="your_groq_api_key"# Generate Prisma client
npx prisma generate
# Push database schema (for MongoDB)
npx prisma db push
# Optional: Open Prisma Studio to view data
npx prisma studio# Start the development server with Turbopack
npm run dev
# Or with specific package managers
yarn dev
pnpm devThe application will be available at http://localhost:3000
- Create Account: Sign up at MongoDB Atlas
- Create Cluster: Create a free M0 cluster
- Database Access: Create a database user with read/write access
- Network Access: Add your IP address (or 0.0.0.0/0 for development)
- Connection String: Copy the connection string and replace
<password>with your database password
- GitHub Settings: Go to GitHub Settings β Developer settings β OAuth Apps
- New OAuth App: Create a new OAuth application
- Application Details:
- Application name: Editron Local
- Homepage URL:
http://localhost:3000 - Authorization callback URL:
http://localhost:3000/api/auth/callback/github
- Credentials: Copy the Client ID and Client Secret
- Create Account: Sign up at Groq Console
- API Key: Generate a new API key
- Model Access: Ensure you have access to the required models
Generate a secure random string for AUTH_SECRET:
# Using OpenSSL
openssl rand -base64 32
# Using Node.js
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"editron/
βββ app/ # Next.js App Router
β βββ (auth)/ # Authentication pages
β βββ (root)/ # Public pages
β βββ api/ # API routes
β βββ dashboard/ # Dashboard pages
β βββ playground/ # Code editor pages
β βββ coming-soon/ # Feature preview pages
βββ components/ # Reusable UI components
β βββ ui/ # Shadcn/UI components
β βββ providers/ # Context providers
βββ modules/ # Feature modules
β βββ ai-chat/ # AI chat functionality
β βββ auth/ # Authentication logic
β βββ dashboard/ # Dashboard components
β βββ playground/ # Code editor logic
β βββ webcontainers/ # WebContainer integration
βββ prisma/ # Database schema and migrations
βββ public/ # Static assets
βββ vibecode-starters/ # Project templates
βββ lib/ # Utility functions
Editron comes with a variety of pre-configured project templates:
- React - Modern React with Vite
- React TypeScript - React with TypeScript
- Next.js - Full-stack React framework
- Vue.js - Progressive JavaScript framework
- Angular - Enterprise-scale applications
- Svelte/SvelteKit - Compile-time optimized framework
- Express.js - Minimal Node.js framework
- Hono - Ultrafast web framework
- GSAP + React - Animation library integration
- Bootstrap 5 - Popular CSS framework
- Tailwind CSS - Utility-first CSS
- TypeScript - Type-safe JavaScript
- Vite - Fast build tool
- JSON Server - Mock REST API
# Create production build
npm run build
# Start production server
npm run startEnsure all environment variables are configured in your deployment platform:
DATABASE_URL=your_production_mongodb_url
AUTH_SECRET=your_production_auth_secret
AUTH_GITHUB_ID=your_github_oauth_id
AUTH_GITHUB_SECRET=your_github_oauth_secret
GROQ_API_KEY=your_groq_api_key# Development server with Turbopack
npm run dev
# Build for production
npm run build
# Start production server
npm run start
# Database operations
npx prisma generate # Generate Prisma client
npx prisma db push # Push schema changes
# Code quality (currently disabled)
npm run lint- GitHub Repository Import - One-click import from GitHub
- Real-time Collaboration - Multiple users editing simultaneously
- Advanced AI Features - Code refactoring and optimization
- Custom Templates - Create and share your own templates
- Deployment Integration - Deploy directly to cloud platforms
- Mobile App - Native mobile applications