An open API service indexing awesome lists of open source software.

https://github.com/ghoshsurya/rapidcompiler

Professional online code editor & compiler with 14+ language support. Monaco Editor, real-time execution, project sharing. Open source alternative to Replit.
https://github.com/ghoshsurya/rapidcompiler

code-editor-online golang ide javascript monaco-editor multi-language online-compiler python react replit-alternative-open-source rust

Last synced: 3 months ago
JSON representation

Professional online code editor & compiler with 14+ language support. Monaco Editor, real-time execution, project sharing. Open source alternative to Replit.

Awesome Lists containing this project

README

          

# ๐Ÿš€ RapidCompiler - Professional Online Code Editor & Compiler

[![Live Demo](https://img.shields.io/badge/Live-Demo-brightgreen)](https://rapidcompiler.netlify.app)
[![GitHub](https://img.shields.io/badge/GitHub-Repository-blue)](https://github.com/ghoshsurya/rapidcompiler)
[![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

A production-ready, enterprise-grade online code editor and compiler platform with advanced features, security, and multi-language support. Built with modern technologies and optimized for performance.

## โœจ Key Features

### ๐ŸŽจ **Advanced Code Editor**
- **Monaco Editor** (VS Code engine) with syntax highlighting
- **Intelligent IntelliSense** for all supported languages
- **Custom code snippets** and autocomplete
- **Resizable panels** with drag-and-drop functionality
- **Dark/Light theme** with persistent preferences

### ๐Ÿ’ป **Multi-Language Support**
- **Python** 3.9+ with full library support
- **JavaScript** (Node.js 16) with ES6+ features
- **C/C++** with GCC compiler
- **Java** with OpenJDK 11
- **C#** with .NET runtime
- **PHP** with latest interpreter
- **SQL** with query execution
- **HTML/CSS/JS** with live preview

### ๐Ÿ” **Enterprise Security**
- **Docker containerization** for isolated execution
- **Resource limits**: 128MB RAM, CPU quotas
- **Network isolation** and timeout protection (10s)
- **JWT authentication** with secure token management
- **Input sanitization** and XSS protection

### ๐Ÿ‘ฅ **User Management**
- **Supabase authentication** integration
- **User profiles** with project history
- **Admin dashboard** for platform management
- **Project sharing** with unique URLs
- **Real-time collaboration** ready

### ๐Ÿ“ฆ **NPM Package Available**
- **React Component**: `npm install https://github.com/ghoshsurya/rapidcompiler/raw/main/ghoshsurya-rapidcompiler-react-1.0.0.tgz`
- **Easy Integration**: Drop-in Monaco Editor component
- **TypeScript Support**: Full type definitions included
- **GitHub Releases**: Available at [releases page](https://github.com/ghoshsurya/rapidcompiler/releases)

### ๐ŸŒ **Production Features**
- **SEO optimized** with meta tags and structured data
- **PWA ready** with offline capabilities
- **Responsive design** for all devices
- **Performance optimized** with code splitting
- **Error tracking** and logging

## ๐Ÿ—๏ธ Architecture

### **Frontend Stack**
```
React 18 + TypeScript
โ”œโ”€โ”€ Monaco Editor (VS Code)
โ”œโ”€โ”€ Tailwind CSS + PostCSS
โ”œโ”€โ”€ React Router v6
โ”œโ”€โ”€ Axios for API calls
โ”œโ”€โ”€ Lucide React icons
โ””โ”€โ”€ Supabase client
```

### **Backend Stack**
```
Python Flask + PostgreSQL
โ”œโ”€โ”€ Flask-JWT-Extended
โ”œโ”€โ”€ Flask-SQLAlchemy
โ”œโ”€โ”€ Docker Python SDK
โ”œโ”€โ”€ bcrypt encryption
โ”œโ”€โ”€ CORS middleware
โ””โ”€โ”€ Gunicorn WSGI
```

### **Infrastructure**
```
Docker + Docker Compose
โ”œโ”€โ”€ PostgreSQL 15 database
โ”œโ”€โ”€ Nginx reverse proxy
โ”œโ”€โ”€ Multi-stage builds
โ”œโ”€โ”€ Health checks
โ””โ”€โ”€ Volume persistence
```

## ๐Ÿš€ Quick Start

### Prerequisites
- **Docker** & **Docker Compose**
- **Node.js** 16+ and **npm**
- **Python** 3.9+ and **pip**
- **Git** for version control

### 1. Clone Repository
```bash
git clone https://github.com/ghoshsurya/rapidcompiler.git
cd rapidcompiler
```

### 2. Environment Setup
```bash
# Backend environment
cp backend/.env.example backend/.env

# Frontend environment
cp frontend/.env.example frontend/.env
```

### 3. Docker Deployment (Recommended)
```bash
# Start all services
docker-compose up --build

# Run in background
docker-compose up -d --build
```

### 4. Manual Development Setup
```bash
# Backend setup
cd backend
pip install -r requirements.txt
python app.py

# Frontend setup (new terminal)
cd frontend
npm install
npm start
```

### 5. Access Application
- **Frontend**: http://localhost:3000
- **Backend API**: http://localhost:5000
- **Database**: PostgreSQL on port 5432

## ๐Ÿ“ Project Structure

```
rapidcompiler/
โ”œโ”€โ”€ ๐Ÿ“ frontend/ # React application
โ”‚ โ”œโ”€โ”€ ๐Ÿ“ public/ # Static assets
โ”‚ โ”œโ”€โ”€ ๐Ÿ“ src/
โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ components/ # React components
โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ pages/ # Route pages
โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ hooks/ # Custom hooks
โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ lib/ # Utilities
โ”‚ โ”‚ โ””โ”€โ”€ ๐Ÿ“ utils/ # Helper functions
โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ package.json
โ”‚ โ””โ”€โ”€ ๐Ÿ“„ tailwind.config.js
โ”œโ”€โ”€ ๐Ÿ“ backend/ # Flask API server
โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ app.py # Main application
โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ requirements.txt # Python dependencies
โ”‚ โ””โ”€โ”€ ๐Ÿ“„ Dockerfile # Backend container
โ”œโ”€โ”€ ๐Ÿ“ database/ # Database schemas
โ”‚ โ””โ”€โ”€ ๐Ÿ“„ schema.sql # PostgreSQL schema
โ”œโ”€โ”€ ๐Ÿ“ docker/ # Docker configurations
โ”‚ โ””โ”€โ”€ ๐Ÿ“„ nginx.conf # Nginx config
โ”œโ”€โ”€ ๐Ÿ“ netlify/ # Serverless functions
โ”‚ โ””โ”€โ”€ ๐Ÿ“ functions/ # API functions
โ”œโ”€โ”€ ๐Ÿ“„ docker-compose.yml # Multi-container setup
โ”œโ”€โ”€ ๐Ÿ“„ netlify.toml # Netlify deployment
โ””โ”€โ”€ ๐Ÿ“„ README.md # Documentation
```

## ๐Ÿ”Œ API Documentation

### Authentication Endpoints
```http
POST /api/auth/register # User registration
POST /api/auth/login # User login
GET /api/auth/profile # Get user profile
```

### Code Execution
```http
POST /api/run # Execute code
{
"language": "python",
"code": "print('Hello World')",
"input": "optional input"
}
```

### Project Management
```http
GET /api/projects # List user projects
POST /api/projects # Create new project
GET /api/projects/:id # Get project details
PUT /api/projects/:id # Update project
DELETE /api/projects/:id # Delete project
POST /api/projects/:id/share # Share project
```

### Public Endpoints
```http
GET /api/share/:shareId # Get shared project
GET /api/health # Health check
```

## ๐Ÿ›ก๏ธ Security Implementation

### Code Execution Security
- **Docker isolation** with restricted containers
- **Resource limits**: Memory (128MB), CPU quotas
- **Network disabled** during execution
- **Timeout protection** (10 seconds max)
- **Temporary file cleanup**

### Authentication Security
- **JWT tokens** with expiration
- **bcrypt password hashing**
- **CORS protection**
- **Input validation** and sanitization
- **SQL injection prevention**

### Infrastructure Security
- **Environment variables** for secrets
- **Database connection pooling**
- **Rate limiting** ready
- **HTTPS enforcement** in production

## ๐ŸŒ SEO & Performance

### SEO Features
- **Meta tags** (Open Graph, Twitter Cards)
- **Structured data** (JSON-LD)
- **XML sitemap** generation
- **Robots.txt** optimization
- **Canonical URLs**
- **Semantic HTML5** structure

### Performance Optimizations
- **Code splitting** and lazy loading
- **Bundle optimization** with Webpack
- **Image optimization** and compression
- **CDN ready** for static assets
- **Caching strategies** implemented

## ๐Ÿš€ Deployment Options

### 1. Netlify (Frontend) + Railway (Backend)
```bash
# Frontend deployment
npm run build
netlify deploy --prod --dir=build

# Backend deployment
git push railway main
```

### 2. Docker Production
```bash
# Production build
docker-compose -f docker-compose.prod.yml up -d
```

### 3. AWS/GCP/Azure
- **Container deployment** with ECS/Cloud Run
- **Database**: RDS/Cloud SQL
- **Storage**: S3/Cloud Storage
- **CDN**: CloudFront/Cloud CDN

## ๐Ÿงช Testing

```bash
# Frontend tests
cd frontend
npm test

# Backend tests
cd backend
python -m pytest

# Integration tests
python test-api.py
python test-compilers.py
```

## ๐Ÿ“Š Monitoring & Analytics

- **Error tracking** with Sentry integration ready
- **Performance monitoring** with Web Vitals
- **User analytics** with Google Analytics
- **API monitoring** with health checks
- **Database monitoring** with connection pooling

## ๐Ÿค Contributing

1. **Fork** the repository
2. **Create** feature branch (`git checkout -b feature/amazing-feature`)
3. **Commit** changes (`git commit -m 'Add amazing feature'`)
4. **Push** to branch (`git push origin feature/amazing-feature`)
5. **Open** Pull Request

## ๐Ÿ“„ License

This project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.

## ๐Ÿ‘จ๐Ÿ’ป Author

**Suryakanta Ghosh** - [@ghoshsurya](https://github.com/ghoshsurya)

## ๐Ÿ’ฐ Support the Project

**RapidCompiler is free and open source!** Support development:

- โญ **Star** this repository
- ๐Ÿ’– **Sponsor** on [GitHub Sponsors](https://github.com/sponsors/ghoshsurya)
- โ˜๏ธ **Use** [RapidCompiler Cloud](https://rapidcompiler.com) (coming soon)
- ๐Ÿ› **Report** bugs and suggest features
- ๐Ÿค **Contribute** code and documentation

## ๐Ÿš€ RapidCompiler Cloud (SaaS)

**Coming Soon**: Hosted version with premium features:
- Real-time collaboration
- Private projects
- Advanced analytics
- Priority support
- Team workspaces

[Join Waitlist](https://rapidcompiler.com/waitlist) for early access!

## ๐Ÿ™ Acknowledgments

- **Monaco Editor** team for the excellent code editor
- **Docker** for containerization technology
- **React** and **Flask** communities
- **Open source** contributors

---


โญ Star this repository โ€ข ๐Ÿ’– Sponsor the project โ€ข โ˜๏ธ Try RapidCompiler Cloud