{"id":14955792,"url":"https://github.com/shannarra/rails7template","last_synced_at":"2026-02-01T23:02:24.435Z","repository":{"id":198492658,"uuid":"700906704","full_name":"Shannarra/rails7template","owner":"Shannarra","description":"A Dockerized Rails 7 fully-featured template application with opt-in authentication support","archived":false,"fork":false,"pushed_at":"2024-11-05T22:09:35.000Z","size":2400,"stargazers_count":1,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T04:08:39.649Z","etag":null,"topics":["docker","dockercompose","ruby","ruby-on-rails","ruby-on-rails-7","rubyonrails","template","template-repository"],"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/Shannarra.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":"2023-10-05T14:23:25.000Z","updated_at":"2024-08-20T14:24:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"f9847a02-bd40-43be-8352-2475a62b9aae","html_url":"https://github.com/Shannarra/rails7template","commit_stats":{"total_commits":144,"total_committers":2,"mean_commits":72.0,"dds":0.4305555555555556,"last_synced_commit":"0125d61d8daeb884f7ee7b1edaba8e44804f880f"},"previous_names":["shannarra/rails7template"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Shannarra/rails7template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shannarra%2Frails7template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shannarra%2Frails7template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shannarra%2Frails7template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shannarra%2Frails7template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Shannarra","download_url":"https://codeload.github.com/Shannarra/rails7template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shannarra%2Frails7template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260315020,"owners_count":22990689,"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":["docker","dockercompose","ruby","ruby-on-rails","ruby-on-rails-7","rubyonrails","template","template-repository"],"created_at":"2024-09-24T13:11:48.640Z","updated_at":"2026-02-01T23:02:24.398Z","avatar_url":"https://github.com/Shannarra.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rails 7 Template application [![Ruby](https://github.com/Shannarra/rails7template/actions/workflows/ruby.yml/badge.svg)](https://github.com/Shannarra/rails7template/actions/workflows/ruby.yml)\n\nThis app demonstrates Rails 7 with PostgreSQL, import maps, turbo, stimulus, bootstrap and hotwire, all running in Docker.  \nYou can also bootstrap the application with authentication frameworks like Devise in order to ease your work. \n\n## Features\n* Rails 7\n* Ruby 3\n* Bootstrap\n* Dockerfile and Docker Compose configuration\n* PostgreSQL database\n* Redis\n* GitHub Actions for\n  * tests\n  * Rubocop for linting\n  * Security checks with [Brakeman](https://github.com/presidentbeef/brakeman) and [bundler-audit](https://github.com/rubysec/bundler-audit)\n* Dependabot for automated updates\n\n#### Optional features:\n* Authentication with Devise\n  * See [Devise setup](#devise-setup) for more info\n\n## Requirements\n\nPlease ensure you are using Docker Compose V2. This project relies on the `docker compose` command, not the previous `docker-compose` standalone program.\n\nhttps://docs.docker.com/compose/#compose-v2-and-the-new-docker-compose-command\n\nCheck your docker compose version with:\n```\n$ docker compose version\nDocker Compose version v2.20.2\n```\n\n## Initial setup\n\nYou can just run the [startup.sh](https://github.com/Shannarra/rails7template/edit/master/startup.sh) script:\n```console\nsh ./startup.sh\n```\nThis will bootstrap a Rails 7 application that has some sample data but misses a lot of features, for example, it has no authentication.\n\nIf you want to have built-in authentication with Devise you can do the following:\n\n\u003cdetails\u003e\n\u003csummary\u003e \u003ch3\u003eDevise setup\u003c/h3\u003e (optional)\u003c/summary\u003e\nSetting the application up to work with Devise is very straightforward, just a single command:\n\n```console\nsh startup.sh --devise user\n```\n\nIn this case, the application will be created with authentication mechanism for a model called \"User\".  \nThe given model will be created, migrated and integrated with the application upon startup.\n\n\u003ch4\u003eDebugging\u003c/h4\u003e\nIf you have already ran the startup.sh script in your project for a devise, and try to run it again with the SAME devise, you \u003cb\u003e\u003ci\u003eWILL\u003c/i\u003e\u003c/b\u003e encounter the following error:\n\n```console\nPG::DuplicateColumn: ERROR:  column \"email\" of relation \"[DEVISE NAME]\" already exists (PG::DuplicateColumn)\n```\n\nFollowed by an UI error saying that \n```console\nYou have 1 pending migration:\n\ndb/migrate/YYYYMMDDHHMMSS_add_devise_to_[DEVISE NAME].rb\n```\n\nTo resolve this issue, you need to either:\n- drop and remove the entire container, and run the `startup` script again  \nor\n- manually remove the new migration causing the issue and re-run the script with a changed devise name.\n\n---\n\u003c/details\u003e\n\n### Extras\nUsing the `startup.sh` script, you can skip the next step and make it so the application starts immediately after it has been built:\n```console\nsh startup.sh --run # -r works as well :) \n```\n\nIf you want to learn more about this script you can just call the `--help` option.\n\n## Running the Rails app\n```console\ndocker compose up\n```\nThen just navigate to http://localhost:3000\n\n## Running the Rails console\nWhen the app is already running with `docker-compose` up, attach to the container:\n```console\ndocker compose exec web bin/rails c\n```\n\nWhen no container running yet, start up a new one:\n```console\ndocker compose run --rm web bin/rails c\n```\n\n## Running tests\n```console\ndocker compose run --rm web bin/rspec\n```\n\n## Time localization\nIf you want to change the timezone to your specific locale you can do this very simply, just change the TIMEZONE variable in the .env file:\n\n```console\n# TODO: change to CET, EET or wherever you live\nTIMEZONE=UTC\n```\n\n## Updating gems\n```console\ndocker compose run --rm web bundle\ndocker compose up --build\n```\n\n## Production build\n\n```console\ndocker build -f production.Dockerfile .\n```\n\n## Deployment\n\nThis app can be hosted wherever Ruby is supported and PostgreSQL databases can be provisioned.\n\n#### Render\n\n[![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)](https://render.com/deploy?repo=[https://github.com/Shannarra/rails7template](https://github.com/Shannarra/rails7template))\n\nNOTE: You will need to generate a production secret with `bin/rails secret` and set it as the `SECRET_KEY_BASE` environment variable.\n\n## Credits/References\n\n### Rails with Docker\n* [Quickstart: Compose and Rails](https://docs.docker.com/compose/rails/)\n* [Docker for Rails Developers\nBuild, Ship, and Run Your Applications Everywhere](https://pragprog.com/titles/ridocker/docker-for-rails-developers/)\n* [Ruby on Whales:\nDockerizing Ruby and Rails development](https://evilmartians.com/chronicles/ruby-on-whales-docker-for-ruby-rails-development)\n* [Original inspiration repo](https://github.com/ryanwi/rails7-on-docker)\n\n### Rails 7 with importmaps\n\n* [Alpha preview: Modern JavaScript in Rails 7 without Webpack](https://www.youtube.com/watch?v=PtxZvFnL2i0)\n\n### Rails 7 with hotwire\n\n* [Stimulus 3 + Turbo 7 = Hotwire 1.0](https://world.hey.com/dhh/stimulus-3-turbo-7-hotwire-1-0-9d507133)\n* [Turbo 7](https://world.hey.com/hotwired/turbo-7-0dd7a27f)\n* [Rails 7 will have three great answers to JavaScript in 2021+](https://world.hey.com/dhh/rails-7-will-have-three-great-answers-to-javascript-in-2021-8d68191b)\n* [Hotwire Turbo Replacing Rails UJS](https://www.driftingruby.com/episodes/hotwire-turbo-replacing-rails-ujs)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshannarra%2Frails7template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshannarra%2Frails7template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshannarra%2Frails7template/lists"}