{"id":26399349,"url":"https://github.com/eric-philippe/algohive","last_synced_at":"2025-03-17T13:19:36.101Z","repository":{"id":281154974,"uuid":"944164976","full_name":"Eric-Philippe/AlgoHive","owner":"Eric-Philippe","description":"Algohive is a self-hosted coding game platform. that allows developers to create puzzles for developers to solve.","archived":false,"fork":false,"pushed_at":"2025-03-14T21:07:02.000Z","size":2212,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-14T22:20:30.261Z","etag":null,"topics":["algohive","codingame","self-hosted"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Eric-Philippe.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":"SECURITY","support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-06T22:26:07.000Z","updated_at":"2025-03-14T21:07:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"d15023d0-774a-4fdf-b437-f7f47614f0bf","html_url":"https://github.com/Eric-Philippe/AlgoHive","commit_stats":null,"previous_names":["eric-philippe/algohive"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eric-Philippe%2FAlgoHive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eric-Philippe%2FAlgoHive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eric-Philippe%2FAlgoHive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eric-Philippe%2FAlgoHive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Eric-Philippe","download_url":"https://codeload.github.com/Eric-Philippe/AlgoHive/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244039223,"owners_count":20387835,"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":["algohive","codingame","self-hosted"],"created_at":"2025-03-17T13:19:33.972Z","updated_at":"2025-03-17T13:19:36.087Z","avatar_url":"https://github.com/Eric-Philippe.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg width=\"150px\" src=\"images/algohive-logo.png\" title=\"Algohive\"\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eAlgoHive\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\u003ci\u003e\u003cb\u003e[Project under \"active\" development, some features may be unstable or change in the future. A first release version is planned to be packed soon].\u003c/b\u003e\u003c/i\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003eAlgohive is a \u003cb\u003eself-hosted coding game platform.\u003c/b\u003e\u003cbr\u003ethat allows developers to create puzzles for developers to solve.\u003c/p\u003e\n\n---\n\nEach puzzle contains two parts to solve, allowing developers to test their skills in a variety of ways. The puzzles are created using a proprietary file format that is compiled into a single file for distribution.\n\n\u003e Sweeten your skills, but the competition stings\n\n---\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://skillicons.dev/icons?i=react,vite,ts,py,go,postgres,redis,docker,swagger\"\u003e\n\u003c/p\u003e\n\n---\n\n## Why\n\nAlgohive is a coding game plateform for developers by developers. It is a self-hosted solution that allows developers, schools to create puzzles for other developers to solve. The platform is designed to be lightweight and easy to use, with a focus on creating and solving puzzles.\n\n## Features Highlights\n\n- A file format created for defining puzzles\n- A command line interface forge for creating, testing, and managing puzzles\n- A self-hostable API for loading and serving puzzles\n- A self-hostable web platform for managing users, competitions, and puzzles\n- [LATER] A web platform for users to interact with the puzzles\n\n## Quick Start\n\nInstalling Alghive is pretty straight forward, in order to do so follow these steps:\n\n- Create a folder where you want to place all the Algohive related files.\n- Inside that folder, create a file named docker-compose.yml with this content:\n\n```yaml\nname: algohive\nservices:\n  server:\n    image: ghcr.io/eric-philippe/algohive/algohive/api:latest\n    env_file: server.env\n    depends_on:\n      - db\n      - cache\n    restart: unless-stopped\n    ports:\n      - \"3000:3000\"\n    networks:\n      - algohive-network\n\n  client:\n    image: ghcr.io/eric-philippe/algohive/algohive/client:latest\n    restart: unless-stopped\n    ports:\n      - \"8000:8000\"\n    networks:\n      - algohive-network\n\n  beeapi-server1:\n    image: ghcr.io/eric-philippe/algohive/beeapi:latest\n    restart: unless-stopped\n    volumes:\n      - ./data/beeapi-server1/puzzles:/app/puzzles\n    ports:\n      - \"5000:5000\"\n    networks:\n      - algohive-network\n\n  beeapi-server2:\n    image: ghcr.io/eric-philippe/algohive/beeapi:latest\n    restart: unless-stopped\n    volumes:\n      - ./data/beeapi-server2/puzzles:/app/puzzles\n    ports:\n      - \"5001:5000\"\n    networks:\n      - algohive-network\n\n  db:\n    image: postgres:17-alpine\n    env_file: server.env\n    volumes:\n      - ./db-data:/var/lib/postgresql/data\n    networks:\n      - algohive-network\n\n  cache:\n    image: redis:alpine\n    restart: always\n    networks:\n      - algohive-network\n\nvolumes:\n  db-data:\n\nnetworks:\n  algohive-network:\n```\n\n- Create a file named server.env with this content:\n\n```env\n\n```\n\n- Start the services by running the following command:\n\n```bash\ndocker-compose up -d --build\n```\n\n- Authorize access to the BeeAPI folder(s) for every instance of the BeeAPI server:\n\n\u003e This will allow you to put puzzles in the folder and have them available in the API.\n\n````bash\nsudo chown -R $USER:$USER ./data/beeapi-server1/puzzles\n```\n\n## Quick Overview\n\n### CLI - HiveCraft\n\nHivecraft is a command line interface for creating and managing AlgoHive puzzles. It is a tool for developers to create, test, manage and compile puzzles for the AlgoHive platform. AlgoHive works by using a proprietary file format to define puzzles, and Hivecraft is a tool to help developers create these files.\n\n### Self-Hostable API - BeeAPI\n\nAPI will be able to load puzzles from .alghive files, verify them using the same algorithm as the CLI. (Generate an API-KEY)\n\n### Self-Hostable Web Platform - AlgoHive\n\nThe self-hostable web platform will contains an API for the User and Competition management, and a front-end for the users to interact with the platform. The Web Plateform will be completely usable with the Puzzle API.\n\n### AlgoHive file format\n\nThe AlgoHive file format is a concealing ZIP file that contains multiple files and directories to define a puzzle. The extension of the file is `.alghive`.\n\n#### Contents of the file\n\nThe file contains the following directories and files:\n\n| Name             | Description                                                                                                  |\n| ---------------- | ------------------------------------------------------------------------------------------------------------ |\n| `forge.py`       | This executable python file will generate a unique input for a given seed for the puzzle.                    |\n| `decrypt.py`     | This executable python file will decrypt the input and output the solution for the first part of the puzzle  |\n| `unveil.py`      | This executable python file will decrypt the input and output the solution for the second part of the puzzle |\n| `cipher.html`    | This HTML file contains the puzzle's first part text and example input/output.                               |\n| `unveil.html`    | This HTML file contains the puzzle's second part text and example input/output.                              |\n| `props/`         | This directory contains the properties of the puzzle, such as the author, creation date and difficulty.      |\n| `props/meta.xml` | This XML file contains the meta properties of the file                                                       |\n| `props/desc.xml` | This markdown file contains the description of the puzzle.                                                   |\n\n##### `forge.py`\n\nThis file is an executable python file that will generate a unique input for a given seed for the puzzle. The file should contain a class called `Forge` that has a method constructor `__init__` that takes a lines_count and a seed as arguments. The class should have a method called `run` that returns a list of strings that will be the input for the puzzle. The implementation should be inside the `generate_line` method that contains an index as an argument and returns a string. The python file should be executable and should generate the input file `input.txt` for debugging purposes.\n\n```python\n# forge.py - Génère input.txt\nimport sys\nimport random\n\nclass Forge:\n    def __init__(self, lines_count: int, unique_id: str = None):\n        self.lines_count = lines_count\n        self.unique_id = unique_id\n\n    def run(self) -\u003e list:\n        random.seed(self.unique_id)\n        lines = []\n        for _ in range(self.lines_count):\n            lines.append(self.generate_line(_))\n        return lines\n\n    def generate_line(self, index: int) -\u003e str:\n        # TODO: TO BE IMPLEMENTED\n        pass\n\nif __name__ == '__main__':\n    lines_count = int(sys.argv[1])\n    unique_id = sys.argv[2]\n    forge = Forge(lines_count, unique_id)\n    lines = forge.run()\n    with open('input.txt', 'w') as f:\n        f.write('\\n'.join(lines))\n````\n\n\u003e Using this template will allow to just focus on the `generate_line` method to generate the input for the puzzle.\n\n##### `decrypt.py`\n\nThis file is an executable python file that will decrypt the input and output the solution for the first part of the puzzle. The file should contain a class called `Decrypt` that has a method constructor `__init__` that takes a list of lines as arguments. The class should have a method called `run` that, given the previously setup lines, return a string or a number that is the solution for the first part of the puzzle. The python file should be executable.\n\n```python\nclass Decrypt:\n    def __init__(self, lines: list):\n        self.lines = lines\n\n    def run(self):\n        # TODO: TO BE IMPLEMENTED\n        pass\n\nif __name__ == '__main__':\n    with open('input.txt') as f:\n        lines = f.readlines()\n    decrypt = Decrypt(lines)\n    solution = decrypt.run()\n    print(solution)\n```\n\n##### `unveil.py`\n\nThis file is an executable python file that will decrypt the input and output the solution for the second part of the puzzle. The file should contain a class called `Unveil` that has a method constructor `__init__` that takes a list of lines as arguments. The class should have\na method called `run` that, given the previously setup lines, return a string or a number that is the solution for the second part of the puzzle. The python file should be executable.\n\n```python\nclass Unveil:\n    def __init__(self, lines: list):\n        self.lines = lines\n\n    def run(self):\n        # TODO: TO BE IMPLEMENTED\n        pass\n\nif __name__ == '__main__':\n    with open('input.txt') as f:\n        lines = f.readlines()\n    unveil = Unveil(lines)\n    solution = unveil.run()\n    print(solution)\n```\n\n##### `cipher.html`\n\nThis file is an HTML file that contains the puzzle's first part text and example input/output. The file must contain a `\u003carticle\u003e` surrounding the content. The content can be written using `\u003cp\u003e` tags for paragraphs and `\u003cpre\u003e` or `\u003ccode\u003e` tags for code blocks. This file should contain basic examples of the input and output of the puzzle.\n\n```html\n\u003carticle\u003e\n  \u003ch2\u003eFirst part of the puzzle\u003c/h2\u003e\n\n  \u003cp\u003eI'm a paragraph\u003c/p\u003e\n\n  \u003ccode\u003e\n    \u003cpre\u003e\n      I'm a code block\n    \u003c/pre\u003e\n  \u003c/code\u003e\n\u003c/article\u003e\n```\n\n##### `unveil.html`\n\nThis file is an HTML file that contains the puzzle's second part text and example input/output. The file must contain a `\u003carticle\u003e` surrounding the content. The content can be written using `\u003cp\u003e` tags for paragraphs and `\u003cpre\u003e` or `\u003ccode\u003e` tags for code blocks. This file should contain basic examples of the input and output of the puzzle.\n\n```html\n\u003carticle\u003e\n  \u003ch2\u003eSecond part of the puzzle\u003c/h2\u003e\n\n  \u003cp\u003eI'm a paragraph\u003c/p\u003e\n\n  \u003ccode\u003e\n    \u003cpre\u003e\n      I'm a code block\n    \u003c/pre\u003e\n  \u003c/code\u003e\n\u003c/article\u003e\n```\n\n##### `props/meta.xml`\n\nThis file is an XML file that contains the meta properties of the file. The file should contain the following properties:\n\n```xml\n\u003cProperties xmlns=\"http://www.w3.org/2001/WMLSchema\"\u003e\n    \u003cauthor\u003e$AUTHOR\u003c/author\u003e\n    \u003ccreated\u003e$CREATED\u003c/created\u003e\n    \u003cmodified\u003e$MODIFIED\u003c/modified\u003e\n    \u003ctitle\u003eMeta\u003c/title\u003e\n\u003c/Properties\u003e\n```\n\n\u003e This file will allow to be able to define the author, the creation date and the modification date of the puzzle.\n\n##### `props/desc.xml`\n\nThis file is an XML file that contains the description of the puzzle. The file should contain the following properties:\n\n```xml\n\u003cProperties xmlns=\"http://www.w3.org/2001/WMLSchema\"\u003e\n    \u003cdifficulty\u003e$DIFFICULTY\u003c/difficulty\u003e\n    \u003clanguage\u003e$LANGUAGE\u003c/language\u003e\n\u003c/Properties\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feric-philippe%2Falgohive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feric-philippe%2Falgohive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feric-philippe%2Falgohive/lists"}