An open API service indexing awesome lists of open source software.

https://github.com/yuri-val/voting-analysis-api

Dev Challenge 11 | QUALIFICATION
https://github.com/yuri-val/voting-analysis-api

api-rails devchallenge devchallenge11 rails rb ror ror-api ruby

Last synced: about 2 months ago
JSON representation

Dev Challenge 11 | QUALIFICATION

Awesome Lists containing this project

README

          

Run with docker:
- docker-compose build
- docker-compose run web rake db:drop db:create db:migrate
- docker-compose run web rake example:make default_data:load parser:run
- docker-compose up

If you need, you may use not PG DB. Just rename file "database.yml.mysql_example"
or "database.yml.sqlite_example" to "database.yml".
Also you have to change db parameters for MySQL and PG in database.yml".

Direct run (ruby >= 2.3.x):
- bundle install
- rake db:drop db:create db:migrate
- rake example:make default_data:load parser:run
- rails s

Go to root application url (127.0.0.1:3000) for more info about routes.

If you want to load new pdf-files to application put them into "public/pdfs"
and run "rake parser:run"

Routes:
- /v1/deputies/{:id} -- list of all deputies in db or deputy by {:id}
- /v1/votings/{:id} -- list of all votings (headers in pdf-file above the table)

Nested routes:
- /v1/votings/:voting_id/voting_rows/{:id} -- voting table of voting by voting_id
- /v1/deputies/:deputy_id/votings/ -- all votings filtered by deputy
- /v1/deputies/:deputy_id/zones -- Zones of influence of deputy