- Ruby version: 3.0.3
- Rails version: 6.1.7
- Stimulus JS
- Node 16.13.0
- Bootstrap 5
- PostgreSQL
- RSpec
- Clone the project.
- Create the file
config/application.yml
with the environment variables (seeconfig/application.yml.sample
). - Set the right version for Node (nvm is recommended).
- Run
bundle install
to install the project gems. - Run
yarn install
to install Yarn dependencies. - Create DB and run migrations with
rails db:create db:migrate:with_data
. - Run
rails db:seed
to populate DB with Rails seeds. - Run
rails s
to run server. - This project is using Webpack so, in order to avoid restarting the server everytime you change any JavaScript content, you need to initialize a development server that will compile JavaScript for Webpack. This can be done by running the following command:
./bin/webpack-dev-server
.
- Clone the project.
- Create the file
.env
with the environment variables (see.env.sample
). - Run
docker-compose build
to build Docker services. - Create DB and run migrations with
docker-compose run app rails db:create db:migrate:with_data
. - Run
docker-compose run app rails db:seed
to populate DB with Rails seeds. - Run
docker-compose up
to run server.
To install new dependencies, you need to use yarn. E.g. to install jQuery, run yarn add jquery
Since the project is using the (data_migrate
) gem, all migrations and rollbacks should be run using the following commands:
rails db:migrate:with_data
rails db:rollback:with_data
This project is using Rspec with Capybara. To run the entire suite, execute the following command:
bundle exec rspec
If you want to run only the feature tests on a live browser instead of the headless version, you just need to run this command:
CAPYBARA_DRIVER=selenium_chrome bundle exec rspec spec/features
If you want to skip feature tests, you can use this command:
rspec --exclude-pattern "spec/features/**/*_spec.rb"