Skip to content

πŸš€ Online coding platform with Judge0 API integration. Write, compile & execute Java, C++, Python & JavaScript code with custom authentication.

Notifications You must be signed in to change notification settings

rohittrana/LeetLab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

LeetLab πŸš€

A modern online coding platform that allows users to write, compile, and execute code in multiple programming languages with real-time feedback.

🌟 Features

  • Multi-language Support: Write and execute code in Java, C++, JavaScript, and Python
  • Real-time Code Execution: Powered by Judge0 API for fast and secure code compilation
  • User Authentication: Custom-built login/signup system with secure session management
  • Clean UI: Modern, responsive interface built with React
  • Code Editor: Syntax highlighting and auto-completion for better coding experience
  • Test Cases: Run your code against custom input/output test cases
  • Results Dashboard: View execution time, memory usage, and output results

πŸ› οΈ Tech Stack

Frontend:

  • React.js
  • HTML5/CSS3
  • JavaScript (ES6+)
  • Responsive Design

Backend:

  • Node.js/Express.js (or your backend tech)
  • RESTful APIs
  • JSON Web Tokens (JWT) for authentication
  • bcrypt for password hashing

External APIs:

  • Judge0 API for code compilation and execution

Database:

  • MongoDB/PostgreSQL (specify your choice)

πŸ“ Project Structure

leetlab/
β”œβ”€β”€ frontend/           # React application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   └── App.js
β”‚   β”œβ”€β”€ public/
β”‚   └── package.json
β”œβ”€β”€ backend/            # Server application
β”‚   β”œβ”€β”€ controllers/
β”‚   β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ routes/
β”‚   β”œβ”€β”€ middleware/
β”‚   └── server.js
└── README.md

πŸš€ Getting Started

Prerequisites

  • Node.js (v14 or higher)
  • npm or yarn
  • Judge0 API key (get it from Judge0)

Installation

  1. Clone the repository

    git clone https://github.com/rohittrana/leetlab.git
    cd leetlab
  2. Setup Backend

    cd backend
    npm install

    Create a .env file in the backend folder:

    PORT=5000
    MONGODB_URI=your_mongodb_connection_string
    JWT_SECRET=your_jwt_secret_key
    JUDGE0_API_KEY=your_judge0_api_key
    JUDGE0_HOST=judge0-ce.p.rapidapi.com
  3. Setup Frontend

    cd ../frontend
    npm install
  4. Start the Application

    Start backend server:

    cd backend
    npm start

    Start frontend (in new terminal):

    cd frontend
    npm start
  5. Access the Application

    • Frontend: http://localhost:3000
    • Backend API: http://localhost:5000

🎯 How to Use

  1. Sign Up/Login: Create an account or login with existing credentials
  2. Choose Language: Select from Java, C++, JavaScript, or Python
  3. Write Code: Use the built-in code editor with syntax highlighting
  4. Add Input: Provide custom input for your program (optional)
  5. Execute: Click run to compile and execute your code
  6. View Results: See output, execution time, and memory usage

πŸ”§ API Endpoints

Authentication

  • POST /api/auth/register - User registration
  • POST /api/auth/login - User login
  • POST /api/auth/logout - User logout

Code Execution

  • POST /api/code/execute - Submit code for execution
  • GET /api/code/result/:id - Get execution results

🌐 Supported Languages

  • C++ - Fast execution for competitive programming
  • Java - Object-oriented programming with JVM
  • Python - Simple syntax, perfect for algorithms
  • JavaScript (Node.js) - Modern web development language

🀝 Contributing

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

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘¨β€πŸ’» Author

Rohit Rana

πŸ™ Acknowledgments

  • Judge0 for providing the code execution API
  • React community for the amazing frontend framework
  • Open source contributors who make projects like this possible

⭐ Star this repo if you found it helpful!# LeetLab πŸš€

A modern online coding platform that allows users to write, compile, and execute code in multiple programming languages with real-time feedback.

🌟 Features

  • Multi-language Support: Write and execute code in Java, C++, JavaScript, and Python
  • Real-time Code Execution: Powered by Judge0 API for fast and secure code compilation
  • User Authentication: Custom-built login/signup system with secure session management
  • Clean UI: Modern, responsive interface built with React
  • Code Editor: Syntax highlighting and auto-completion for better coding experience
  • Test Cases: Run your code against custom input/output test cases
  • Results Dashboard: View execution time, memory usage, and output results

πŸ› οΈ Tech Stack

Frontend:

  • React.js
  • HTML5/CSS3
  • JavaScript (ES6+)
  • Responsive Design

Backend:

  • Node.js/Express.js (or your backend tech)
  • RESTful APIs
  • JSON Web Tokens (JWT) for authentication
  • bcrypt for password hashing

External APIs:

  • Judge0 API for code compilation and execution

Database:

  • MongoDB/PostgreSQL (specify your choice)

πŸ“ Project Structure

leetlab/
β”œβ”€β”€ frontend/           # React application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   └── App.js
β”‚   β”œβ”€β”€ public/
β”‚   └── package.json
β”œβ”€β”€ backend/            # Server application
β”‚   β”œβ”€β”€ controllers/
β”‚   β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ routes/
β”‚   β”œβ”€β”€ middleware/
β”‚   └── server.js
└── README.md

πŸš€ Getting Started

Prerequisites

  • Node.js (v14 or higher)
  • npm or yarn
  • Judge0 API key (get it from Judge0)

Installation

  1. Clone the repository

    git clone https://github.com/rohittrana/leetlab.git
    cd leetlab
  2. Setup Backend

    cd backend
    npm install

    Create a .env file in the backend folder:

    PORT=5000
    MONGODB_URI=your_mongodb_connection_string
    JWT_SECRET=your_jwt_secret_key
    JUDGE0_API_KEY=your_judge0_api_key
    JUDGE0_HOST=judge0-ce.p.rapidapi.com
  3. Setup Frontend

    cd ../frontend
    npm install
  4. Start the Application

    Start backend server:

    cd backend
    npm start

    Start frontend (in new terminal):

    cd frontend
    npm start
  5. Access the Application

    • Frontend: http://localhost:3000
    • Backend API: http://localhost:5000

🎯 How to Use

  1. Sign Up/Login: Create an account or login with existing credentials
  2. Choose Language: Select from Java, C++, JavaScript, or Python
  3. Write Code: Use the built-in code editor with syntax highlighting
  4. Add Input: Provide custom input for your program (optional)
  5. Execute: Click run to compile and execute your code
  6. View Results: See output, execution time, and memory usage

πŸ”§ API Endpoints

Authentication

  • POST /api/auth/register - User registration
  • POST /api/auth/login - User login
  • POST /api/auth/logout - User logout

Code Execution

  • POST /api/code/execute - Submit code for execution
  • GET /api/code/result/:id - Get execution results

🌐 Supported Languages

  • C++ - Fast execution for competitive programming
  • Java - Object-oriented programming with JVM
  • Python - Simple syntax, perfect for algorithms
  • JavaScript (Node.js) - Modern web development language

🀝 Contributing

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

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘¨β€πŸ’» Author

Rohit Rana

πŸ™ Acknowledgments

  • Judge0 for providing the code execution API
  • React community for the amazing frontend framework
  • Open source contributors who make projects like this possible

⭐ Star this repo if you found it helpful!

About

πŸš€ Online coding platform with Judge0 API integration. Write, compile & execute Java, C++, Python & JavaScript code with custom authentication.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published