Create a New Workarea App
This is a quick start guide for getting started on a brand new Workarea application. If you're new to developing on Workarea this is a great place to start.
After reviewing the assumptions, complete the following steps to create a new Workarea application and open it in your browser:
- Create a Rails 5.2 application
- Add the Workarea gem
- Install Workarea into the Rails application
- Start Workarea service dependencies
- Seed the database
- Start the Rails server
- Open the application in a browser
The steps that follow assume the following:
- You have Docker Desktop installed. See https://www.docker.com/products/docker-desktop to download.
- You have Ruby >= 2.4.0, < 2.7.0 installed. See https://github.com/rbenv/rbenv#installation for instructions.
- You have NodeJS installed. We recommend using Homebrew.
- You have ImageMagick installed. We recommend using Homebrew.
For more details, see Prerequisites and Dependencies.
TL;DR Video Walkthrough
Create a Rails 5.2 application
This creates a barebones Rails app for Workarea to install into:
mkdir my-store && cd my-store echo "source 'https://rubygems.org'" > Gemfile echo "gem 'rails', '~> 5.2'" >> Gemfile bundle install bundle exec rails new ./ --force \ --skip-spring \ --skip-active-record \ --skip-action-cable \ --skip-puma \ --skip-coffee \ --skip-turbolinks \ --skip-bootsnap \ --skip-yarn \ --skip-bundle
Add the Workarea gem
This adds the Workarea base gem to the project and updates dependencies:
echo "gem 'workarea'" >> Gemfile bundle update
Install Workarea into the Rails application
Workarea ships with an installer generator that will configure the application:
bin/rails generate workarea:install
For more details on what this generator does, see Installing Workarea.
Start Workarea service dependencies
Workarea relies on a few databases, so there's a task that will start them in Docker containers. Start Workarea dependencies:
Seed the database
To do anything useful with Workarea, you'll want some sample data in your database.
The install generator run in step 3 will add Workarea seeds to your
so running Rails seeds will add sample Workarea data.
For more details on working with seed data, see Seeds.
Start the Rails server
Use the conventional Rails command for starting up the Puma server:
Open the application in a browser
Your Workarea application is ready! Open a browser, and check out
Running tests is a regular part of developing on Workarea. Check out the list of Rails tasks Workarea provides for testing Workarea:
bin/rails -T workarea:test
Try one of the test runners listed in that output. For example, this will run the Workarea test suite:
For more details on Workarea's testing functionality, see Testing.
Stop the services
After developing and testing, you may want to stop the services to conserve resources on your machine.
Run the command to stop the services Workarea has started for you:
Note that the volumes these containers used will still be available, and you won't have to seed again the next time you start them.
Help Us Improve this Doc
Was this helpful? Open a GitHub issue to report a problem with this doc, suggest an improvement, or otherwise provide feedback. Thanks!