Covidliste makes it easy to manage waiting lists for vaccination centers.
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
Setup the project's dependencies :
bundle install
yarn
bin/lefthook install
Create the .env
file:
echo "LOCKBOX_MASTER_KEY=0000000000000000000000000000000000000000000000000000000000000000" > .env
- Create a database called
covidliste_development
using your favorite postgresql GUI or CLI. - Then run the migrations :
bin/rails db:migrate RAILS_ENV=development
- Run redis if it's not already running :
redis-server /usr/local/etc/redis.conf
bin/rails s
If you need Sidekiq background workers or Webpacker development server, you can start them all using overmind
overmind s
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
A handbook is available in the doc
directory.
Launch the Docker environment:
docker-compose up
Visit http://localhost:3000
Visit https://github.com/hostolab/covidliste/blob/master/CONTRIBUTING.md
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
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.