From the project folder, run bundle:
$ docker-compose run web bundle install
Build the app:
$ docker-compose build
Start the containers:
$ docker-compose up
Create and migrate the database:
$ docker-compose run web bundle exec rails db:create db:migrate
There are model specs and request specs.
$ docker-compose run web bundle exec rspec
$ docker-compose run web bundle exec guard --clear
There is a rake task for loading madrid.json
file placed in folder lib/assets
.
With Bash:
$ docker-compose run web bundle exec rake activities:load[lib/assets/madrid.json,Madrid]
With ZSH:
$ docker-compose run web bundle exec rake activities:load\[lib/assets/madrid.json,Madrid\]
Some examples:
- http://localhost:3000/api/v1/activities.json
- http://localhost:3000/api/v1/activities.json?category=cultural
- http://localhost:3000/api/v1/activities.json?category=cultural&location=indoors
- http://localhost:3000/api/v1/activities.json?category=cultural&location=indoors&district=Retiro
Some examples:
Same day:
Multiple days: