{"id":21011526,"url":"https://github.com/ojuswizard/code-pad","last_synced_at":"2025-05-15T03:32:25.885Z","repository":{"id":48126445,"uuid":"323912530","full_name":"OjusWiZard/Code-Pad","owner":"OjusWiZard","description":"A state-of-the-art Competitive Programming platform. This platform is way cooler than a normal coding website because of it's Retro VCR Design, Integrated Coding Editor for 45+ languages, Programming Contests, and their Live Leader-boards.","archived":false,"fork":false,"pushed_at":"2023-09-15T16:21:23.000Z","size":2225,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-14T11:19:20.923Z","etag":null,"topics":["celery","competitive-programming","django","django-rest-framework","docker","judge0","rabbitmq","react"],"latest_commit_sha":null,"homepage":"http://codepad.hackncs.in","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OjusWiZard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-23T13:41:44.000Z","updated_at":"2024-03-04T17:19:11.000Z","dependencies_parsed_at":"2023-01-30T19:30:55.142Z","dependency_job_id":null,"html_url":"https://github.com/OjusWiZard/Code-Pad","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OjusWiZard%2FCode-Pad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OjusWiZard%2FCode-Pad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OjusWiZard%2FCode-Pad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OjusWiZard%2FCode-Pad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OjusWiZard","download_url":"https://codeload.github.com/OjusWiZard/Code-Pad/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225326222,"owners_count":17456893,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["celery","competitive-programming","django","django-rest-framework","docker","judge0","rabbitmq","react"],"created_at":"2024-11-19T09:29:17.046Z","updated_at":"2024-11-19T09:29:17.509Z","avatar_url":"https://github.com/OjusWiZard.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"http://codepad.hackncs.in/\"\u003e\n    \u003cimg alt=\"CodePad\" height=\"125\" src=\"./client/public/CodePad.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\nA state-of-the-art Competitive Programming platform.\u003cbr/\u003eSee you on the Leaderboard!\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"http://codepad.hackncs.in/\"\u003eView CodePad\u003c/a\u003e\n·\n\u003ca href=\"https://github.com/SingingApple/Code-Pad/issues\"\u003eRaise Issue\u003c/a\u003e\n·\n\u003ca href=\"mailto:ojuswimail@gmail.com\"\u003eSupport\u003c/a\u003e\n\u003c/p\u003e\n\n\n\u003cdetails open=\"open\"\u003e\n  \u003csummary\u003e\u003cb\u003eTable of Contents\u003c/b\u003e\u003c/summary\u003e\n  \u003cul\u003e\n    \u003cli\u003e\u003ca href=\"#about-the-project\"\u003eAbout The Project\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#features\"\u003eFeatures\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#quick-start\"\u003eQuick Start\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#prerequisites\"\u003ePrerequisites\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#backend\"\u003eBackend\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#frontend\"\u003eFrontend\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#docker-way-to-quick-start-the-complete-project\"\u003eDocker-way to quick start the complete project\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contributors\"\u003eContributors\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/details\u003e\n\n\u003ca id=about-the-project\u003e\u003c/a\u003e\n\n# 🔎 About the Project\n[CodePad](https://codepad.hackncs.in) is the Competitive Programming platform of JSSATEN.\nThis platform is way cooler than a normal coding website because of it's Retro VCR Design, [Integrated Coding Editor](https://codepad.hackncs.in/editor) for 45+ languages, [Programming Contests](https://codepad.hackncs.com/events), and their Live\nLeader-boards.\n\nAt CodePad, The [Nibble Computer Society](https://hackncs.in/) conducts multiple Programming Competitions to revive the geek in you, and keep promoting the coding culture in our college.\n\nSo, charge all your laptops and Happy Coding!\n\n### Built With [React](https://reactjs.org/) and [Django](https://www.djangoproject.com/).\n\n\u003ca id=features\u003e\u003c/a\u003e\n\n# 🎯 Features\n* Interesting UI/UX to not get bored easily\n* Host multiple Contests\n  * Custom time duration of Contest\n  * Multiple Problems per Contest\n    * Multiple testcases per Problems\n    * Custom Score of easy Problem\n    * Custom Penalty on wrong solution submission\n    * Score deduction with time gradient\n  * Live Leaderboard\n* Integrated Code Editor to code side-by-side\n  * Upload your code file directly to the editor\n  * Syntax Highlighting and Auto-Completion\n  * Statistics of the code execution\n    * Time in seconds and Memory in KiloBytes\n    * stdout and stderr\n  * Custom input to pass as stdin\n* 45+ Programming Languages supported\n* Optimized evaluation to prevent bottlenecks\n  * Asynchronous Evaluation of submissions\n  * Load balanced workers to execute and evaluate code \n\n\u003ca id=quick-start\u003e\u003c/a\u003e\n\n# ⚡️ Quick Start\n\n\u003ca id=prerequisites\u003e\u003c/a\u003e\n\n## Prerequisites\nThe following things must be ready for function of the project:\n* [yarn](https://yarnpkg.com/)\n* [RabbitMQ](https://www.rabbitmq.com/)\n* [Celery](https://docs.celeryproject.org/)\n* [PostgreSQL](https://www.postgresql.org/) (Optional)\n* [Cloudinary](https://cloudinary.com/) (Optional)\n\nThe first thing to do is to clone the repository:\n```bash\ngit clone https://github.com/SingingApple/Code-Pad.git\ncd Code-Pad\n```\n\n\u003cdetails\u003e\n    \u003csummary\u003e\u003cb\u003e\u003ca id=backend\u003e\u003c/a\u003e⚙️ Backend\u003c/b\u003e\u003c/summary\u003e\n\nIn the current directory:\n\n1. create a `.env` file to store environment variables\n```bash\ntouch .env\n```\n\n2. Set the following environment variables in the `.env` file\n\n\u003cdetails\u003e\n    \u003csummary\u003e.env\u003c/summary\u003e\n\n```properties\n# General Settings\n\nSERVER_HOST=\"*\"\nDJANGO_SECRET_KEY=\"\"\nDEBUG=True\nFRONTEND_HOST=\"localhost:3000\"\n\n\n# Static Settings\n\n# If you are using Cloudinary as a CDN, set these three variables. Else leave them commented\n# MEDIA_CLOUD_NAME=\n# MEDIA_API_KEY=\n# MEDIA_API_SECRET=\n\n# If Cloudinary env vars are not provided then these two are used automatically\nMEDIA_ROOT=\"media/\"\nSTATIC_ROOT=\"static/\"\n\n\n# Email Settings\n\n# Emailing stuff will not work without these environment variables. Rest will work, if you leave them empty.\nEMAIL_USE_TLS= # True/False\nEMAIL_HOST=\"\"\nEMAIL_PORT=587\nEMAIL_HOST_USER=\"\"\nEMAIL_HOST_PASSWORD=\"\"\n\n# Set the same as EMAIL_HOST_USER\nDEFAULT_FROM_EMAIL=\"\"\n\n\n# Postgres Settings\n\n# Set these five variables if you want to use PostgreSQL.\n# Otherwise leave them commented to use SQLite by default.\n# POSTGRES_DB=\"\"\n# POSTGRES_USER=\"\"\n# POSTGRES_PASSWORD=\"\"\n# POSTGRES_HOST=\"\"\n# POSTGRES_PORT=\"\"\n\n\n# Judge Settings\n\nJUDGE_HOST=\"http://judge0IsHostedHere/\"\nX_Auth_Token=\"\"\nFILE_SIZE_LIMIT_KB=\"512\"\n\n\n# RabbitMQ Settings\n\nRABBITMQ_DEFAULT_VHOST=\"\"\nRABBITMQ_DEFAULT_USER=\"\"\nRABBITMQ_DEFAULT_PASS=\"\"\nRABBITMQ_DEFAULT_HOST=\"\"\n\n```\n\u003c/details\u003e\n\n3. Create a virtual environment to install dependencies in and activate it:\n```bash\nvirtualenv venv\nsource venv/bin/activate\n```\n\n4. Then install the dependencies:\n```bash\npip install -r requirements.txt\n```\n\n5. Migrate using\n```bash\npython manage.py migrate\n```\n\n6. Finally Run the developement server using\n```bash\npython manage.py runserver\n```\n\n### Note -\nIf you have configured your own Judge0 and RabbitMQ server then you may also need to run a celery worker to process the messages. For that:\n\n1. Export the RabbitMQ broker URL in environment\n```bash\nexport RABBITMQ_BROKER=\"\"\n```\n\n2. Run the celery workers using\n```bash\ncelery worker --app CodePad --loglevel info --queue submissions --broker $RABBITMQ_BROKER\n```\n\nThat's all you need to know for the backend! 🎉\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003e\u003cb\u003e\u003ca id=frontend\u003e\u003c/a\u003e🖼️ Frontend\u003c/b\u003e\u003c/summary\u003e\n\nIn the `client` directory:\n\n1. Create a `.env` file to store environment variables\n```bash\ntouch .env\n```\n\n2. Set the following environment variables in the `.env` file\n\u003cdetails\u003e\n    \u003csummary\u003e.env\u003c/summary\u003e\n\n```properties\nREACT_APP_BASEURL=\"http://localhost:8000\"\nHTTP_PROXY=\"http://localhost:8000\"\nREACT_APP_JUDGEHOST=\"https://judge0IsHostedHere/submissions/?wait=true\u0026base64_encoded=true\"\nREACT_APP_JUDGELANGUAGE=\"https://judge0IsHostedHere/languages\"\n```\n\u003c/details\u003e\n\nNow you can use:\n### `yarn`\n\nInstalls all the dependencies.\n\n### `yarn start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in the browser.\n\nThe page will reload if you make edits.\\\nYou will also see any lint errors in the console.\n\nThat's all you need to know for the frontend! 🎉\n\u003c/details\u003e\n\n\u003ca id=docker-way-to-quick-start-the-complete-project\u003e\u003c/a\u003e\n\n## 🐳 Docker-way to quick start the complete project\n\nIn the root directory:\n\n1. Change the following value in the `.env` file.\n\u003cdetails\u003e\n    \u003csummary\u003e.env\u003c/summary\u003e\n\n```properties\n# Postgres Settings\n\nPOSTGRES_DB=\"codepad\"\nPOSTGRES_USER=\"hackNCS\"\nPOSTGRES_PASSWORD=\"CodePadDatabaseHackNCS\"\nPOSTGRES_HOST=\"postgres\"\nPOSTGRES_PORT=\"5432\"\n\n\n# RabbitMQ Settings\n\nRABBITMQ_DEFAULT_VHOST=\"codepad\"\nRABBITMQ_DEFAULT_USER=\"hackNCS\"\nRABBITMQ_DEFAULT_PASS=\"CodePadRabbitMQHackNCS\"\nRABBITMQ_DEFAULT_HOST=\"rabbitmq\"\n```\n\u003c/details\u003e\n\n**Note:** Rest of the variables shall be same as defined under Backend category above.\n\n2. Set the variable in the `client/.env` file same as above in the frontend category.\n\n3. Make sure there is no service running on the following ports already.\n   * `3000` - for React app\n   * `8000` - for Django server\n   * `5672` - for RabbitMQ server\n   * `15672` - for RabbitMQ admin\n   * `5432` - for PostgreSQL server\n```bash\nlsof -i -P -n | grep 127.0.0.1:\u003cport_number\u003e\n```\n\nIf there are some services running then terminate them using their respective closing commands.\n\n4. Create a docker network which might come useful to connect the django server to the judge0.\n```bash\ndocker network create codenet\n```\n\n5. Finally, in the root directory, **Spin-Up** the project using\n```bash\ndocker-compose up\n```\n\n\u003ca id=contributors\u003e\u003c/a\u003e\n\n# Contributors\n\u003ca href=\"https://github.com/SingingApple/Code-Pad/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=SingingApple/Code-Pad\" /\u003e\n\u003c/a\u003e\n\n\u003ca id=license\u003e\u003c/a\u003e\n\n# 📝 License\n\nThis project follows the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fojuswizard%2Fcode-pad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fojuswizard%2Fcode-pad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fojuswizard%2Fcode-pad/lists"}