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.
3dc3131a-0afa-4330-8fc4-16116791d3e4.mp4
Before running this project, please ensure that you have the following dependencies installed:
- Node.js (v14 or higher)
- Docker
- Nextjs
- Shadcn
- RabbitMQ
- PrismaORM
- Postgres
- Docker
email - [email protected]
password - password
Follow the steps below to start the project locally:
- Start the rabbitmq docker container Go to the /api directory and run
npm run start-containers
-
Go to the /api folder. Copy the .env.example file to .env and fill in the required environment variables
-
Start the backend server Go to the /api directory and run
npm install
npm run dev
- 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.