Inventory Management

Dependencies

  • Ruby (tested with version 3.2.2)
  • Node.js (tested with version 20)

Setup

App setup

The command below will install all needed dependencies for the backend application and setup the database.

bin/rails setup

After that, you'll need to setup the frontend dependencies. Just run:

yarn

And, lastly, you need to seed some data to the database. Run:

bin/rails db:seed

Configure the Location name

Finally, before starting the server, change the file under config/application.rb and look for config.x.location.name. In there, you'll set the name of your location.

Start the server

And, finally, start the server:

bin/dev

Developing the application

Run unit tests

This uses tests from both minitest and rspec. To run them:

Minitest:

bin/rails test

RSpec:

bin/bundle exec rspec

Run E2E tests

This app uses Cypress for E2E tests.

There are 2 ways to execute Cypress's tests.

Headless

This will run the tests in a headless browser and show the results in the terminal.

RAILS_ENV='cypress' rake cypress:run

Iterative

This will open the Cypress application, which will use a real browser to run your tests in an interactive, easy to inspect test runner, with real browser visualization.

RAILS_ENV='cypress' rake cypress:open