Skip to content

Leetcode clone that runs your solutions in a containerised environment

Notifications You must be signed in to change notification settings

myj009/leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Leetcode

This monorepo contains both the client and server components of the leetcode project. The client folder uses Nextjs with shadcn for the frontend, while the server folder uses Node.js for the backend. This project allows you to submit solutions in C++ for the problems on the website and run them in a containerised environment. The backend system which gets new submissions, pushes it to a RabbitMQ queue. A receiver reads it off the queue, starts (or creates) a container, and executes the code inside the sandbox environment. The result of the evaluation is the passed back to the caller, which updates the frontend.

Demo

3dc3131a-0afa-4330-8fc4-16116791d3e4.mp4

Prerequisites

Before running this project, please ensure that you have the following dependencies installed:

  • Node.js (v14 or higher)
  • Docker

Technologies used

  • Nextjs
  • Shadcn
  • RabbitMQ
  • PrismaORM
  • Postgres
  • Docker

Test Credentials

email - [email protected] password - password

Getting Started

Follow the steps below to start the project locally:

  1. Start the rabbitmq docker container Go to the /api directory and run
npm run start-containers
  1. Go to the /api folder. Copy the .env.example file to .env and fill in the required environment variables

  2. Start the backend server Go to the /api directory and run

npm install
npm run dev
  1. Start the frontend server Go to the /client directory and run
npm install
npm run dev

Make sure ports 3000, 3001 and 5672 are not in use.

About

Leetcode clone that runs your solutions in a containerised environment

Resources

Stars

Watchers

Forks