{"id":15151206,"url":"https://github.com/chromain/rubytraining","last_synced_at":"2026-01-19T12:01:18.710Z","repository":{"id":244463123,"uuid":"812683699","full_name":"ChRomain/rubyTraining","owner":"ChRomain","description":"Training for Ruby on Rails","archived":false,"fork":false,"pushed_at":"2024-06-14T08:51:32.000Z","size":72,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-04-04T07:12:49.889Z","etag":null,"topics":["rails","ruby","training"],"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/ChRomain.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":"2024-06-09T15:34:19.000Z","updated_at":"2024-06-14T19:57:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"2c828446-1459-4d3d-9782-42dc6ad19e65","html_url":"https://github.com/ChRomain/rubyTraining","commit_stats":null,"previous_names":["chromain/rubytraining"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ChRomain/rubyTraining","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChRomain%2FrubyTraining","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChRomain%2FrubyTraining/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChRomain%2FrubyTraining/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChRomain%2FrubyTraining/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChRomain","download_url":"https://codeload.github.com/ChRomain/rubyTraining/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChRomain%2FrubyTraining/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28567861,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T08:53:44.001Z","status":"ssl_error","status_checked_at":"2026-01-19T08:52:40.245Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["rails","ruby","training"],"created_at":"2024-09-26T15:00:58.280Z","updated_at":"2026-01-19T12:01:18.686Z","avatar_url":"https://github.com/ChRomain.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rubyTraining\n\n## How to start it\n```sh\ngit clone https://github.com/ChRomain/rubyTraining.git rubyTraining\ncd rubyTraining\nrails server\n```\nOpen a browser and go in port **3000**.\n\n## Routes endpoints\n* /articles: List all articles.\n* /articles/new: Create article form.\n* /articles/:id: Query a specific article.\n* /articles/:id/edit: Update a specific article.\n* /articles/:id/delete: Remove specific article.\n\nSome routes endpoints for author also available.\n\n## Test definition\nDue to time limitation test coverage is low. Just nominal case for Article geter.\n* Check title getter\n* Check body getter\n* Check author getter\n* Check published_at getter\n\n**TODO/Improvement**:\n- [ ] Generate allure report\n- [ ] Add other test about corner case, exist or not, corrupted db, load testing with multiple // call...\n\n## GraphQl API\nOnce server is started open a browser and go in playground 3000/graphiql\n\n**TODO/Improvement**\n- [ ] Block schema documentation for unauthenticated user - for secu purpose\n- [ ] Add pagination for query all items\n- [ ] Add some input validation\n- [ ] Add some server side batching\n- [ ] Take ruby naming convention (not yet known)\n- [ ] Check object imbrication - for now ok\n- [ ] Check for schema introspection blocking\n- [ ] Block auto completion\n- [ ] Tke care of alias attack\n....\n\n### Authentication\nYou will have to be authenticated in order to play with some mutation/query.\nSteps:\n1. Execute logIn query:\n```\nmutation {\n    signUp (\n        input: {\n        email: \"email@email.com\"\n        password: \"pwd\"\n        role: admin\n        }\n    ) { email role }\n}\n```\n2. LogIn with created user\n```\nmutation {\n  logIn(\n      input: {\n        email: \"email@email.com\"\n        password: \"pwd\"\n      }\n  ) {\n    token\n  }\n}\n```\nIf user exist a bearer will be prompt in output.\nCopy it and for next query/mutation add it in Headers section as follow:\n**{ \"Authorization\": \"Bearer PREVIOUS_TOKEN\" }**\n\n### Query\nQuery all articles\n```\nquery {\n  articles {\n    id\n    title\n    body\n    author { name email }\n    publishedAt\n  }\n}\n```\n\nQuery all articles written by a specific author\n```\nquery {\n  articlesByAuthor (authorId: \"{{authorId}}\") {\n    body\n    id\n    title\n  }\n}\n```\n\nQuery a specific article\n```\nquery {\n  article(id: \"{{articleId}}\") {\n    id\n    title\n    body\n    author { name email }\n    publishedAt\n  }\n}\n```\n\n### Mutation\nFor now no input validation\n\nCreate a new article - Author must exist and be valid\n```\nmutation {\n  createArticle (\n    input: {\n      title: \"Article test\",\n      body: \"Body test\",\n      authorId: \"{{authorId}}\",\n      published_at: \"2999-01-01T01:01:01Z\"\n    }\n  ) {\n    title\n  }\n}\n```\n\nUpdate a specific article - Article id must exist and be valid\n```\nmutation {\n  updateArticle (\n    input: {\n      id: \"{{articleId}}\",\n      title: \"New name\",\n      body: \"New body\"\n    }\n  ) {\n    title\n  }\n}\n```\n\nDelete a specific article by his id - Article id must exist and be valid\n```\nmutation {\n  deleteArticle (\n    input: {\n      id: \"{{articleId}}\"\n    }\n  )\n}\n```\n\n\n### Subscription\nNone\n\n## Import script\nA rake script is present under lib/tasks/.\nAims of this script is to be able to register authors or articles throught csv file.\nThose files must be placed under lib/assets folder.\n\nIf the script fail to register one author or one article it will continue to loop over the csv and print a report \nwith number of error at the end.\n\n``` shell\nsudo bundle exec rake import:all\n```\n\n**TODO/Improvement:**\n- [ ] Take csv form external source.\n- [ ] Validate csv file: content, size for example.\n- [ ] Print a pretty report at the end to indicate which author/article encountered issue.\n\n## Links\n* [Ruby on Rails fundamental concepts](https://medium.com/@bhuvaneshganesan/ruby-on-rails-fundamental-concepts-a3f6b92b0127#:~:text=Ruby%20on%20Rails%20is%20a,development%20more%20straightforward%20and%20efficient)\n* [The ails Command Line](https://guides.rubyonrails.org/v4.2/command_line.html)\n* [Ruby on Rails Projects: Introduction for Beginners](https://www.microverse.org/blog/ruby-on-rails-projects-introduction-for-beginners#toc-string-manipulation-projects)\n* [Ruby on Rails - Introduction](https://www.tutorialspoint.com/ruby-on-rails/rails-introduction.htm)\n* [Ruby on Rails Tutorial for Beginners with Project \u0026 Example](https://www.guru99.com/ruby-on-rails-tutorial.html)\n* [Using GraphQL with Rails 7: Building Efficient APIs](https://medium.com/simform-engineering/using-graphql-with-rails-7-building-efficient-apis-76006c14b8de)\n* [Using GraphQL with Ruby on Rails](https://www.apollographql.com/blog/using-graphql-with-ruby-on-rails)\n* [Doc Ruby](https://api.rubyonrails.org/)\n* [RailsGuides](https://guides.rubyonrails.org/getting_started.html)\n* [Set of tuto video on ruby on rails project](https://grafikart.fr/tutoriels/premiers-pas-838#autoplay)\n* [Tutorial Ruby on Rails pour débutants avec projet et exemple](https://www.guru99.com/fr/ruby-on-rails-tutorial.html)\n* [Tester les applications Rails](https://ai.rails-guide.com/fr/testing.html)\n* [RSpec - Basic syntax](https://www.tutorialspoint.com/rspec/rspec_basic_syntax.htm)\n* [Rake tutorial](https://lukaszwrobel.pl/blog/rake-tutorial/)\n* [Ruby Rake Tutorial](https://www.devdungeon.com/content/ruby-rake-tutorial)\n* [Rails Authentication with BCrypt \u0026 JWT, made simple and clear](https://medium.com/@brandon.lau86/rails-authentication-with-bcrypt-jwt-made-simple-and-clear-9268c116043f)\n* A lot of stack overflow\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchromain%2Frubytraining","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchromain%2Frubytraining","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchromain%2Frubytraining/lists"}