Skip to content
A searchable database of SpaceX Launches written in React/Rails.
Ruby JavaScript HTML CSS Dockerfile Shell
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
app
bin
config
db
lib
log
public
spec
storage
tmp
vendor
.babelrc
.browserslistrc
.env.example
.gitignore
.postcssrc.yml
.rspec
.rubocop.yml
.ruby-version
ASSIGNMENT.md
Dockerfile
Gemfile
Gemfile.lock
README.md
Rakefile
babel.config.js
config.ru
docker-compose.yml
entrypoint.sh
heroku.yml
package.json
postcss.config.js
yarn.lock

README.md

codecov Rails + React + PostgreSQL Dependabot Status Docker Image

Live Demo

Check it out live on Heroku: https://spacexflights.herokuapp.com/

screenshot

App Spec

Read the original app specification here: ASSIGNMENT.md

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 spacex

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
You can’t perform that action at this time.