This project is to fulfill the requirements for Phase 4 of the Flatiron School - Flex SE program. This project is created with a React Frontend and Rails Backend, and is setup to be deployed to Heroku for hosting. You can view the complete application hosted on Heroku with this link: Link to Heroku App
BeefMarket is a one stop shop website where you can signup for free to purchase premium cut beef at a fair cost. In this website you will be able to:
- Sign up for an account
- Login to view BeefMarket's inventory
- Add items from the inventory to your cart
- Submit your cart for an order
The following is a diagram of the DB Structure used for the BeefMarket App.

- Ruby 2.7.4
- NodeJS (v16), and npm
- Heroku CLI
- Postgresql
When you're ready to start building your project, run:
bundle install
rails db:create db:migrate db:seed
npm install --prefix clientYou can use the following commands to run the application:
rails s: run the backend on http://localhost:3000npm start --prefix client: run the frontend on http://localhost:4000
To deploy to Heroku, first log in to your Heroku account using the Heroku CLI:
heroku loginCreate the new Heroku app:
heroku create my-app-nameAdd the buildpacks for Heroku to build the React app on Node and run the Rails app on Ruby:
heroku buildpacks:add heroku/nodejs --index 1
heroku buildpacks:add heroku/ruby --index 2To deploy, commit your code and push the changes to Heroku:
git add .
git commit -m 'Commit message'
git push heroku mainNote: depending on your Git configuration, your default branch might be named
masterormain. You can verify which by runninggit branch --show-current. If it'smaster, you'll need to rungit push heroku masterinstead.
Any time you have changes to deploy, just make sure your changes are committed on the main branch of your repo, and push those changes to Heroku to deploy them.
You can view your deployed app with:
heroku openVerify which version of Ruby you're running by entering this in the terminal:
ruby -vMake sure that the Ruby version you're running is listed in the supported runtimes by Heroku. At the time of writing, supported versions are 2.6.8, 2.7.4, or 3.0.2. Our recommendation is 2.7.4, but make sure to check the site for the latest supported versions.
If it's not, you can use rvm to install a newer version of Ruby:
rvm install 2.7.4 --defaultYou should also install the latest versions of bundler and rails:
gem install bundler
gem install railsVerify you are running a recent version of Node with:
node -vIf your Node version is not 16.x.x, install it and set it as the current and default version with:
nvm install 16
nvm use 16
nvm alias default 16You can also update your npm version with:
npm i -g npmSign Up for a Heroku Account
You can sign up at for a free account at https://signup.heroku.com/devcenter.
Download the Heroku CLI Application
Download the Heroku CLI. For OSX users, you can use Homebrew:
brew tap heroku/brew && brew install herokuFor WSL users, run this command in the Ubuntu terminal:
curl https://cli-assets.heroku.com/install.sh | shIf you run into issues installing, check out the Heroku CLI downloads page for more options.
After downloading, you can login via the CLI in the terminal:
heroku loginThis will open a browser window to log you into your Heroku account. After
logging in, close the browser window and return to the terminal. You can run
heroku whoami in the terminal to verify that you have logged in successfully.
Heroku requires that you use PostgreSQL for your database instead of SQLite. PostgreSQL (or just Postgres for short) is an advanced database management system with more features than SQLite. If you don't already have it installed, you'll need to set it up.
To install Postgres for WSL, run the following commands from your Ubuntu terminal:
sudo apt update
sudo apt install postgresql postgresql-contrib libpq-devThen confirm that Postgres was installed successfully:
psql --versionRun this command to start the Postgres service:
sudo service postgresql startFinally, you'll also need to create a database user so that you are able to connect to the database from Rails. First, check what your operating system username is:
whoamiIf your username is "ian", for example, you'd need to create a Postgres user with that same name. To do so, run this command to open the Postgres CLI:
sudo -u postgres -iFrom the Postgres CLI, run this command (replacing "ian" with your username):
createuser -sr ianThen enter control + d or type logout to exit.
This guide has more info on setting up Postgres on WSL if you get stuck.
To install Postgres for OSX, you can use Homebrew:
brew install postgresqlOnce Postgres has been installed, run this command to start the Postgres service:
brew services start postgresql