Skip to content

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

License

Notifications You must be signed in to change notification settings

ghoshsurya/rapidcompiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

98 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

πŸš€ RapidCompiler - Professional Online Code Editor & Compiler

Live Demo GitHub 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

🌐 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

git clone https://github.com/ghoshsurya/rapidcompiler.git
cd rapidcompiler

2. Environment Setup

# Backend environment
cp backend/.env.example backend/.env

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

3. Docker Deployment (Recommended)

# Start all services
docker-compose up --build

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

4. Manual Development Setup

# 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

πŸ“ 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

POST /api/auth/register    # User registration
POST /api/auth/login       # User login
GET  /api/auth/profile     # Get user profile

Code Execution

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

Project Management

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

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)

# Frontend deployment
npm run build
netlify deploy --prod --dir=build

# Backend deployment
git push railway main

2. Docker Production

# 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

# 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 file for details.

πŸ‘¨πŸ’» Author

Suryakanta Ghosh - @ghoshsurya

πŸ’° Support the Project

RapidCompiler is free and open source! Support development:

  • ⭐ Star this repository
  • πŸ’– Sponsor on GitHub Sponsors
  • ☁️ Use RapidCompiler Cloud (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 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