navapbc / template-application-rails

Ruby on Rails with USWDS template, including CI/CD, for teams building web applications
Apache License 2.0
2 stars 1 forks source link

Customize rails application #2

Closed rocketnova closed 6 months ago

rocketnova commented 7 months ago

Ticket

Changes

What was added, updated, or removed in this PR.

Context for reviewers

Testing instructions, background context, more in-depth details of the implementation, and anything else you'd like to call out or ask reviewers.

This PR customizes the default rails app boilerplate and adds opinionated changes to:

CleanShot 2024-05-22 at 16 35 53@2x

Testing

Provide evidence that the code works as expected. Explain what was done for testing and the results of the test plan. Include screenshots, GIF demos, shell commands or output to help show the changes working as expected. ProTip: you can drag and drop or paste images into this textbox.

Test installation

  1. Create a new directory: mkdir test-rails-template
  2. Change to the project directory: cd test-rails-template
  3. Install the main branch:
    curl https://raw.githubusercontent.com/navapbc/template-application-rails/main/template-only-bin/download-and-install-template.sh | bash -s
  4. Verify that files from main have been installed
  5. Initialize a git repo and commit before continuing: git init && git add -A . && git commit

Test updating

  1. In test-rails-template, update to this branch:
    curl https://raw.githubusercontent.com/navapbc/template-application-rails/main/template-only-bin/download-and-install-template.sh | bash -s -- rocket/init-template-with-name
  2. Verify that files have been changed to match this branch: git diff
  3. Commit before continuing: git add -A . && git commit
  4. Change to the rails directory: cd app-rails
  5. Create the env vars file: make .env
  6. Manually edit .env to configure the application

Test application renaming

  1. In test-rails-template (if you are in app-rails, run cd ..), rename the app-rails to a custom project name my-rails:
    curl https://raw.githubusercontent.com/navapbc/template-application-rails/main/template-only-bin/rename-template-app.sh | bash -s -- my-rails app-rails
  2. Verify that the app files have been renamed: git diff
  3. Commit before continuing: git add -A . && git commit

Test running the application native

  1. Change to the rails directory: cd my-rails
  2. Initialize the application to run natively: make init-native
  3. Start the application: make start-native
  4. Visit the application at: http://localhost:3000
  5. Enter Ctrl-C to stop
  6. Clean up the native install: make clean-native

Test running the application in a container

  1. Change to the rails directory: cd my-rails
  2. Initialize the application to run in a container: make init-container
  3. Start the application: make start-container
  4. Visit the application at: http://localhost:3100
  5. Enter Ctrl-C to stop
  6. Cleanup: make clean-container