{"id":23554270,"url":"https://github.com/headwinds/bureau-de-la-randonnee","last_synced_at":"2025-08-20T15:46:50.889Z","repository":{"id":269111868,"uuid":"906449166","full_name":"headwinds/bureau-de-la-randonnee","owner":"headwinds","description":"a small inventory management app to learn the basics of ruby on rails","archived":false,"fork":false,"pushed_at":"2024-12-21T14:14:13.000Z","size":10960,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-21T15:23:28.110Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/headwinds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-12-21T00:01:38.000Z","updated_at":"2024-12-21T14:14:16.000Z","dependencies_parsed_at":"2024-12-21T15:23:33.378Z","dependency_job_id":null,"html_url":"https://github.com/headwinds/bureau-de-la-randonnee","commit_stats":null,"previous_names":["headwinds/bureau-de-rondonnee","headwinds/bureau-de-la-randonnee"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/headwinds%2Fbureau-de-la-randonnee","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/headwinds%2Fbureau-de-la-randonnee/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/headwinds%2Fbureau-de-la-randonnee/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/headwinds%2Fbureau-de-la-randonnee/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/headwinds","download_url":"https://codeload.github.com/headwinds/bureau-de-la-randonnee/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239294194,"owners_count":19615085,"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-12-26T12:13:39.037Z","updated_at":"2025-02-17T13:21:05.698Z","avatar_url":"https://github.com/headwinds.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bureau De La Randonnée\n### A Toy Ruby on Rails Product API\n\n- Rudy on Rails\n- PostgreSQL \n\n\u003cimg src=\"./bureau_de_la_randonnee.png\" width=\"500\" /\u003e\n\na small inventory management app to learn the basics of ruby on rails\n\n\n# Basic Setup\n\ncreate a .env file with:\n```\nDB_URI_LOCALHOST=\nDB_URI_REMOTE=\nREMOTE_ENV=\nDB_NAME=\nDB_USER=\n```\n\n1. clone the repo\n```\ngit clone https://github.com/yourusername/bureau-de-la-randonnee.git\ncd bureau-de-la-randonnee\n```\n\n2. install the dependencies\n```\ngem install bundler\nbundle install\n```\n\n3. update the environment variables\n\nsee your newly created .env file and fill in the strings if you haven't already\n\n4. setup and seed db\n```\nrails db:create\nrails db:migrate\nrails db:seed\n```\n5. run rails\n```\nrails s\n```\n\nvisit: `http://localhost:3000/products`\n\n## Heroku \n\nNote: I first tried Vercel and had too many issues with their experimental Rails deployment process. It's much easier using Docker and Heroku for Rails.\n\n```\nbrew tap heroku/brew \u0026\u0026 brew install heroku\nheroku login\nheroku create\ngit remote add heroku\nhttps://git.heroku.com/bureau_de_la_randonnee.git\ngit push heroku main\nheroku run rails db:migrate\nheroku run rails db:seed\nheroku open\n```\n\nBy following these steps, we can deploy your Dockerized Rails application to Heroku. Heroku's free tier is suitable for hobby projects and provides a straightforward way to deploy and manage your application.\n\n[Dokku](https://dokku.com/), [Fly](https://fly.io/docs/rails/), and [Render](https://render.com/docs/deploy-rails) are alternatives.\n\n# Tutorial \n\n## Getting Started with Ruby on Rails\n\n- [Ask perplexity](https://www.perplexity.ai/search/i-want-to-learn-the-basics-of-yenohVH9R0KOoReiKvZp.w)\n\n```\ngem install rails\n```\n\n## Goal\n\nThis app should allow an admin to manage products and offer some for sale via an API.\n\nThe admin should be able to:\n- add a product\n- delete a product\n- update a product\n\nAn admin could apply a few simple promotions like to creating 10% discount for certain period of time. \n\nSimilar to product management, they would do the same CRUD for a promotion. \n\n```\nrails new bureau_de_la_randonnee --api --database=postgresql\n```\n\n## Create a Product\n\n```\ncd bureau_de_la_randonnee\nrails generate scaffold Product name:string price:decimal promotion_applied:boolean stock_level:integer\n```\n\nRails will automatically add the id field\n\nupdate the database \n\n```\nrails db:migrate\n```\n\nrun the app\n\n```\nrails s\n```\n\nvisit `http://localhost:3000`\n\nconnect to the console\n\n```\nrails c\n```\n\n## Database Config\n\nconfig \u003e database.yml\n\nI also added dotenv support modifying the gemfile \n\n## Stretch Goal\n\nCan we connect to [GoBolt API](https://www.docs.parcel.gobolt.com/) to ship a product?\n\n## Learning \n\n- [4 hours Rails course on Youtube](https://www.youtube.com/watch?v=fmyvWz5TUWg)\n- [Create a Basic API with Rails](https://www.youtube.com/watch?v=3S9fyfmCf1A\u0026t=4s)\n- [Should you use Ruby on Rails in 2024?](https://www.youtube.com/watch?v=w7UzwO673Gg)\n\n## Troubleshooting\n\nMy first rails mistake was trying to add an id field so I had to roll that back\n\nRollback the migration:\n\n```\nrails db:rollback\nrails destroy scaffold Product\nrails generate scaffold Product name:string price:decimal promotion_applied:boolean stock_level:integer\nrails db:migrate\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheadwinds%2Fbureau-de-la-randonnee","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheadwinds%2Fbureau-de-la-randonnee","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheadwinds%2Fbureau-de-la-randonnee/lists"}