{"id":13747341,"url":"https://github.com/eliotsykes/real-world-rails","last_synced_at":"2025-04-11T03:38:01.860Z","repository":{"id":31382216,"uuid":"34945282","full_name":"eliotsykes/real-world-rails","owner":"eliotsykes","description":"Real World Rails applications and their open source codebases for developers to learn from","archived":false,"fork":false,"pushed_at":"2024-10-10T08:47:54.000Z","size":12957,"stargazers_count":1750,"open_issues_count":55,"forks_count":144,"subscribers_count":33,"default_branch":"main","last_synced_at":"2024-10-29T14:15:25.778Z","etag":null,"topics":["examples","learning-rails","rails-application","real-world","real-world-rails","ruby","ruby-on-rails"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eliotsykes.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":"2015-05-02T11:28:52.000Z","updated_at":"2024-10-17T05:42:05.000Z","dependencies_parsed_at":"2024-01-13T03:00:57.502Z","dependency_job_id":"1e2e2931-50a4-4f2c-8c26-6b385a61e785","html_url":"https://github.com/eliotsykes/real-world-rails","commit_stats":{"total_commits":7903,"total_committers":12,"mean_commits":658.5833333333334,"dds":0.08806782234594457,"last_synced_commit":"c5e6e6e1d9f74026ca3d7fad449998803dbba9af"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliotsykes%2Freal-world-rails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliotsykes%2Freal-world-rails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliotsykes%2Freal-world-rails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliotsykes%2Freal-world-rails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eliotsykes","download_url":"https://codeload.github.com/eliotsykes/real-world-rails/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248338363,"owners_count":21087207,"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":["examples","learning-rails","rails-application","real-world","real-world-rails","ruby","ruby-on-rails"],"created_at":"2024-08-03T06:01:25.562Z","updated_at":"2025-04-11T03:38:01.835Z","avatar_url":"https://github.com/eliotsykes.png","language":"Ruby","funding_links":[],"categories":["Happy Exploring 🤘","Ruby","Miscellaneous","Lists of Rails Things","Uncategorized"],"sub_categories":["Rails codebases to study","Uncategorized"],"readme":"# Real World Rails\n\n\u003e Real World Rails applications and their open source codebases for developers to learn from\n\nThis project brings 100+ (and growing) active, open source Rails apps and engines together in one repository, making it easier for developers to download the collected codebases and learn from Rails apps written by experienced developers. Reading open source code can be an invaluable learning aid. You\u0026rsquo;ll find the source code in the [`apps/`](apps/) and [`engines/`](engines/) subdirectories.\n\nReal World Rails was begun to help teach newer developers and to research and write about Rails development practices:\n\n- Find example usage of a method you\u0026rsquo;re unsure of\n- Learn how other developers use a gem you\u0026rsquo;d like to use\n- Discover how to write tests\n- See how Rails engines are built\n- \u0026hellip;and much, much more.\n\n## How to install on your computer\n\nEnsure you have git-lfs installed: https://git-lfs.com\n\n```bash\n# Clone this git repo:\ngit clone git@github.com:eliotsykes/real-world-rails.git\n\ncd real-world-rails/\n\n# The Rails apps are linked to as git submodules.\nGIT_LFS_SKIP_SMUDGE=1 git submodule update --init --single-branch --jobs 4\n\n# To run the `bin/rwr` inspectors, install gems:\nbundle install\n\necho \"All done! Why not run some inspections? Run bin/rwr\"\n```\n\n## How to update your local copy of real-world-rails\n\nPull the latest commits from this repo and update submodules:\n```bash\ngit pull\nGIT_LFS_SKIP_SMUDGE=1 git submodule update\n```\n\n\n## Other Real World Codebase Collections\n\n- Real World Sinatra https://github.com/jeromedalbert/real-world-sinatra\n- Real World Ember https://github.com/eliotsykes/real-world-ember\n- Real World Ruby Apps https://github.com/jeromedalbert/real-world-ruby-apps\n- Real World React https://github.com/jeromedalbert/real-world-react\n- Real World Django https://github.com/ckrybus/real-world-django\n\n## How you can analyze Real World Rails apps\n\n#### Find job subclasses\n\nThis will find most, but not all job subclasses (requires [ag](https://github.com/ggreer/the_silver_searcher#installing)):\n\n```bash\n# Outputs jobs source in terminal\nag --ruby '\u003c [A-Za-z]+Job\\b'\n\n# Open each job in your editor (e.g. atom)\nag --ruby -l '\u003c [A-Za-z]+Job\\b' | xargs atom\n```\n\n(used to research [Real World Rails Background Jobs](https://www.eliotsykes.com/real-world-rails-background-jobs))\n\n#### List models from *every* Real World Rails application\n\nInterested in seeing how your fellow developers name their models? Run:\n\n```bash\nbin/rwr models | sort -f | uniq -c | sort -k 1nr -k 2f\n```\n\n#### Show constants of every Real World Rails app\n\n```bash\nbin/rwr constants\n```\n(this helped when researching [Magic Numbers in Ruby \u0026 How You Make Them Disappear](https://eliotsykes.com/magic-numbers))\n\n#### Show view specs\n\nSee the file path and source of every view spec in every app:\n```bash\nbin/rwr view-specs\n```\n(this will show 250+ view specs, see them in [The Big List of View Specs](https://eliotsykes.com/view-specs))\n\n#### Show model methods\n\nSee just the model method names and file paths:\n```bash\nbin/rwr model-method-names\n```\n\nSee the model method source and file paths:\n```bash\nbin/rwr model-methods\n```\n\n#### Find projects using gem\n\n```bash\nfind apps/ -name Gemfile.lock | xargs grep GEM_NAME_GOES_HERE\n\n# e.g. Find all projects using doorkeeper gem\nfind apps/ -name Gemfile.lock | xargs grep doorkeeper\n```\n\n#### Analyze view naming practices\n\n```bash\nbin/rwr shared-view-dirs\nbin/rwr view-naming\n```\n\n#### Find ideas on how to configure your foreman processes\n\n```bash\n# Outputs contents from all Procfiles\nfind apps/ -name 'Procfile*' | xargs cat\n```\n\n\n## Settings\n\n#### Analyzing directories outside of `apps/`\n\nPrefix the `bin/rwr` command with the `FILES_PATTERN` environment variable:\n\n```bash\nFILES_PATTERN=~/dev/my-rails-app/**/*.rb bin/rwr\n```\n\n#### Change source output format to markdown\n\nPrefix `bin/rwr` with the `SOURCE_OUTPUT_FORMAT` environment variable:\n```bash\nSOURCE_OUTPUT_FORMAT=markdown bin/rwr view-specs\n```\n\n## Information for Contributors\n\n#### How to add a Real World Rails app\n\nGiven a GitHub repo for a Rails app `githubuser/foo`:\n\n```bash\n# Inside real-world-rails root:\n# Replace \u003cDEFAULT_BRANCH\u003e with correct branch (probably 'main').\nGIT_LFS_SKIP_SMUDGE=1 git submodule add -b \u003cDEFAULT_BRANCH\u003e git@github.com:githubuser/foo.git apps/foo\n```\n\n#### How to remove a git submodule\n\nOnly use this if a previously public repo has been removed:\n\n```bash\n# Remove the submodule from .git/config\ngit submodule deinit -f path/to/submodule\n\n# Remove the submodule from .git/modules\nrm -rf .git/modules/path/to/submodule\n\n# Remove from .gitmodules and remove the submodule directory\ngit rm -f path/to/submodule\n```\n\n#### Writing an Inspector? Some docs to help understand AST, Parser\u0026hellip;\n\nThe [inspectors](lib/real_world_rails/inspectors) are responsible for the analysis of the Rails apps.\n\nReview the existing [inspectors](lib/real_world_rails/inspectors) if you're looking for some info on how to write a new one, and see these API docs:\n\n- http://whitequark.github.io/ast/AST/Node.html\n- http://www.rubydoc.info/github/whitequark/parser/master/Parser/AST/Processor\n- http://whitequark.github.io/ast/AST/Processor.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feliotsykes%2Freal-world-rails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feliotsykes%2Freal-world-rails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feliotsykes%2Freal-world-rails/lists"}