This is a CodeVue - A Leetcode, CodeChief Inspired Platform designed to help developers practice coding challenges in multiple programming languages (JavaScript, Python, Java). The platform includes features such as:
- Problem Descriptions: Detailed problem descriptions, examples, constraints, and hints.
- Test Cases: Predefined test cases for each problem to validate solutions.
- Multi-Language Support: Write solutions in JavaScript, Python, or Java.
- Submission Tracking: View submission history, memory usage, runtime, and status (Accepted, Wrong Answer, etc.).
- Each problem includes:
- Description
- Examples with inputs, outputs, and explanations
- Constraints
- Editorial (hints and optimal solutions)
- Secure login and registration for tracking user progress and submissions.
- Admins can add new problems, manage submissions.
- Backend: Node.js, Express.js
- Database: PostgreSQL (or Prisma ORM)
- Authentication: JWT (JSON Web Tokens)
- Code Execution: Judge0 API (for running and validating code submissions)
- Version Control: Git, GitHub
- Node.js (v16 or higher)
- npm or yarn
- PostgreSQL database
- Judge0 API
-
Clone the Repository
git clone https://github.com/Aestheticsuraj234/chai-or-leetcode.git
cd backendcd frontend -
Install Dependencies
npm install
-
Setup Prisma
npx prisma init
-
This will create a new
prisma/folder with aschema.prismafile inside, and also add a.envfile at the root of your project. -
If you haven't installed Prisma yet, first install it with:
npm install prisma --save-dev
-
And if you also want the Prisma Client to query your database:
npm install @prisma/client
-
To start a local PostgreSQL container for development, run the following Docker command:
docker run --name <databasename> -e POSTGRES_USER=<username> -e POSTGRES_PASSWORD=<password> -p 5432:5432 -d postgres
-
Set Up Environment Variables Create a
.envfile in the root directory and add the following variables:PORT = DATABASE_URL= JWT_SECRET= JUDGE0_API_URL=http://localhost:2358/ || http://localhost:<Your Judge0 Server Port>/ || Your Api link
-
Run the Development Server
npm run dev