{"id":25540966,"url":"https://github.com/anthonywrather/demo_ror_app","last_synced_at":"2026-04-16T19:38:57.442Z","repository":{"id":277054213,"uuid":"931181694","full_name":"AnthonyWrather/demo_ror_app","owner":"AnthonyWrather","description":"This is a sample RoR 3.3.3/7.2.2.1 Devise Hotwire App","archived":false,"fork":false,"pushed_at":"2025-05-19T12:22:07.000Z","size":383,"stargazers_count":0,"open_issues_count":10,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-30T02:44:51.504Z","etag":null,"topics":["devise","hotwire","postgres","rails","ruby"],"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/AnthonyWrather.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":"2025-02-11T21:07:26.000Z","updated_at":"2025-02-22T02:03:45.000Z","dependencies_parsed_at":"2025-02-11T22:38:13.337Z","dependency_job_id":null,"html_url":"https://github.com/AnthonyWrather/demo_ror_app","commit_stats":null,"previous_names":["anthonywrather/demo_ror_app"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/AnthonyWrather/demo_ror_app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnthonyWrather%2Fdemo_ror_app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnthonyWrather%2Fdemo_ror_app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnthonyWrather%2Fdemo_ror_app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnthonyWrather%2Fdemo_ror_app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AnthonyWrather","download_url":"https://codeload.github.com/AnthonyWrather/demo_ror_app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnthonyWrather%2Fdemo_ror_app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278322188,"owners_count":25967873,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["devise","hotwire","postgres","rails","ruby"],"created_at":"2025-02-20T06:22:29.606Z","updated_at":"2025-10-04T13:46:45.010Z","avatar_url":"https://github.com/AnthonyWrather.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# README\n\nThis is a sample RoR application using Dev Containers.\\\nIt uses devise, hotwire, turbo, stimulus with a postgres db.\n\n```bash\n  Ruby version : 3.3.3\n  Rails version : 7.2.2.1\n```\n\n## Create initial project and setup.  (Release v0.0.1)\n\n```bash\nrails new demo_ror_app -c tailwind --database=postgresql --devcontainer\n```\n\n* Update the devcontainer\n\nAdded pgadmin to the Dev Containers setup in .devcontainer/compose.yaml\n\n```yaml\n    depends_on:\n    - pgadmin\n\n  pgadmin:\n    image: dpage/pgadmin4\n    restart: unless-stopped\n    environment:\n      PGADMIN_DEFAULT_EMAIL: \"pgadmin@pgadmin.com\"\n      PGADMIN_DEFAULT_PASSWORD: \"password\"\n    volumes:\n      - pgadmin-data:/var/lib/pgadmin\n    ports:\n      - \"15432:80\"\n    depends_on:\n      - postgres\n\n  volumes:\n    pgadmin-data:\n```\n\nAdded some common extensions to VSCode\n\n```bash\n  \"customizations\": {\n    \"vscode\": {\n      \"extensions\": [\n        \"misogi.ruby-rubocop\",\n        \"Shopify.ruby-lsp\",\n        \"castwide.solargraph\",\n        \"hridoy.rails-snippets\",\n        \"eamodio.gitlens\",\n        \"kaiwood.endwise\",\n        \"esbenp.prettier-vscode\",\n        \"streetsidesoftware.code-spell-checker\",\n        \"GitHub.vscode-pull-request-github\",\n        \"karunamurti.rspec-snippets\",\n        \"oderwat.indent-rainbow\",\n        \"Gruntfuggly.todo-tree\",\n        \"redhat.vscode-yaml\",\n        \"bradlc.vscode-tailwindcss\",\n        \"vortizhe.simple-ruby-erb\",\n        \"miguel-savignano.ruby-symbols\",\n        \"hoovercj.ruby-linter\",\n        \"WallabyJs.quokka-vscode\",\n        \"pdconsec.vscode-print\",\n        \"christian-kohler.path-intellisense\",\n        \"christian-kohler.npm-intellisense\",\n        \"bierner.markdown-preview-github-styles\"\n      ]\n    }\n  }\n```\n\nRun the following to enable you to publish to GitHub\n\n```bash\n  git config --global --add safe.directory /workspaces/demo_ror_app\n```\n\n* EDIT: Not needed in a devcontainer but would be if running locally\n\n```bash\n  rails db:create\n  bin/rails db:migrate\n```\n\nEither use VSCode or run the git commands to commit the code to GitHub\\\nAdd Solargraph\n\n```bash\ngem install solargraph\n```\n\nAnd run the server\n\n```bash\nbin/dev\n```\n\nWeb App\n\nUseful links.\nThe webapp\\\nhttp://localhost:3000/ \\\nAn endpoint to see if your running.\\\nhttp://localhost:3000/up \\\nAll your webserver routes.\\\nhttp://localhost:3000/rails/info/routes\n\nPgAdmin\n\nCreate a connection to name:postgres hostname:postgres user:postgres password:progress\\\nhttp://localhost:15432/\n\nBy using dev containers there is a complete separation between dev, test and production.\n\n## Create the home page and basic styling. (Release v0.0.2)\n\n```bash\nrails g controller home index\n```\n\nUpdate routes.rb\n\n```bash\n  root \"home#index\"\n```\n\nAdded to Gemfile\n\n```bash\ngem \"inline_svg\"\ngem \"htmlbeautifier\"\n```\n\nAdded to Development section in Gemfile\n\n```bash\n  gem \"solargraph\"\n```\n\nRun\n\n```bash\nbundle\n```\n\nAdd the HTML etc to get a basic layout of the landing page.\n\n## GitHub CI/CD test run fails.\n\nEdit the test/controllers/home_controller_test.rb and rerun the tests.\n\n```bash\nbin/rails db:test:prepare test test:system\n```\n\n## Authentication with devise. (Release v0.0.3)\n\n```bash\nrails g controller dashboard\n```\n\nEdit app/controllers/dashboard_controller.rb\\\nEdit config/routes.rb\n\nAdd devise\n\n```bash\nbundle add devise\nrails g devise:install\nrails g devise:views\nrails g devise user\nrails db:migrate\n```\n\nEdit app/views/layouts/application.html.erb to add the flash messages.\\\nCreate app/views/dashboard.html.erb\\\nEdit app/controllers/dashboard_controller.rb and add the before action.\\\nSplit the navbar out into its own file app/views/home/_navbar.html.erb\\\nStyle the Sign Up screen\\\nEdit app/views/devise/registrations/new.html.erb\\\nNow implement the same styling on the login screen.\n\nRun rubocop\n\n```bash\nrubocop -a\n```\n\nRun the tests.\\\nThe current tests fail with db errors so that will need tidying up.\n\n```bash\nbin/rails db:test:prepare test test:system\n```\n\nCommit and push changes\n\n## Alert and Notice messages with stimulus. (Release v0.0.4)\n\nCreate the close controller\n\n```bash\nrails g stimulus close\n```\n\nSetup the close controller for the close action on Alerts and Notices.\n\nRun rubocop\n\n```bash\nrubocop -a\n```\n\n## Build the Dashboard. (Release v0.0.5)\n\nSetup the navigation bar.\\\nBuild the user menu.\\\nTODO: Style the Profile screen.\\\nToggle the Profile card\n\n```bash\nrails g stimulus toggle\n```\n\nBuild the sidebar.\\\nToggle the sidebar.\n\nRun rubocop\n\n```bash\nrubocop -a\n```\n\n## Bonus Edit - Apply some style to the Edit User screen. (No Release)\n\nStyled the Edit User screen.\n\n## Setup the Project screens. (Release v0.0.6)\n\nLayout for the Projects page.\n\n```bash\nrails g controller projects index\n```\n\nCreate the table for the Projects.\\\nMake the Projects table dynamic.\\\nCreate the Project model.\n\n```bash\n# Associate the user_id with a project.\nrails g model project name:string user:references\nrails db:migrate\n```\n\nEnable the creation of Projects.\\\nEnable the deletion of Projects.\\\nCreate a basic Project edit screen.\\\nEdit Project in a modal. (Turbo Frames)\\\nSetting up Turbo Morphing to preserve the scroll.\n\n## Setup the Tasks (Release v0.0.7)\n\nCreate the scaffold for the Tasks.\n\n```bash\nrails g scaffold task name:string due_date:date completed_at:datetime priority:integer project:references\nrails db:migrate\n```\n\nCrud Tasks and Enums.\\\nMove Tasks to the Dashboard layout.\\\nNest Tasks under Projects.\\\nNew Project+Task modal.\\\nStyle the Project+Task modal.\\\nProject+Task CRUD operations.\\\nCreate the table of Tasks.\\\nUpdate and Delete a Project+Task\\\nBugfix the flash timeout and redirect after Login\\\nTask complete checkbox and tidy up some files.\\\nBONUS: Added some basic Redirect testing for unauthenticated users.\\\nBONUS: Added some basic System tests.\\\nBONUS: Readme tidy up.\\\nToggle completed task.\n\n```bash\nrails g migration add_completed_to_tasks completed:boolean\n```\n\nEdit db/migrate/20250214121801_add_completed_to_tasks.rb and add a default of false.\n\n```bash\nrails db:migrate\n```\n\nNow run the standard code cleanup and tests.\n\n```bash\nrubocop -a\nrails test\nrails test:system\n```\n\nAuto update the competed_at date/time.\\\nRefactor completed_at callback.\\\nRearrange the Tasks table and hide the Sidebar.\\\nImplement Task validation.\\\nFormat the date/time in Tasks.\\\nSort the Tasks.\\\nTask progress bar.\n\n## Generate sample data using Faker (Release 0.0.8)\n\nFaker seeding data.\n\n```bash\nrails db:drop\nrails db:reset\n```\n\n## DEBUG: Using the Rails console to validate the Dev Test data.\n\n```bash\nirb\nrails c\nrails console\n\nLoading development environment (Rails 7.2.2.1)\ndemo-ror-app(dev)\u003e User.all\ndemo-ror-app(dev)\u003e User.count\ndemo-ror-app(dev)\u003e Project.all\ndemo-ror-app(dev)\u003e Project.count\ndemo-ror-app(dev)\u003e Task.all\ndemo-ror-app(dev)\u003e Task.count\ndemo-ror-app(dev)\u003e exit\n```\n\n## Pagination (Release v0.0.9)\n\nPaginating Projects\\\nPaginating Tasks\n\nUseful websites\\\nhttps://www.ruby-toolbox.com/categories \\\nhttps://ddnexus.github.io/pagy/\n\nAdd pagy\n\n```bash\nbundle install\n```\n\n## Searching and Sorting (Release v0.0.10)\n\nCreate the Search controller.\n\n```bash\nrails g controller search index\n```\n\n## DEBUG: Edit app/controllers/search_controller.rb and add console to the index method.\nYou can type in params to see what you dealing with.\n\nStyling the Search Project page.\\\nSearch via debounce\n\n```bash\nrails g stimulus search\n```\n\nSearch Task name using ransack.\\\nAdd the ransack gem and run\n\n```bash\nbundle install\n```\n\nUseful websites\\\nhttps://www.ruby-toolbox.com/categories \\\nhttps://github.com/activerecord-hackery/ransack\n\n\nSort Tasks by Priority\\\nSort Tasks using Table headers.\\\nStyling by Priority and Expired.\n\n\n## Notifications (Release v0.0.11)\n\nNotification UI\\\nIdentify the urgent tasks.\\\nInstall and Setup noticed gem.\n\nInstall noticed and run bundler.\\\nhttps://github.com/excid3/noticed \\\nInfo on tailwind here. \\\nhttps://tailwindcss.com\n\n```bash\nbundle add \"noticed\"\nrails noticed:install:migrations\nrails db:migrate\nrails g noticed:notifier UrgentTaskNotifier\n```\n\nRun the usual commands and commit.\n\n```bash\nrubocop -a\nrails test\nrails test:system\n```\n\n## DEBUG: You can add a console in the html by using\n\n  `\u003c%= console %\u003e`\n\nNotifications controller.\n```bash\nrails g controller notifications index\n```\n\nMark Notifications as read.\n```bash\nrails g controller read_notifications\n```\n\nCreate an Urgent Task class method.\\\nSetup Active Job.\\\nThere is a management interface.\n```bash\nrails g job urgent_task\n```\nInstall/Setup Good Job.\n```bash\nbundle add good_job\nbin/rails g good_job:install\nbin/rails db:migrate\n```\n\nManagement interface.\\\nhttp://localhost:3000/good_job\n\nAction Mailer for Urgent Tasks.\n\n```bash\nbin/rails generate mailer urgent_task\n```\nYou can create a preview portal for the mailers\\\nhttp://localhost:3000/rails/mailers/\n\n## Bonus Tip (No Release)\n\nYou can easily compare two releases on GitHub with\\\nhttps://github.com/AnthonyWrather/demo_ror_app/compare/v0.0.9...v0.0.10\n\n## Dashboard Setup (Release v0.0.12)\n\nGitHub Branching and Merging\n\nSetup a Ruleset on GitHub that enforce branching and Pull Requests (PR) going forwards.\\\nThe default build tools must pass before a branch can be merged.\n\n* scan_js\n* scan_ruby\n* lint\n* test\n\nAlso added CodeQL with AI suggestions to see how that works.\n\nBuild Dashboard cards. Create a branch called BuildDashboardCards\\\nBuild the Charts. Create a branch called BuildTheCharts\\\nhttps://github.com/ankane/chartkick\n```bash\nbundle add chartkick\n```\n\nAlso need to install groupdate\\\nhttps://github.com/ankane/groupdate\n```bash\nbundle add groupdate\n```\n\n## Build the Calendar (Release v0.0.13)\n\nBuild a Calendar for the Tasks. (Branch BuildACalendarForTasks)\n\n```bash\nrails g controller calendar index\n```\n\nAdd the Simple Calendar gem.\\\nhttps://github.com/excid3/simple_calendar\n```bash\nbundle add simple_calendar\n```\n\n## Current user authorisation (Release v0.0.14)\n\nCurrent user access to Projects and Tasks.\n\n## Real time updates (Release v0.0.15)\n\nTurbo stream for Realtime updates.\n\n## Multitenancy (Release v0.0.16)\n\nAdding organisations.\n```bash\nrails g model organisation subdomain name owner:belongs_to\n# Edit file first.\nrails db:migrate\n```\n\nBONUS: Adding redis-commander\\\nhttps://hub.docker.com/r/rediscommander/redis-commander \\\nhttp://localhosr:8081\n```bash\n  redis-commander:\n    container_name: redis-commander\n    hostname: redis-commander\n    image: rediscommander/redis-commander:latest\n    restart: always\n    environment:\n    - REDIS_HOSTS=local:redis:6379\n    ports:\n    - \"8081:8081\"\n```\n\nHINT: Great site to look up Ruby, Rails and Rspec usage.\\\nhttps://apidock.com/rails\n\nSetup nested attributes for organisations.\n```bash\nrails g migration add_full_name_to_users full_name:string\nrails db:migrate\n```\n\nSetup Subdomains with acts as tenant gem.\\\nInstall and configure acts_as_tenant\\\nhttps://github.com/ErwinM/acts_as_tenant\n```bash\nbundle add acts_as_tenant\n```\n\nThen to access the login page you now go to\\\nhttp://lvh.me:3000/users/sign_in \\\nwhich will redirect you to the correct Subdomain\\\nhttp://enteredsubdomain.lvh.me:3000/dashboard\n\nOrganisation Users controller.\n```bash\nrails g controller organisation_users index\n# Edit files\nrails g migration add_organisation_to_users organisation_id:integer\nrails db:migrate\n```\n\nInvite users via email and setup dev test email service.\\\nAdding a gem called devise_invitable\\\nhttps://github.com/scambra/devise_invitable\n```bash\nbundle add devise_invitable\nrails generate devise_invitable:install\nrails generate devise_invitable user\nrails db:migrate\n```\n\nInstall gem letter_opener_web\\\nhttps://github.com/fgrehm/letter_opener_web \\\nThere is a new development interface to read the sent emails.\\\nhttp://localhost:3000/letter_opener \\\nhttp://enteredsubdomainn.lvh.me:3000/letter_opener\n\nAdd Organisation to the invited User.\\\nSetup Roles with the rolify gem.\\\nhttps://github.com/RolifyCommunity/rolify\n```bash\nbundle add rolify\nrails g rolify Role User\nrails db:migrate\n```\n\nBONUS: If you can't drop database because  of a stale connection.\n```sql\nSELECT pg_terminate_backend(pg_stat_activity.pid)\nFROM pg_stat_activity\nWHERE pg_stat_activity.datname = 'demo_ror_app_development';\n\n# And sometimes its the webserver\nrm -f /workspaces/demo_ror_app/tmp/pids/server.pid\n```\n\nNOTE: Sanity Testing the app and fix some as we go.\n\nSet the background to be full height and displaying read notifications.\n\n## DEBUG: You can embed a breakpoint in the code and use the debugger with.\n```ruby\n  binding.break\n  binding.pry\n```\n\nSetting the Roles UI.\nCreate the scaffold for Teams.\nFound a workaround for setting the tenant and a potential fix for the automatic subdomain.\n\n```bash\nrails g scaffold team name organisation:references\nrails db:migrate\n```\n\nAdd Team Members to the Team.\n```bash\nrails g model team_member user:references team:references\nrails db:migrate\n```\n\n\n\n\n\n\n## Next Section (Release v0.0.x)\n\n```bash\n```\n\nAdditions TBD\\\nWrite the rspec so it can be added to the notes. Consider breaking it up so it can be done with each chapter.\\\nNeed to see how to integrate the SCRUM and Microservice coursework.\\\nNeed to consider adding a section on GitHub CI/CD usage and code syntax/security checks.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanthonywrather%2Fdemo_ror_app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanthonywrather%2Fdemo_ror_app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanthonywrather%2Fdemo_ror_app/lists"}