/covidliste

0 doses perdues.

Primary LanguageRubyMIT LicenseMIT

Covidliste

Test Ruby Style Guide Security Rating Vulnerabilities codecov

Covidliste makes it easy to manage waiting lists for vaccination centers.

https://www.covidliste.com

Stack

Local Development

Installation

Prerequisites

If you don't already have them :

  • Install ruby 2.7.3 rbenv install 2.7.3 && rbenv global 2.7.3
  • Install bundler 2.2.15 gem install bundler:2.2.15
  • Install yarn npm i -g yarn
  • Install redis brew install redis
  • Install postgresql brew install postgresql

Dependencies

Setup the project's dependencies :

bundle install
yarn
bin/lefthook install

Create the .env file:

echo "LOCKBOX_MASTER_KEY=0000000000000000000000000000000000000000000000000000000000000000" > .env

Database / Cache

  1. Create a database called covidliste_development using your favorite postgresql GUI or CLI.
  2. Then run the migrations : bin/rails db:migrate RAILS_ENV=development
  3. Run redis if it's not already running : redis-server /usr/local/etc/redis.conf

Running

bin/rails s

If you need Sidekiq background workers or Webpacker development server, you can start them all using overmind

overmind s

Admin development

In a rails console with rails c

user = User.find_by(email: <your_email>)
user.add_role(:admin)
# user.add_role(:super_admin) # for super admin

Documentation

A handbook is available in the doc directory.

Docker

Launch the Docker environment:

docker-compose up

Visit http://localhost:3000

Contributing

Visit https://github.com/hostolab/covidliste/blob/master/CONTRIBUTING.md

Thanks to all our contributors

Code formatting

In order for the pipeline to be successful, you must ensure that you respect the linting made using

bin/standardrb --fix
bin/yarn prettier --write .

If some errors are printed it means that some of the different issues can not be corrected automatically. Then you will need to correct them manually.

In rubymine, please follow this procedure to add the formatter / linter directly in the editor tabs: https://www.jetbrains.com/help/ruby/rubocop.html#prerequisites

Testing

To launch the tests locally, run:

bin/rspec
# On macOS you can open Code Coverage results with:
# open coverage/index.html

If you want to debug System Tests in the browser, add the following Ruby line as a debugger in your spec/system/... file:

page.driver.debug(binding)

Then launch the test with:

INSPECTOR=true bin/rspec spec/system/THE_FILE_spec.rb

It should automatically open Chrome and allow you to inspect the DOM, queries, etc. You can next and continue in the Terminal as if you had a binding.pry debugging session.