Skip to content

Bootstrap your Rails + React apps with this test-driven development template.

Notifications You must be signed in to change notification settings

patrickclery/dry-rails-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

codecov Rails + React + PostgreSQL Dependabot Status Docker Image

Getting Started

Requirements

  • PostgreSQL or Docker (depending which method you choose)

Method #1: Running Rails on your machine

  1. Clone this repo to your local machine:
git clone https://github.com/patrickclery/amazon-asin.git
  1. From the command-line, cd into the directory:
cd amazon-asin

If you are using rvm_autoupdate_flag=1 in your ~/.rvmrc, this will automatically install Ruby 2.6.5. Otherwise, run it manually:

 rvm install

Note: Using RVM is optional, just make sure you have Ruby 2.6.5 available.

  1. Run the setup script. This does several things:
  • Installs bundler (if necessary)
  • Installs the required ruby gems
  • Prepares your database
  • Seeds your database
bin/setup

Method #2: Docker

  1. Fire up Docker on your local machine
  2. Run this command to build and deploy the app:
docker-compose --env-file=.env up

Note: .env is generated by bin/setup but you can create one using the sample .env.sample

  1. Be sure that your Docker container publishes port 3000 (manually required).

Method A: Running the Rails server on your system.

  1. Fork the repo.

  2. Run the setup script.

    bin/setup

    This does several things:

    • Installs the required ruby gems and JavaScript packages.
    • Prepares your database:
      • Creates the databases
      • Seeds the data
    • Creates a .env file with default settings
  3. Open the app in your browser by navigating to http://localhost:3000/

Method B: Docker

  1. Fire up Docker on your local machine

  2. Run this command to build and deploy the app:

    docker-compose --env-file=.env up

    Note: .env is generated by bin/setup but you can create one using the sample .env.sample

  3. Be sure that your Docker container publishes port 3000 (manually required).

  4. Open the app in your browser by navigating to http://localhost:3000/

Method C: Deploy to Heroku (in a Docker container)

  1. Install heroku CLI on MacOS:

    brew tap heroku/brew && brew install heroku
  2. Deploy the app on Heroku (this requires a heroku.com account.) You will want to enable "Automatic Deploys" for your master branch.

    heroku git:remote -a your-heroku-subdomain-goes-here
    heroku stack:set container
    git push heroku master
  3. The app should be up & running on your Heroku subdomain. If not, you can debug any errors by checking the build long (under the "Activity" tab on Heroku), or tailing the logs:

    heroku logs --tail

Features

  • GitHub Actions
    • Docker images published on every commit to master branch (@via docker build-push-action)
    • RSpec tests run on every push
  • Dockerization
  • Heroku Deployment (using the Docker configuration)

What is included?

These gems are added to the standard Rails stack

  • Core
    • better_errors – useful error pages with interactive stack traces
    • fast_jsonapi – a JSON serializer that follows the standards of Google's JSON:API
    • react-rails – combines Rails + React + Webpacker. comes setup with a default App component at /
    • rubocop – enforces Ruby code style
  • Security
    • brakeman – detect security vulnerabilities
  • Testing
    • capybara – integration tests with screenshots
    • codecov – integration with codecov.io
    • faker – generate fake data for tests
    • shoulda Common RSpec tests for Rails
    • vcr – save http requests for re-use with tests
    • webmock – simulate live http requests

About

Bootstrap your Rails + React apps with this test-driven development template.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published