Skip to content

Path3010/AI-IDE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ AI-IDE - Professional Web-Based Development Environment

Node.js Version Docker PRs Welcome GitHub Repo

A powerful, local-first web IDE with AI assistance, cloud synchronization, and secure code execution. Built for developers who demand professional tools with enterprise-grade security.


✨ Key Features

🎨 Advanced Code Editor

  • Monaco Editor (VS Code's editor) with full IntelliSense
  • Multi-language syntax highlighting (Python, JavaScript, Java, C++, and more)
  • Split editor support for side-by-side coding
  • Real-time file watching and auto-refresh
  • 28+ language support

πŸ€– AI Code Assistant

  • Powered by Groq - Fast, free LLM integration
  • Intelligent code completion with inline suggestions
  • Context-aware code explanation and documentation
  • AI-driven refactoring suggestions
  • Interactive chat for coding help

πŸ’» Integrated Terminal

  • Browser-based terminal with full ANSI support
  • Auto-detect programming languages from file extensions
  • One-click code execution with live output
  • Multiple terminal sessions support
  • Real-time WebSocket streaming

🐳 Universal Code Execution

  • Single Docker container for all languages (Python, Node.js, Java, C++)
  • Secure sandboxing with resource limits
  • Isolated execution environment
  • Automatic dependency management
  • File watching and hot reload

☁️ Google Drive Integration

  • Seamless project storage and synchronization
  • OAuth2 authentication
  • Automatic backup and versioning
  • Offline-first with background sync
  • Share projects with collaborators

πŸ”’ Enterprise Security

  • Container isolation for code execution
  • Non-root user execution
  • Resource limits (CPU, memory, time)
  • Encrypted token storage
  • Rate limiting and DDoS protection

πŸ—οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         Frontend Layer                            β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚   Monaco   β”‚  β”‚   xterm.js β”‚  β”‚  AI Chat   β”‚  β”‚   Drive    β”‚ β”‚
β”‚  β”‚   Editor   β”‚  β”‚  Terminal  β”‚  β”‚ Assistant  β”‚  β”‚   Sync     β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚         React + Vite + WebSocket + REST API                      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                       Backend Layer (Node.js)                     β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚    Auth    β”‚  β”‚    File    β”‚  β”‚     AI     β”‚  β”‚  Execution β”‚ β”‚
β”‚  β”‚  Service   β”‚  β”‚  Service   β”‚  β”‚  Service   β”‚  β”‚  Service   β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚         Express + MongoDB + Google APIs + WebSocket              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Execution Layer (Docker)                       β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚         Universal Container (Alpine Linux)               β”‚   β”‚
β”‚  β”‚  Python 3.11  β”‚  Node.js 18  β”‚  Java 17  β”‚  G++ 12     β”‚   β”‚
β”‚  β”‚  Isolated Execution β”‚  Resource Limits β”‚  Security      β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Technology Stack

Frontend

  • Framework: React + Vite
  • Editor: Monaco Editor (VS Code)
  • Terminal: xterm.js + xterm-addon-fit
  • Styling: Modern CSS3
  • State Management: React Context API
  • HTTP Client: Axios
  • WebSocket: Native WebSocket API

Backend

  • Runtime: Node.js
  • Framework: Express.js
  • Database: MongoDB
  • Authentication: Google OAuth2
  • Storage: Google Drive API v3
  • AI Engine: Groq API (llama-3.3-70b)
  • Real-time: WebSocket (ws)

Infrastructure

  • Containerization: Docker 24+
  • Orchestration: Docker Compose
  • Base Image: Alpine Linux 3.18
  • Languages: Python 3.11, Node 18, Java 17, GCC 12

Security

  • Isolation: Docker containers
  • Encryption: bcrypt + crypto
  • Rate Limiting: express-rate-limit
  • CORS: Configured domains
  • Helmet: Security headers

οΏ½ Quick Start Guide

Prerequisites

Ensure you have the following installed:

Software Version Purpose
Node.js β‰₯18.0.0 LTS Backend & Frontend runtime
Docker Desktop β‰₯20.10 Code execution containers
Git Latest Version control
MongoDB β‰₯6.0 (optional) Database (or use MongoDB Atlas)

Installation Steps

1️⃣ Clone Repository

git clone https://github.com/Path3010/AI-IDE.git
cd AI-IDE

2️⃣ Configure Environment

# Backend configuration
cd backend
cp .env.example .env

3️⃣ Build Docker Image

# Windows
scripts\build-runners.bat

# Linux/Mac
chmod +x scripts/build-runners.sh
./scripts/build-runners.sh

4️⃣ Start Services

# Development mode (recommended)
cd backend
npm install
nodemon

# In a new terminal
cd frontend
npm install
npm run dev

5️⃣ Access Application

Quick Setup Script (Windows)

scripts\setup-tools.bat
scripts\start-dev.bat

πŸ“ Project Structure

AI-IDE/
β”œβ”€β”€ πŸ“‚ frontend/                    # React application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/            # UI components
β”‚   β”‚   β”‚   β”œβ”€β”€ EnhancedMonacoEditor.jsx   # Code editor
β”‚   β”‚   β”‚   β”œβ”€β”€ Terminal.jsx               # Integrated terminal
β”‚   β”‚   β”‚   β”œβ”€β”€ AIAssistant.jsx            # AI chat interface
β”‚   β”‚   β”‚   β”œβ”€β”€ FileExplorer.jsx           # File tree
β”‚   β”‚   β”‚   └── SplitEditor.jsx            # Split view editor
β”‚   β”‚   β”œβ”€β”€ services/              # API clients
β”‚   β”‚   β”œβ”€β”€ hooks/                 # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ context/               # Global state
β”‚   β”‚   └── App.jsx                # Main application
β”‚   └── package.json
β”‚
β”œβ”€β”€ πŸ“‚ backend/                     # Node.js API server
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ controllers/           # Route handlers
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.controller.js         # Authentication
β”‚   β”‚   β”‚   β”œβ”€β”€ execution.controller.js    # Code execution
β”‚   β”‚   β”‚   β”œβ”€β”€ file.controller.js         # File operations
β”‚   β”‚   β”‚   └── ai.controller.js           # AI features
β”‚   β”‚   β”œβ”€β”€ services/              # Business logic
β”‚   β”‚   β”‚   β”œβ”€β”€ execution.service.js       # Docker management
β”‚   β”‚   β”‚   β”œβ”€β”€ fileWatcher.service.js     # File monitoring
β”‚   β”‚   β”‚   └── ai.service.js              # Groq integration
β”‚   β”‚   β”œβ”€β”€ lib/                   # Core libraries
β”‚   β”‚   β”‚   β”œβ”€β”€ containerManager.js        # Container lifecycle
β”‚   β”‚   β”‚   β”œβ”€β”€ terminalManager.js         # WebSocket terminals
β”‚   β”‚   β”‚   └── driveService.js            # Google Drive API
β”‚   β”‚   β”œβ”€β”€ middleware/            # Express middleware
β”‚   β”‚   β”œβ”€β”€ models/                # MongoDB schemas
β”‚   β”‚   └── index.js               # Server entry point
β”‚   └── package.json
β”‚
β”œβ”€β”€ πŸ“‚ runner-images/               # Docker configurations
β”‚   └── universal/                 # Universal runtime
β”‚       β”œβ”€β”€ Dockerfile             # Multi-language container
β”‚       └── entrypoint.sh          # Container startup
β”‚
β”œβ”€β”€ πŸ“‚ scripts/                     # Automation scripts
β”‚   β”œβ”€β”€ build-runners.bat          # Build Docker images (Windows)
β”‚   β”œβ”€β”€ build-runners.sh           # Build Docker images (Linux/Mac)
β”‚   β”œβ”€β”€ start-dev.bat              # Start development
β”‚   └── diagnose-issues.bat        # System diagnostics
β”‚
β”œβ”€β”€ πŸ“‚ docs/                        # Documentation
β”‚   β”œβ”€β”€ features/                  # Feature guides
β”‚   β”œβ”€β”€ project-requirements.md    # Requirements specification
β”‚   β”œβ”€β”€ project-design.md          # System design
β”‚   └── SETUP_GOOGLE_OAUTH.md      # OAuth setup guide
β”‚
β”œβ”€β”€ πŸ“‚ infra/                       # Infrastructure
β”‚   β”œβ”€β”€ docker-compose.dev.yml     # Development compose
β”‚   └── mongodb/                   # Database setup
β”‚
β”œβ”€β”€ .gitignore                      # Git ignore rules
β”œβ”€β”€ package.json                    # Root package config
β”œβ”€β”€ README.md                       # This file
└── LICENSE                         # MIT License

πŸ§ͺ Development & Testing

Frontend Development

cd frontend
npm install
npm run dev          # Start Vite dev server (localhost:3000)
npm run build        # Production build
npm run preview      # Preview production build
npm run lint         # Run ESLint

Backend Development

cd backend
npm install
npm run dev          # Start with nodemon (localhost:3001)
npm run start        # Production server
npm test             # Run tests
npm run lint         # Run ESLint

Docker Operations

# Build universal runner
docker build -t ai-ide-universal-runner runner-images/universal/

# Test container
docker run --rm ai-ide-universal-runner python3 --version

# Check running containers
docker ps

# View logs
docker logs <container_id>

# Clean up
docker system prune -a

Testing Commands

# Unit tests
npm test

# E2E tests
npm run test:e2e

# Coverage report
npm run test:coverage

# Watch mode
npm run test:watch

πŸ” Security Features

Feature Implementation Status
Container Isolation Docker sandboxing βœ… Active
Resource Limits CPU/Memory/Time constraints βœ… Active
Non-root Execution Unprivileged user (coderunner) βœ… Active
Network Isolation No internet access in containers βœ… Active
Token Encryption bcrypt + crypto for OAuth tokens βœ… Active
Rate Limiting 100 requests/15min per IP βœ… Active
CORS Protection Whitelist allowed origins βœ… Active
Security Headers Helmet.js middleware βœ… Active
Input Validation Sanitization & validation βœ… Active
Audit Logging All actions logged βœ… Active

Container Security Configuration

# Non-root user
USER coderunner

# Resource limits
--memory=512m
--cpus=1.0
--pids-limit=100

# Network isolation
--network=none

# Read-only root filesystem
--read-only

# Security options
--security-opt=no-new-privileges

πŸ§ͺ Testing

# Run all tests
npm test

# Frontend tests
cd frontend && npm test

# Backend tests
cd backend && npm test

# E2E tests
npm run test:e2e

πŸ“š Documentation

Feature Documentation

Project Documentation

  • Requirements - Functional and technical requirements
  • Design - System architecture and API specifications
  • Work Plan - Sprint breakdown and implementation plan
  • OAuth Setup - Google Cloud Console configuration

🎯 Usage Examples

Creating a New Project

// From the IDE interface:
1. Click "New Project" in File Explorer
2. Enter project name
3. Choose template (Python, Node.js, Java, C++)
4. Start coding!

Running Code

# Write your code in the editor
print("Hello from AI-IDE!")

# Click the "Run" button or use:
# - Ctrl+Enter (Windows/Linux)
# - Cmd+Enter (Mac)

# Output appears in the integrated terminal

Using AI Assistant

// 1. Inline completion
function calculateSum(   // Wait 800ms, AI suggests completion

// 2. Chat assistant
// Click AI icon β†’ Ask: "Explain async/await in JavaScript"

// 3. Code explanation
// Select code β†’ Right-click β†’ "Explain Code"

// 4. Refactoring
// Select code β†’ Right-click β†’ "Get Refactoring Suggestions"

File Synchronization

# All changes auto-sync to Google Drive
# Status indicator shows sync progress
# Offline changes sync when connection restored

πŸš€ Deployment

Production Build

# Build frontend
cd frontend
npm run build
# Output: frontend/dist/

# Build backend (if needed)
cd backend
npm run build 

Docker Compose Production

# Start all services
docker-compose -f docker-compose.yml up -d

# View logs
docker-compose logs -f

# Stop services
docker-compose down

Cloud Platforms

Render

# render.yaml
services:
  - type: web
    name: ai-ide-backend
    env: docker
    dockerfilePath: ./backend/Dockerfile
    
  - type: web
    name: ai-ide-frontend
    env: docker
    dockerfilePath: ./frontend/Dockerfile

Railway

# Deploy with Railway CLI
railway init
railway up

Self-Hosted VPS

# Clone repository
git clone https://github.com/Path3010/AI-IDE.git

# Setup environment
cd AI-IDE
cp backend/.env.example backend/.env
# Edit .env with production credentials

# Start with Docker Compose
docker-compose up -d

# Setup NGINX reverse proxy (optional)
sudo apt install nginx
# Configure NGINX for https://yourdomain.com

Environment Variables (Production)

# Backend (.env)
NODE_ENV=production
PORT=3001
MONGODB_URI=mongodb+srv://...
GOOGLE_CLIENT_ID=your_client_id
GOOGLE_CLIENT_SECRET=your_client_secret
GROQ_API_KEY=your_groq_key
SESSION_SECRET=strong_random_secret
FRONTEND_URL=https://yourdomain.com

# Frontend (build time)
VITE_API_URL=https://api.yourdomain.com

🀝 Contributing

We welcome contributions from the community! Here's how you can help:

Getting Started

  1. Fork the repository on GitHub
  2. Clone your fork locally
  3. Create a feature branch: git checkout -b feature/your-feature-name
  4. Make your changes following our coding standards
  5. Test your changes thoroughly
  6. Commit with clear messages: git commit -m "Add: feature description"
  7. Push to your fork: git push origin feature/your-feature-name
  8. Open a Pull Request with detailed description

Coding Standards

  • Style Guide: Follow ESLint + Prettier configurations
  • Naming: Use camelCase for variables, PascalCase for components
  • Comments: Document complex logic with JSDoc
  • Testing: Write unit tests for new features
  • Commits: Use conventional commit messages (feat:, fix:, docs:)

Pull Request Guidelines

  • Keep PRs focused on a single feature/fix
  • Include tests for new functionality
  • Update documentation as needed
  • Ensure all CI checks pass
  • Respond to review feedback promptly

Areas Needing Help

  • πŸ› Bug fixes and testing
  • πŸ“– Documentation improvements
  • 🌐 Internationalization (i18n)
  • β™Ώ Accessibility enhancements
  • 🎨 UI/UX improvements
  • ⚑ Performance optimizations

πŸ™ Acknowledgments

  • Monaco Editor - VS Code's editor in the browser
  • xterm.js - Terminal emulator for the web
  • Docker - Container platform for secure execution
  • Google Drive API - Cloud storage integration
  • Open Source Community - For amazing tools and libraries

Contributors

Special thanks to all contributors who have helped build and improve AI-IDE!


πŸ“Š Performance Metrics

Metric Value Status
Initial Load Time < 2s βœ…
Code Execution < 500ms βœ…
AI Response Time < 2s βœ…
File Sync Latency < 1s βœ…
Container Startup < 1s βœ…

πŸ—ΊοΈ Roadmap

Future Enhancements

  • Real-time collaboration
  • Git integration
  • Debugger support
  • Plugin system
  • Mobile support

πŸ“ž Support & Contact


⭐ Star us on GitHub!

Built with ❀️ by developers, for developers

Empowering coders with AI-powered development tools

Report Bug β€’ Request Feature β€’ Documentation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published