{"id":24355582,"url":"https://github.com/w2inc/robopeer","last_synced_at":"2025-04-10T03:13:34.328Z","repository":{"id":182318386,"uuid":"667033058","full_name":"W2Inc/robopeer","owner":"W2Inc","description":"Send code. Wait a bit. Get response!","archived":false,"fork":false,"pushed_at":"2024-05-11T13:35:49.000Z","size":256,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T03:13:23.718Z","etag":null,"topics":["bun","code","codegrader","docker","education","grade","grader","peer","peer-to-peer","remote-code-execution","robo","untrusted-code","untrusted-environments","webserver"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/W2Inc.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-16T12:22:23.000Z","updated_at":"2025-02-12T21:01:48.000Z","dependencies_parsed_at":"2024-04-18T17:40:44.617Z","dependency_job_id":"abb3c67c-92b5-4906-bea7-ed7c3e54239b","html_url":"https://github.com/W2Inc/robopeer","commit_stats":null,"previous_names":["w2wizard/grader","w2inc/robopeer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/W2Inc%2Frobopeer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/W2Inc%2Frobopeer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/W2Inc%2Frobopeer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/W2Inc%2Frobopeer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/W2Inc","download_url":"https://codeload.github.com/W2Inc/robopeer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248148242,"owners_count":21055548,"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":["bun","code","codegrader","docker","education","grade","grader","peer","peer-to-peer","remote-code-execution","robo","untrusted-code","untrusted-environments","webserver"],"created_at":"2025-01-18T17:58:07.127Z","updated_at":"2025-04-10T03:13:34.301Z","avatar_url":"https://github.com/W2Inc.png","language":"TypeScript","readme":"\u003cdiv align=\"center\"\u003e\n    \u003ch1\u003e\u003ccode\u003e🤖 RoboPeer 🤖\u003c/code\u003e\u003c/h1\u003e\n    \u003csub\u003eWritten by W2Wizard\u003c/sub\u003e\n\u003c/div\u003e\n\u003cbr/\u003e\n\nRoboPeer is a **webserver** designed to grade your code in a safe environment. It allows you to submit code and have it \"graded\" without any worries about potential malicious activities.\n\nThis project was created using `bun init` in bun v1.1.4. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.\n\n## 🎯 How it Works\n\nThe grading process involves comparing the output of the provided git repository (after compiling it) to a series of tests run with `bun:test`. RoboPeer then returns the results of these tests. With an appropriate status code.\n\nRoboPeer can also grade direct code submissions via `/evaluate/git`.\n\n- `200` - All tests passed.\n- `408` - Timeout for testing.\n- `422` - Skill issue (bad code)\n- `500` - RoboPeer failed.\n\n## 🛠️ Installation\nRequires [Bun.sh](https://bun.sh) to install dependencies.\n\nTo install dependencies:\n```bash\nbun install\n```\n\nTo run:\n```bash\nbun run api-get # Fetches Dockers OpenAPI spec\nbun run dev\n```\n\nTo build:\n```bash\nbun run build # Outputs JS\nbun run compile # Outputs a 98~mb binary\n```\n\n## 🚀 Usage \n\n### Creating a Grading Project\n\nTo create a new reference project, use the following command:\n```bash\nbun run new \u003c project-name \u003e\n```\n\n### 🐳 Docker Setup\n\nMake sure `Docker` is installed and running on your machine.\nBuild the Docker image:\n\n```bash\n#Git Image runner\ndocker build -t w2wizard/git ./docker/git\n```\n\n```bash\n#Single Code runner\ndocker build -t w2wizard/single ./docker/single\n```\n\n### 📨 Sending a Grading Request\nThe server by default run on http://localhost:8080. To send a request to it you can use the following curl command:\n```bash\n# For git repositories\ncurl -XPOST -H \"Content-type: application/json\" -d '{\n    \"data\": {\n        \"repo\": \"https://github.com/fbescodam/libft.git\",\n        \"branch\": \"master\",\n        \"commit\": \"67dc80a\"\n    }\n}' 'http://localhost:3001/evaluate/git/lib'\n```\n\n```bash\n# For single files\n# Note: This example will not work as the code is invalid\n# Fork bombs won't work on the server\ncurl -XPOST -H \"Content-type: application/json\" -d '{\n    \"data\": {\n        \"args\": [],\n        \"content\": \"int main() { while(1) { fork() } }\",\n        \"flags\": [\n            \"-Wno-implicit-function-declaration\"\n        ],\n        \"lang\": \"c\"\n    }\n}' 'http://localhost:3001/evaluate/code'\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fw2inc%2Frobopeer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fw2inc%2Frobopeer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fw2inc%2Frobopeer/lists"}