{"id":25273105,"url":"https://github.com/rahul-shrivastav/leetcode-clone","last_synced_at":"2026-05-05T14:33:34.438Z","repository":{"id":255347989,"uuid":"825964159","full_name":"rahul-shrivastav/Leetcode-clone","owner":"rahul-shrivastav","description":"CodeArena - A competitive coding platform where user can practise coding questions, made with NextJS, Python, Redis and MongoDB.","archived":false,"fork":false,"pushed_at":"2025-11-03T10:14:36.000Z","size":390,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-03T12:10:05.899Z","etag":null,"topics":["flask","nextauth","nextjs14","python","tailwind-css","tyepscript"],"latest_commit_sha":null,"homepage":"https://codearena-pi.vercel.app/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rahul-shrivastav.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-07-08T21:07:34.000Z","updated_at":"2025-11-03T10:14:40.000Z","dependencies_parsed_at":"2024-08-29T12:47:15.541Z","dependency_job_id":"2076333e-d1b5-42d0-ba94-f45e76defe0c","html_url":"https://github.com/rahul-shrivastav/Leetcode-clone","commit_stats":null,"previous_names":["rahul-shrivastav/leetcode-clone"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rahul-shrivastav/Leetcode-clone","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahul-shrivastav%2FLeetcode-clone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahul-shrivastav%2FLeetcode-clone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahul-shrivastav%2FLeetcode-clone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahul-shrivastav%2FLeetcode-clone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rahul-shrivastav","download_url":"https://codeload.github.com/rahul-shrivastav/Leetcode-clone/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahul-shrivastav%2FLeetcode-clone/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32653583,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","nextauth","nextjs14","python","tailwind-css","tyepscript"],"created_at":"2025-02-12T13:49:26.723Z","updated_at":"2026-05-05T14:33:34.426Z","avatar_url":"https://github.com/rahul-shrivastav.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# CodeArena\n\n![Node.js](https://img.shields.io/badge/Node.js-339933?style=for-the-badge\u0026logo=nodedotjs\u0026logoColor=white)\n![Next.js](https://img.shields.io/badge/Next.js-000000?style=for-the-badge\u0026logo=nextdotjs\u0026logoColor=white)\n![TailwindCSS](https://img.shields.io/badge/TailwindCSS-06B6D4?style=for-the-badge\u0026logo=tailwindcss\u0026logoColor=white)\n![Python](https://img.shields.io/badge/Python-3776AB?style=for-the-badge\u0026logo=python\u0026logoColor=white)\n![Flask](https://img.shields.io/badge/Flask-000000?style=for-the-badge\u0026logo=flask\u0026logoColor=white)\n![React](https://img.shields.io/badge/React-61DAFB?style=for-the-badge\u0026logo=react\u0026logoColor=black)\n![Redis](https://img.shields.io/badge/Redis-DC382D?style=for-the-badge\u0026logo=redis\u0026logoColor=white)\n![MongoDB](https://img.shields.io/badge/MongoDB-47A248?style=for-the-badge\u0026logo=mongodb\u0026logoColor=white)\n\n\u003c/div\u003e\n\nWelcome to CodeArena – a platform for practicing and solving coding problems, similar to LeetCode. Built with Next.js 14, MongoDB, and NextAuth, CodeArena provides a smooth user experience to enhance your coding skills and connect with others.\n\n\u003cdiv align=\"center\"\u003e\n\n[![VISIT](https://img.shields.io/badge/-VISIT-blue?style=for-the-badge)](https://codearena-pi.vercel.app/)\n\n\u003c/div\u003e\n\n## Tech Stack\n\n-   `Next.js` : A React-based framework for building server-rendered and static web applications, offering features like routing, API handling, and optimized performance.\n-   `React.js` : A JavaScript library for building dynamic user interfaces with reusable components.\n-   `Node.js`: A server-side runtime that allows running JavaScript on the backend.\n-   `MongoDB ` : A NoSQL database that stores data in flexible, JSON-like documents.\n-   `Tailwind-CSS` : A utility-first CSS framework for building custom, responsive designs quickly by composing classes directly in HTML.\n-   `Redis` : An in-memory data structure store commonly used as a database, cache, and message broker. I used it as a message queue to efficiently manage and process background tasks.\n\n\u003cdiv align=\"center\"\u003e\n\n## Workflow\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n\u003cimg width=\"700\"  alt=\"Screenshot 2025-08-24 155855\" src=\"https://github.com/user-attachments/assets/f9e5632e-2fb4-495c-893d-cd1f5d11dfa6\" /\u003e\n\n\u003c/div\u003e\n\n-   User submits code from the frontend (React or similar).\n\n-   API Service (Flask + Gunicorn) accepts the submission, stores metadata in MongoDB (status = pending), and pushes the job into Redis queue.\n\n-   Worker Service (Flask background service with thread pool) pulls jobs from Redis, executes user code safely (via subprocess or Docker depending on environment), and updates the MongoDB record with results.\n\n-   Frontend polls MongoDB via the API to check if submission results are available (status = executed).\n\n\u003cdiv align=\"center\"\u003e\n\n## Getting Started\n\n\u003c/div\u003e\n\n### 1. Clone the Repository\n\nFirst, clone the repository to your local machine:\n\n```bash\ngit clone https://github.com/rahul-shrivastav/Leetcode-clone.git\n```\n\n### 2. Install Dependencies\n\nInstall the required dependencies by running:\n\n```bash\ncd frontend\nnpm install\ncd ../backend/api_service\npip install -r requirements.txt\ncd ../execution_service\npip install -r requirements.txt\n```\n\n### 3. Setup Environment Variables\n\nTo run this project, you will need to add the following environment variables to your .env file\n\n```bash\nMONGO_DB_URI=\nAUTH_SECRET =\nGOOGLE_CLIENT_ID =\nGOOGLE_CLIENT_SECRET =\n\nNEXTAUTH_URL= http://localhost:3000\nNEXT_PUBLIC_NEXTAUTH_URL= http://localhost:3000\n\nNEXT_PUBLIC_SUBMIT_CODE_API= http://127.0.0.1:5000\nSUBMIT_CODE_API= http://127.0.0.1:5000\nNEXT_PUBLIC_WORKER_URL = http://127.0.0.1:5001\nWORKER_URL = http://127.0.0.1:5001\nREDIS_URL = redis://localhost:6379\nNEXT_PUBLIC_REDIS_URL = redis://localhost:6379\n```\n\nA sample .evn file is also provided in the repository.\n\n### 4. Run Dev server Locally\n\nFirst, run the frontend and backend development server:\n\n```bash\ncd frontend\nnpm run dev\n\n```\n\nand locate to backend\n\n```bash\ncd api_service\npython app.py\ncd ../execution_service\npython worker.py\n```\n\n\u003cbr\u003e\u003cbr\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahul-shrivastav%2Fleetcode-clone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frahul-shrivastav%2Fleetcode-clone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahul-shrivastav%2Fleetcode-clone/lists"}