{"id":17808931,"url":"https://github.com/ebeagusamuel/career_coaches_backend_api","last_synced_at":"2026-01-20T19:32:29.918Z","repository":{"id":55890467,"uuid":"313442301","full_name":"ebeagusamuel/career_coaches_backend_api","owner":"ebeagusamuel","description":"This is a Ruby on Rails API from which the React frontend serves the data. It is a simple Rails app that has three models - User, Coach, and Appointment. For the authentication of the users, I used JSON Web Tokens. The API is hosted on Heroku, and can only be accessed with a valid API token.","archived":false,"fork":false,"pushed_at":"2023-09-10T16:10:47.000Z","size":3469,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"development","last_synced_at":"2025-04-07T14:47:52.126Z","etag":null,"topics":["api","jwt","rails-api","rspec-rails"],"latest_commit_sha":null,"homepage":"https://career-coaches-api.herokuapp.com/","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/ebeagusamuel.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":"2020-11-16T22:24:41.000Z","updated_at":"2023-09-10T15:49:05.000Z","dependencies_parsed_at":"2024-10-27T15:17:50.294Z","dependency_job_id":"24c72e66-4096-45e3-bc67-833eedc8e901","html_url":"https://github.com/ebeagusamuel/career_coaches_backend_api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ebeagusamuel/career_coaches_backend_api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebeagusamuel%2Fcareer_coaches_backend_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebeagusamuel%2Fcareer_coaches_backend_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebeagusamuel%2Fcareer_coaches_backend_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebeagusamuel%2Fcareer_coaches_backend_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ebeagusamuel","download_url":"https://codeload.github.com/ebeagusamuel/career_coaches_backend_api/tar.gz/refs/heads/development","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebeagusamuel%2Fcareer_coaches_backend_api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28610614,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T18:56:40.769Z","status":"ssl_error","status_checked_at":"2026-01-20T18:54:26.653Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["api","jwt","rails-api","rspec-rails"],"created_at":"2024-10-27T15:13:15.259Z","updated_at":"2026-01-20T19:32:29.895Z","avatar_url":"https://github.com/ebeagusamuel.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BACC(Book a Career Coach)-API\n\n\u003e This is a Ruby on Rails API from which the React frontend serves the data. It is a simple Rails app that has three models - User, Coach and Appointment. For the authentication of the users I used JSON Web Tokens. The API is hosted on Heroku, at this endpoint: [career-coaches-api](https://career-coaches-api.herokuapp.com)  - But they can only be accessed with a valid API token. The front end can be found [here](https://github.com/ebeagusamuel/career_coaches_frontend)\n\n## Built With\n\n- Ruby v2.7.0\n- Ruby on Rails 6.0.3.4\n- Rspec\n- JWT\n\n## API Documentation\n\u003e The base URL for all the endpoints is `https://career-coaches-api.herokuapp.com`. All request sent to any of the end-points excepts `/users` and `/login` are first validated. The validation is done using tokens generated by JWT upon registration or login. These token has to be sent in the headers of the request you are making in order to successfully access those end-points. \n\n### Register\nThis API endpoint is used for registering new users to the system and doesn't require authorization.\n#### Endpoint\n`https://career-coaches-api.herokuapp.com/users`\n#### Sample Request\n````\ncurl -X POST \\\n https://career-coaches-api.herokuapp.com/users \\\n  -H 'cache-control: no-cache' \\\n  -H 'content-type: application/json' \\\n  -d 'username=username\u0026email=email\u0026password=password'\n````\n#### Sample Response\n````\n{\n    \"user\": {\n        \"id\": 1,\n        \"email\": \"email\",\n        \"username\": \"username\",\n        \"password_digest\": \"$2a$12$N.nStVsShl06Y4ClZrazduac91SIp1GMPTwD1/CXLO31RdMtuX1ZK\",\n        \"created_at\": \"2020-11-06T20:06:34.492Z\",\n        \"updated_at\": \"2020-11-06T20:06:34.492Z\"\n    },\n    \"token\": \"eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjozNX0.nLY4f5bGd_E9dJcpp-p1YdDcbaKasVj9hrP3zlfCkdE\"\n}\n````\n\n### Login\nThis API endpoint is used for logging in a user into the system and also does not require authorization, just the username and password that was used in creating an account and that will be added to the request body.\n#### Endpoint\n`https://career-coaches-api.herokuapp.com/login`\n#### Sample Request\n````\ncurl -X POST \\\n  https://career-coaches-api.herokuapp.com/login \\\n  -H 'cache-control: no-cache' \\\n  -H 'content-type: application/json' \\\n  -d 'username=username\u0026password=password'\n````\n#### Sample Response\n````\n{\n    \"user\": {\n        \"id\": 1,\n        \"email\": \"email\",\n        \"username\": \"username\",\n        \"password_digest\": \"$2a$12$pljN0EuO4Ui/FoKdVfgBhuXkrOEZSTSAHx/KKN8kOUk35IqGm7lwq\",\n        \"created_at\": \"2020-11-01T12:48:45.667Z\",\n        \"updated_at\": \"2020-11-01T12:48:45.667Z\"\n    },\n    \"token\": \"eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxfQ.oT7kSePnYs7eVIsRIzIi0UEC7XBclsrO3qrnXwic8Zg\"\n}\n````\n### auto_login\nThis API endpoint is used for automatically logging in a user. It's a get request and reqquires the token generated when the user was created or logged in to be sent along in the request header.\n#### Endpoint\n`https://career-coaches-api.herokuapp.com/login`\n#### Sample Request\n````\ncurl -X GET \\\n  https://career-coaches-api.herokuapp.com/auto_login \\\n  -H 'cache-control: no-cache' \\\n  -H 'content-type: application/json' \\\n  -H 'Authorization: Bearer \u003cToken\u003e'\n````\n#### Sample Response\n````\n{\n    \"user\": {\n        \"id\": 1,\n        \"email\": \"email\",\n        \"username\": \"username\",\n        \"password_digest\": \"$2a$12$pljN0EuO4Ui/FoKdVfgBhuXkrOEZSTSAHx/KKN8kOUk35IqGm7lwq\",\n        \"created_at\": \"2020-11-01T12:48:45.667Z\",\n        \"updated_at\": \"2020-11-01T12:48:45.667Z\"\n    },\n}\n````\n### Get Appointments\nThis API endpoint return all the appointments of the user.\n#### Endpoint\n`https://career-coaches-api.herokuapp.com/appointments`\n#### Sample Request\n````\ncurl -X GET \\\n https://career-coaches-api.herokuapp.com/appointments \\\n  -H 'Authorization: Bearer \u003cToken\u003e' \\\n  -H 'cache-control: no-cache' \\\n````\n#### Sample Response\n````\n[\n    {\n        \"id\": 1,\n        \"user_id\": 1,\n        \"coach_id\": 3,\n        \"date_and_time: \"021-01-08T14:00:00.000Z\",\n        \"created_at\": \"2020-11-01T12:51:04.679Z\",\n        \"updated_at\": \"2020-11-01T12:51:04.679Z\"\n    },\n    {\n        \"id\": 2,\n        \"user_id\": 1,\n        \"coach_id\": 5,\n        \"date_and_time: \"021-01-08T14:00:00.000Z\",\n        \"created_at\": \"2020-11-01T12:51:04.679Z\",\n        \"updated_at\": \"2020-11-01T12:51:04.679Z\"\n    }\n]\n````\n### Book Appointment\nThis is the API endpoint related to booking appointments in the system.\n#### Endpoint\n`https://career-coaches-api.herokuapp.com/appointments`\n#### Sample Request\n````\ncurl -X POST \\\n  https://career-coaches-api.herokuapp.com/appointments \\\n  -H 'Authorization: Bearer \u003cToken\u003e' \\\n  -H 'cache-control: no-cache' \\\n  -d 'coach_id=2\u0026date=021-01-08T14:00:00.000Z'\n````\n#### Sample Response\n- If the appointment was created: \n````\n{\n  \"message\": \"Appointment with Hobert Johnston created successfully.\"\n}\n````\n- if there was an error: \n```\n{\n  \"error\": \"This will be the error message\"\n}\n\n```\n### Cancel Appointment\nThis is the API endpoint related to cancelling appointments in the system.\n#### Endpoint\n`https://career-coaches-api.herokuapp.com/appointments/:id`\n#### Sample Request\n````\ncurl -X POST \\\n  https://career-coaches-api.herokuapp.com/cancel_appointment/:id \\\n  -H 'Authorization: Bearer \u003cToken\u003e' \\\n  -H 'cache-control: no-cache' \\\n  -d 'coach_id=2'\n````\n#### Sample Response\n\n```\n{\n  \"message\": \"Your appointment with Hobert Johnston has been cancelled.\"\n}\n```\n\n\n## Getting Started\n\nTo get a local copy up and running follow these simple example steps.\n\n### Prerequisites\n\nRuby: 2.7.0\nRails: 6.0.3.4\nPostgres: \u003e=9.5\n\n### Setup\n\nInstall gems with:\n\n```\nbundle install\n```\n\nSetup database with:\n\n```\n   rails db:create\n   rails db:migrate\n```\n\nPopulate database with:\n\n```\n   rails db:seed\n```\n\n### Usage\n\nStart server with:\n\n```\n    rails server\n```\n\n- You can then proceed to test the different end point via postman or any choice of yours.\n\n### Run tests\nType the following in your terminal/command line to run tests for the API:\n```\n    rpsec\n```\n\n### Deployment\n\nThis API has been deployed on [heroku.](https://www.heroku.com) It is acccessible at `https://career-coaches-api.herokuapp.com/`.\n\n## Author\n\n👤 **Ebeagu Samuuel**\n\n- Github: [ebeagusamuel](https://github.com/ebeagusamuel)\n- Twitter: [@ebeagu_samuel](https://twitter.com/ebeagu_samuel)\n- Linkedin: [Ebeagu Samuel](https://www.linkedin.com/in/ebeagusamuel/)\n\n## 🤝 Contributing\n\nContributions, issues and feature requests are welcome!\n\nFeel free to check the [issues page](issues/).\n\n## Show your support\n\nKindly give this repository a ⭐️ if you like this project!\n\n## Acknowledgments\n\n- Project specifications by [Microverse](https://www.microverse.org).\n\n- Images downloaded [here](https://generated.photos/).\n\n## 📝 License\n\nThis project is licensed under the MIT License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febeagusamuel%2Fcareer_coaches_backend_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Febeagusamuel%2Fcareer_coaches_backend_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febeagusamuel%2Fcareer_coaches_backend_api/lists"}