Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customize rails application #2

Merged
merged 78 commits into from
May 23, 2024
Merged

Conversation

rocketnova
Copy link
Contributor

@rocketnova rocketnova commented Apr 11, 2024

Ticket

  • N/A

Changes

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

  • Customize rails app boilerplate
  • Add github issue templates
  • Add github actions CI
  • Add docker compose files
  • Add documentation

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:

  • Code quality
    • rspec for testing
    • rubocop for linting
    • optimized docker build pipeline
  • Developer experience
    • consistent and reproducible dev workflows using a Makefile
    • a developer sandbox page to test frontend changes
    • database migration introspection
    • mock production that can be run locally
    • per-environment database seeding
  • Frontend configuration
    • sass stylesheets
    • USWDS, including custom form builder
    • breadcrumbs
    • flash
    • header
    • language toggle
    • sidebar layout
  • External integrations with AWS
    • auth using Cognito
    • storage using S3
    • notifications using SES
    • database using RDS with Postgresql IAM Auth
  • Auth
    • authn using devise
    • authz using pundit
    • user and user_role scaffolding
    • implemented flows:
      • create user
      • forgot password
      • update password
      • verify email
      • update email
      • add mfa using authenticator TOTP
      • remove mfa
  • Internationalization
    • support for translated routes
    • locale directory structure
  • Software architecture patterns
    • adapters pattern
    • services pattern
    • form objects pattern
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

@rocketnova rocketnova force-pushed the rocket/init-template-with-name branch 3 times, most recently from 88af1d8 to f1518d8 Compare May 22, 2024 19:32
Base automatically changed from rocket/new-rails-app-with-name to main May 22, 2024 20:54
@rocketnova rocketnova changed the title Rocket/init template with name Customize rails application May 22, 2024
@rocketnova rocketnova force-pushed the rocket/init-template-with-name branch from fd76fb2 to 171fd3f Compare May 22, 2024 21:06
@rocketnova rocketnova marked this pull request as ready for review May 22, 2024 21:28
@rocketnova rocketnova merged commit 2c8c47f into main May 23, 2024
5 checks passed
@rocketnova rocketnova deleted the rocket/init-template-with-name branch May 23, 2024 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant