Skip to content

Latest commit

 

History

History
executable file
·
111 lines (85 loc) · 3.14 KB

File metadata and controls

executable file
·
111 lines (85 loc) · 3.14 KB

Code Room is an unbelievably fast online code editor and compiler which allows you for real time collaboration.

Features

  • Multi-language Support: Compile code in multiple programming languages.
  • Monaco Editor: Enjoy the same code editing experience as in VS Code, with features like indentation, syntax highlighting, and IntelliSense.
  • Real-time Collaboration: Code together with others in real-time.
  • Integrated Chat: Communicate seamlessly with your fellow collaborators.
  • Supported Language : JavaScript, Python, C++

Get Started

Option A: Run with Docker Compose (Recommended 🚀)

Ensure Docker and Docker Compose are installed on your machine.

  1. Clone the repository:

    git clone <link of this repo>
    cd CodeRoom
  2. Configure environment variables: Ensure your .env file in the root directory has your MySQL and JWT configuration:

    # For MySQL Database
    DB_HOST=mysql
    DB_USER=root
    DB_PASS=password
    DB_NAME=users
    DB_TABLE_NAME=userstable
    
    # For OTP Database
    DB_OTP_TABLE_NAME=otpverification
    OTP_EMAIL_SENDER=<me@gmail.com>
    
    # For OTP Nodemailer
    OTP_APP_PASSWORD=<Application password>
    OTP_EXPIRY=5
    
    # For JSON Web Token
    JWT_SECRET=your_jwt_secret_key_here
    JWT_LIFETIME=1hr
  3. Start all services (Frontend, Backend, MySQL):

    docker compose up --build
  4. Open in your browser:

    • Frontend: http://localhost:5173
    • Backend API: http://localhost:5001

Option B: Manual Local Setup (Without Docker)

Ensure Node.js and MySQL are installed locally.

  1. Start MySQL Service on your machine and ensure database users exists.

  2. Start Backend Server:

    cd server
    npm install
    npm start

    (Note: Set DB_HOST=localhost in .env when running locally outside Docker)

  3. Start Frontend App:

    npm install --legacy-peer-deps
    npm run dev
  4. Open in browser:

    http://localhost:5173/
    

Under the hood

  • React for Frontend UI
  • Node.js and Express for Backend API
  • MySQL for Database Management
  • Tailwind CSS for Styling
  • bcryptjs for Password Hashing
  • JWT (JSON Web Token) & Nodemailer OTP for Authentication
  • Monaco Editor for VS Code-like editing and IntelliSense
  • Socket.io for real-time collaborative editing & chat
  • Dockerized Execution Sandbox: Automatically pulls and isolates code execution environments using official lightweight images:
    • JavaScript: node:20-alpine
    • Python: python:3.12-alpine
    • C++: gcc:13-bookworm

Developers

Ostrich-egg
Adarsha
Pranaya-sht
XGPher35

This is a Third Semester project.