{"id":15458340,"url":"https://github.com/iank-code/hero-api","last_synced_at":"2025-05-14T02:15:15.221Z","repository":{"id":146763163,"uuid":"618078465","full_name":"Iank-code/Hero-api","owner":"Iank-code","description":null,"archived":false,"fork":false,"pushed_at":"2023-05-11T09:13:08.000Z","size":7078,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-25T16:29:50.899Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://hero-power-api.onrender.com","language":"Ruby","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/Iank-code.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}},"created_at":"2023-03-23T17:52:39.000Z","updated_at":"2023-05-12T06:56:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"e9bca57e-1460-4898-9eaf-7c895eaddf77","html_url":"https://github.com/Iank-code/Hero-api","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/Iank-code%2FHero-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iank-code%2FHero-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iank-code%2FHero-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iank-code%2FHero-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Iank-code","download_url":"https://codeload.github.com/Iank-code/Hero-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239208997,"owners_count":19600240,"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":[],"created_at":"2024-10-01T23:00:46.913Z","updated_at":"2025-02-16T23:23:34.824Z","avatar_url":"https://github.com/Iank-code.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hero Api\n\nThis is a backend project made by Ruby On Rails. It provides all data belonging to `Hero`, `Power` and its joining table `Hero_Power`\n\n## Ruby version\n\n- Ruby 2.7.4\n\n## Dependencies\n\n- Faker\n- Active_model_serializers\n- sqlite3\n- Rake\n\n## How to run\n\nTo be able to use it, you will need to clone it into your machine using the following command.\n\n    git clone git@github.com:Iank-code/Hero-api.git\n    cd Hero-api\n    bundle install\n    rails db:migrate db:seed\n    rails s\n\nThis will also start the server which will listen on port 3000\n\n```\nhttp://127.0.0.1:3000\n```\n\n## Routes\n\n## Endpoint for Hero\n\nGET\n\n    /heros\n\nReturns all heros\n\nGET\n\n    /heros/:id\n\nReturn the specific `Hero` you want with its associated powers.\nThe output will be similar to this\n\n        {\n        \"id\": 1,\n        \"name\": \"Ian\",\n        \"super_name\": \"Flash\",\n        \"powers\": [\n            {\n            \"id\": 1,\n            \"name\": \"Speed\",\n            \"description\": \"I am the fastest human to ever live\"\n            }\n        ]\n        }\n\nIf the `Hero` does not exist, it returns the following JSON data, along with\nthe appropriate HTTP status code:\n\n    {\n    \"error\": \"Hero not found\"\n    }\n\nDELETE\n\n    /heros/:id\n\nDeletes the specified `Hero` and its associated `Power`\n\n## Endpoint for Power\n\nGET\n\n    /powers\n\nReturn all the powers.\n\nGet\n\n    /powers/:id\n\nThis returns a specific `power`. The output structure should be similar to this;\n\n        {\n        \"id\": 1,\n        \"name\": \"Speed\",\n        \"description\": \"I am the fastest human to ever live\"\n        }\n\nIf the `Power` does not exist, return the following JSON data, along with\nthe appropriate HTTP status code:\n\n```\n{\n  \"error\": \"Power not found\"\n}\n```\n\nPATCH\n\n    /powers/:id\n\nThis route updates an existing `Power`. It accepts an object with\nthe following properties in the body of the request:\n\n    {\n    \"name\": \"updated power name\",\n    \"description\": \"Updated description\"\n    }\n\nIf the process is successful, it will return a status code of `200`\nIf the `Power` does not exist, return the following JSON data, along with status code of `404`:\n\n```\n{\n  \"error\": \"Power not found\"\n}\n```\n\nIf the `Power` is **not** updated successfully (does not pass validations),\nit returns a json data referring to the validation errors, along with status code of `200`:\n\nDELETE\n\n    /powers/:id\n\nDeletes the specified power\n\n## Endpoint for HeroPowers\n\nPOST\n\n    /hero_powers\n\nThis route creates a new **HeroPower** that is associated with an\nexisting `Power` and `Hero`. It accepts an object with the following properties;\n\n    {\n    \"strength\": 2,\n    \"power_id\": 1,\n    \"hero_id\": 3\n    }\n\nThe `strength` key is anumber by default. Each number represents either `[:STRONG, :WEAK, :AVERAGE]`. **STRONG** is represented by number 0, **WEAK** is represented by number 1, **AVERAGE** is represented by number 2.\n\nIf the `HeroPower` is created successfully, send back a response with the data\nrelated to the `Hero` in the format below\n\n    {\n    \"id\": 5,\n    \"name\": \"Brandee Lynch\",\n    \"super_name\": \"Cable\",\n    \"powers\": [\n        {\n        \"id\": 3,\n        \"name\": \"Hypnokinesis\",\n        \"description\": \"Perferendis maiores earum. Rerum ipsa voluptatem. Vero necessitatibus incidunt.\",\n        \"created_at\": \"2023-03-25T04:50:29.654Z\",\n        \"updated_at\": \"2023-03-25T04:50:29.654Z\"\n        }\n    ]\n    }\n\nIf the `HeroPower` is **not** created successfully, it returns a json data referring to the validation errors with the status code\n\n## LICENCE\n\nThis project is licensed under the MIT license.\n\n```\nCopyright (c) 2023 Ian Kamau\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiank-code%2Fhero-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiank-code%2Fhero-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiank-code%2Fhero-api/lists"}