{"id":18001868,"url":"https://github.com/pch/rails-boilerplate","last_synced_at":"2025-03-26T08:31:02.968Z","repository":{"id":138105726,"uuid":"441926112","full_name":"pch/rails-boilerplate","owner":"pch","description":"🛤 Ruby on Rails project template with custom authentication and my preferred defaults","archived":false,"fork":false,"pushed_at":"2024-02-02T08:18:37.000Z","size":135,"stargazers_count":49,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-21T11:52:28.214Z","etag":null,"topics":["authentication","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/pch.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":"2021-12-26T15:42:31.000Z","updated_at":"2025-02-04T20:39:24.000Z","dependencies_parsed_at":"2024-10-29T23:42:59.303Z","dependency_job_id":null,"html_url":"https://github.com/pch/rails-boilerplate","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pch%2Frails-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pch%2Frails-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pch%2Frails-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pch%2Frails-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pch","download_url":"https://codeload.github.com/pch/rails-boilerplate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245618643,"owners_count":20645038,"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":["authentication","rails","ruby","ruby-on-rails"],"created_at":"2024-10-29T23:19:03.313Z","updated_at":"2025-03-26T08:31:02.659Z","avatar_url":"https://github.com/pch.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# README\n\nThis is a Ruby on Rails project template I created to avoid having to set up the same boring stuff from scratch over and over again.\n\nIncludes:\n\n- complete authentication (not based on 3rd-party gems)\n- encryption for name, email \u0026 IP using [Active Record Encryption](https://guides.rubyonrails.org/active_record_encryption.html)\n- auth activity tracking (login, logout, password reset, failed login attempts)\n- city-level geocoding for IP addresses\n- revokable sessions\n- [propshaft](https://github.com/rails/propshaft)\n- CSS bundling (postcss) \u0026 JS bundling (esbuild, turbo, stimulus)\n- basic CSS\n- sidekiq\n- [BasedUUID](https://github.com/pch/based_uuid) - URL-friendly UUIDs\n\nIt is heavily based on my personal preferences and opinions, but I hope it can be a useful starting point for your apps too.\n\nIt's not a gem, not a Rails engine. It's a regular Rails project and everything is customizable. Feel free to change what you don't like and remove what you don't need.\n\n## How to use it?\n\nRails Boilerplate is a project you use instead of running `rails new`. Simply click the \"Use this template\" button on GitHub to create your own project based on this starter.\n\n### Configuration\n\nAfter you clone the repo, use the find-and-replace in your editor to rename \"boilerplate\" throughout the project.\n\nSet up initial config (for [credentials](https://edgeguides.rubyonrails.org/security.html#environmental-security) \u0026 [encryption](https://guides.rubyonrails.org/active_record_encryption.html)):\n\n```sh\nbin/rails credentials:edit\n```\n\nThe command above will create a new `config/master.key` file. Don't check it into your repository. Save it in a password manager, or another safe place. Without it you won't be able to decrypt the data (names, emails \u0026 IP addresses).\n\n(In production, use `RAILS_MASTER_KEY` environment variable instead of `config/master.key`)\n\nTo set up encryption, run this:\n\n```sh\nbin/rails db:encryption:init\n```\n\nCopy the output and add it to your credentials via `bin/rails credentials:edit`\n\n### Initial credentials file\n\nThe initial credentials file should look like this:\n\n```yaml\n# Used as the base secret for all MessageVerifiers in Rails, including the one protecting cookies.\nsecret_key_base: \u003cRANDOM_SECRET_STRING\u003e\n\nactive_record_encryption:\n  primary_key: \u003cPRIMARY_KEY\u003e\n  deterministic_key: \u003cDETERMINISTIC_KEY\u003e\n  key_derivation_salt: \u003cSALT_STRING\u003e\n```\n\n### Setup database\n\n```sh\nrails db:setup\n```\n\n### Geocoding\n\nThis app uses [Geocoder](https://github.com/alexreisner/geocoder) for city-level geocoding. For perfomance and GDPR compliance, it is recommended to use a local database, which can be downloaded from the [MaxMind's website](https://dev.maxmind.com/geoip/geoip2/geolite2/) (you'll need the GeoLite2 City database).\n\nOnce you have downloaded the databse, update the `maxmind_geolite2_file` value in `config/config.yml`, pointing it to your `GeoLite2-City.mmdb` file.\n\n---\n\n## Upgrades\n\nClone your repo and add boilerplate as upstream:\n\n```sh\ngit remote add boilerplate git@github.com:pch/rails-boilerplate.git\n```\n\nYou can then work on your project as usual, pushing to your `main` or a feature branch. If you ever need to pull latest updates to the starter project, simply pull changes from `boilerplate`:\n\n```sh\ngit fetch boilerplate\ngit checkout main\n\n# create a new branch for upgrades\ngit checkout -b boilerplate-upgrade\n\n# merge latest changes to your branch\n# (you'll run into conflicts depending on how much you modify the base code)\ngit merge boilerplate/main --allow-unrelated-histories\n\n# run tests\nrails test\n\n# merge upgrades to your main branch\ngit checkout main\ngit merge boilerplate-upgrade\ngit push origin main\ngit branch -d boilerplate-upgrade\n```\n\nYou can also `cherry-pick` commits that interest you instead of merging everything.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpch%2Frails-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpch%2Frails-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpch%2Frails-boilerplate/lists"}