{"id":15101699,"url":"https://github.com/rhysmalyon/shiro-rails","last_synced_at":"2026-01-19T04:32:19.225Z","repository":{"id":223590405,"uuid":"748020884","full_name":"RhysMalyon/shiro-rails","owner":"RhysMalyon","description":"Rails implementation of a Node.js API I created in 2023 as a side project for a friend's business. Used as a testing ground to get reacquainted with Ruby / Rails and JWT authentication, as well as picking up RSpec for testing.","archived":false,"fork":false,"pushed_at":"2024-02-21T02:19:29.000Z","size":88,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T11:13:58.104Z","etag":null,"topics":["devise-jwt","rails-api","rspec"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/RhysMalyon.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}},"created_at":"2024-01-25T05:20:19.000Z","updated_at":"2024-02-21T01:58:50.000Z","dependencies_parsed_at":"2024-02-21T03:30:41.416Z","dependency_job_id":"167c2ebe-31c3-49a4-a01c-469619db54a3","html_url":"https://github.com/RhysMalyon/shiro-rails","commit_stats":null,"previous_names":["rhysmalyon/shiro-rails"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RhysMalyon%2Fshiro-rails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RhysMalyon%2Fshiro-rails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RhysMalyon%2Fshiro-rails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RhysMalyon%2Fshiro-rails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RhysMalyon","download_url":"https://codeload.github.com/RhysMalyon/shiro-rails/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247325696,"owners_count":20920714,"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":["devise-jwt","rails-api","rspec"],"created_at":"2024-09-25T18:28:40.805Z","updated_at":"2026-01-19T04:32:19.187Z","avatar_url":"https://github.com/RhysMalyon.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shiro API\n\nA booking API developed in Ruby on Rails and authenticated with a JWT-based system using the `devise-jwt` gem.\n\nDocumentation is still WIP.\n\n## Setup\n\nInstall gems:\n\n```\nbundle install\n```\n\nSet up your database:\n\n```\nrails db:create\nrails db:migrate\n```\n\nSeed your database (Optional - includes dummy user for authentication login, as well as customers, appointments, and Japanese national holidays):\n\n```\nrails db:seed\n```\n\nTesting (for documentation mode add the `-fd` flag to the end):\n\n```\nrspec\n```\n\n## Running the project\n\nIn your terminal:\n\n```\nrails server\n```\n----\n## Routes\n\n### Authorization\n----\n#### Creating new user\n\n\u003cdetails\u003e\n \u003csummary\u003e\u003ccode\u003ePOST\u003c/code\u003e \u003ccode\u003e\u003cb\u003e/signup\u003c/b\u003e\u003c/code\u003e\u003c/summary\u003e\n\n##### Overview\n\nRegisters a new user with the credentials provided in the parameters. These credentials can be used to sign in and access authorization-protected routes. A JWT Bearer token is returned in the response's `authorization` header.\n\n\n##### Parameters\n\n\u003e | name             | type       | data type        | description          |\n\u003e |----------------|-----------|-----------------|---------------------|\n\u003e | email             | required | string              | User email           |\n\u003e | password      | required | string              | User password    |\n\n\n##### Responses\n\n\u003e | http code     | content-type                      | response                                                            |\n\u003e |---------------|-----------------------------------|---------------------------------------------------------------------|\n\u003e | `201`         | `text/plain;charset=UTF-8`        | `Signed up successfully`                                |\n\u003e | `400`         | `application/json`                | `{\"code\":\"400\",\"message\":\"User couldn't be created successfully. \u003ccurrent_user.errors.full_messages\u003e\"}`                            |\n\n##### Example cURL\n\n\u003e ```javascript\n\u003e curl --location 'http://localhost:3001/signup' \\\n\u003e       -H 'Content-Type: application/json' \\\n\u003e       --data-raw '{\n\u003e           \"user\": {\n\u003e               \"email\": \"test@test.com\",\n\u003e               \"password\": \"test1234\"\n\u003e           }\n\u003e       }'\n\u003e ```\n\n\u003c/details\u003e\n\n\n#### Login\n\n\u003cdetails\u003e\n \u003csummary\u003e\u003ccode\u003ePOST\u003c/code\u003e \u003ccode\u003e\u003cb\u003e/login\u003c/b\u003e\u003c/code\u003e\u003c/summary\u003e\n\n##### Overview\n\nSign a user in using existing credentials. Returns a JWT Bearer token in the response's `authorization` header that can be used in protected routes' request headers.\n\n\n##### Parameters\n\n\u003e | name      |  type     | data type               | description            |\n\u003e |-----------|-----------|-------------------------|------------------------|\n\u003e | email     |  required | string                  | User email             |\n\u003e | password  |  required | string                  | User password          |\n\n\n##### Responses\n\n\u003e | http code     | content-type                      | response                                                 |\n\u003e |---------------|-----------------------------------|----------------------------------------------------------|\n\u003e | `200`         | `text/plain;charset=UTF-8`        | `Logged in successfully.`                                |\n\u003e | `401`         | `application/json`                | `{\"code\":\"401\",\"message\":\"Invalid Email or password\"}`   |\n\n##### Example cURL\n\n\u003e ```javascript\n\u003e curl --location 'http://localhost:3001/login' \\\n\u003e       -H 'Content-Type: application/json' \\\n\u003e       --data-raw '{\n\u003e           \"user\": {\n\u003e               \"email\": \"test@test.com\",\n\u003e               \"password\": \"test1234\"\n\u003e           }\n\u003e       }'\n\u003e ```\n\n\u003c/details\u003e\n\n\n#### Logout\n\n\u003cdetails\u003e\n \u003csummary\u003e\u003ccode\u003eDELETE\u003c/code\u003e \u003ccode\u003e\u003cb\u003e/logout\u003c/b\u003e\u003c/code\u003e\u003c/summary\u003e\n\n##### Overview\n\nSign a user out of a session. Requires a valid JWT Bearer token in the request's `authorization` header (received in response headers from either \u003ccode\u003ePOST\u003c/code\u003e \u003ccode\u003e\u003cb\u003e/login\u003c/b\u003e\u003c/code\u003e or \u003ccode\u003ePOST\u003c/code\u003e \u003ccode\u003e\u003cb\u003e/signup\u003c/b\u003e\u003c/code\u003e).\n\n\n##### Parameters\n\n\u003e None\n\n\n##### Responses\n\n\u003e | http code     | content-type                      | response                                                            |\n\u003e |---------------|-----------------------------------|---------------------------------------------------------------------|\n\u003e | `200`         | `text/plain;charset=UTF-8`        | `Logged out successfully.`                                          |\n\u003e | `401`         | `application/json`                | `{\"code\":\"401\",\"message\":\"Not authorized to access that route.\"}`   |\n\n##### Example cURL\n\n\u003e ```javascript\n\u003e curl -L -X DELETE 'http://localhost:3001/logout' \\\n\u003e      -H 'Authorization: Bearer \u003cauth_token\u003e' \n\u003e ```\n\n\u003c/details\u003e\n\n------------------------------------------------------------------------------------------\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhysmalyon%2Fshiro-rails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhysmalyon%2Fshiro-rails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhysmalyon%2Fshiro-rails/lists"}