{"id":16755451,"url":"https://github.com/hugw/rails-jwt-server","last_synced_at":"2026-04-19T02:04:55.409Z","repository":{"id":89204474,"uuid":"49822275","full_name":"hugw/rails-jwt-server","owner":"hugw","description":"An API Server that manages users subscriptions and JWT authentication.","archived":false,"fork":false,"pushed_at":"2016-01-17T15:12:35.000Z","size":61,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-16T06:41:11.351Z","etag":null,"topics":["jwt","jwt-auth","jwt-authentication","rails","ruby"],"latest_commit_sha":null,"homepage":null,"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/hugw.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}},"created_at":"2016-01-17T15:11:56.000Z","updated_at":"2017-12-09T17:30:58.000Z","dependencies_parsed_at":"2023-03-18T08:00:37.132Z","dependency_job_id":null,"html_url":"https://github.com/hugw/rails-jwt-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hugw/rails-jwt-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugw%2Frails-jwt-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugw%2Frails-jwt-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugw%2Frails-jwt-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugw%2Frails-jwt-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hugw","download_url":"https://codeload.github.com/hugw/rails-jwt-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugw%2Frails-jwt-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005332,"owners_count":26083883,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["jwt","jwt-auth","jwt-authentication","rails","ruby"],"created_at":"2024-10-13T03:22:34.432Z","updated_at":"2025-10-10T21:06:07.709Z","avatar_url":"https://github.com/hugw.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"## JWT Rails API Server\n\nAn API Server that manages users subscriptions and JWT authentication. It offers seamless integration with Firebase custom authentication and is **production ready** for heroku servers.\n\n**Stack:** `Firebase` + `Devise` + `JWT` + `CORS`\n\n## Requirements\n\n- Ruby on Rails\n- PostgreSQL\n\n## Install instructions\n\nBefore everything, locate the file `config/application-sample.yml`, rename it to `application.yml` and fill in the empty fields.\n\n*`SENDGRID_USERNAME` and `SENDGRID_PASSWORD` options are not mandatory if you are going to use the app only in dev/test environment*\n\nAlready inside your project folder, type the following command:\n\n```\n$ bundle install\n```\n\nAfter all dependencies are installed, setup your database credentials in `config/database.yml`.\nWhen ready, you can run the migrations:\n\n```\n$ rake db:create\n$ rake db:migrate\n# rake db:seed # optional, check db/seeds.rb for more information\n```\n\nWith the migrations done, you can start the server:\n\n```\n$ rails s\n```\n\nMake sure to start mailcatcher so your tests and development environment won't break:\n\n```\n$ mailcatcher\n```\n\nThats it, your api is up and running.\n\n## Features\n\n- Rack CORS for clients management\n\n*Only selected clients will be allowed to access the api via CORS setup. For more information check out `config/application.rb`*\n\n- Firebase custom authentication\n\n*JWT tokens is already compatible with Firebase, all you need to do is fill in `JWT_SECRET` with the secret key Firebase provided you.*\n\n- Devise authentication integrated with Json Web Tokens(JWTs)\n\n*Each token will expire after 5 days and every 10 minutes the server will return a fresh one, so its up to the client to update it or not.*\n\n- The entire API Server won't return any strings messages, all validations will return string codes and http response codes. With this in mind, is up to the client to handle the entire localization feature.\n\n*Ex: When email is invalid, it will return response code `422` and a string error code `INVALID`*\n\n*Ex: When user isn't found on system, it will return responde code `401` and a string error code `USER_NOT_FOUND`*\n\n## API\n\n### User sign up\n\n**POST /users**\n\nParameters in JSON format:\n\n```\n{\n  \"user\": {\n    \"name\": \"Jon Doe\",\n    \"email\": \"jon@doe.io\",\n    \"password\": \"jon123\",\n    \"password_confirmation\": \"jon123\"\n  }\n}\n```\n\n### User sign in\n\n**POST /users/sign_in**\n\nParameters in JSON format:\n\n```\n{\n  \"user\": {\n    \"email\": \"jon@doe.io\",\n    \"password\": \"jon123\"\n  }\n}\n```\n\n### Recover user password\n\n**POST /users/password**\n\nParameters in JSON format:\n\n```\n{\n  \"user\": {\n    \"email\": \"jon@doe.io\",\n    \"callback_url\": \"http://myclient.io/reset_password\"\n  }\n}\n```\n\n*The `callback_url` is sent inside the reset instructions email so the user can be redirected back to your app.*\n\n### Change user password after reset instructions\n\n**PUT /users/password**\n\nParameters in JSON format:\n\n```\n{\n  \"user\": {\n    \"password\": \"jon123\",\n    \"password_confirmation\": \"jon123\",\n    \"reset_password_token\": \"7f9t4GTKkyWkCXXQseFQ\"\n  }\n}\n```\n\n*The `reset_password_token` is located as a query param inside your callback_url after the user is redirected.*\n\n*Ex: `http://myclient.io/reset_password?token=7f9t4GTKkyWkCXXQseFQ`*\n\n### Get current user data while authenticated\n\n**GET /api/v1/user**\n\n### Update current user data while authenticated\n\n**PUT /api/v1/user**\n\nParameters in JSON format:\n\n```\n{\n  \"user\": {\n    \"name\": \"Jon Doe\",\n    \"email\": \"jon@doe.io\",\n    \"password\": \"jon123\",\n    \"password_confirmation\": \"jon123\"\n  }\n}\n```\n\n*Password and password_confirmation is optional.*\n\n## Testing\n\nTests are handled via rspec, type the following command to run it:\n\n```\n$ rspec\n```\n\n## Releases\n\n### Version 0.0.1\n\nInitial version.\n\n***\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Hugo W. - me@hugw.io\n\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:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\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\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugw%2Frails-jwt-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhugw%2Frails-jwt-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugw%2Frails-jwt-server/lists"}