okfn-brasil / jarbas

🎩 API for information and suspicions about reimbursements by Brazilian congresspeople
https://jarbas.serenata.ai/
296 stars 61 forks source link

Dashboard is the new home #299

Closed cuducos closed 6 years ago

cuducos commented 6 years ago

What is the purpose of this Pull Request?

Frequently people get to Jarbas in the current home page which is not pretty useful — the Dashboard should be their landing page.

This PR makes the Dashboard the first page users see when visiting https://jarbas.serenatadeamor.org/

What was done to achieve this purpose?

How to test if it really works?

Comment out the image from docker-compose to build django and tasks containers locally:

    # image: datasciencebr/jarbas-backend
    build:
      context: . 

Start the app and browse the platform. The main point is checking if localhost:8000 redirects to the list of reimbursements, but going back and forth from the dashboad to layer endpoints is advisable ; )

Who can help reviewing it? @anaschwendler @jtemporal

anaschwendler commented 6 years ago

I will test this PR, showing my results:

  1. Clone the project:

    $ git clone git@github.com:datasciencebr/jarbas.git
  2. Change to Jarbas folder:

    $ cd jarbas
  3. Change to @cuducos branch:

    $ git fetch origin
    $ git checkout -b cuducos-change-home origin/cuducos-change-home
    $ git merge master
  4. Do the changes @cuducos said

  5. Run the project:

    $ docker-compose up -d
    $ docker-compose run --rm django python manage.py migrate
    $ docker-compose run --rm django python manage.py reimbursements /mnt/data/reimbursements_sample.xz
    $ docker-compose run --rm django python manage.py companies /mnt/data/companies_sample.xz
    $ docker-compose run --rm django python manage.py suspicions /mnt/data/suspicions_sample.xz
    $ docker-compose run --rm django python manage.py tweets
    $ docker-compose run --rm django python manage.py searchvector
    $ docker-compose run --rm django python manage.py check
    $ docker-compose run --rm django python manage.py test --parallel

Check:

➜  jarbas git:(cuducos-change-home) ✗ docker-compose run --rm django python manage.py check
Starting jarbas_queue_1 ... 
Starting jarbas_postgres_1 ... 
Starting jarbas_postgres_1 ... done
Starting jarbas_tasks_1 ... done
System check identified no issues (0 silenced).

Test:

➜  jarbas git:(cuducos-change-home) ✗ docker-compose run --rm django python manage.py test --parallel
Starting jarbas_queue_1 ... done
Starting jarbas_postgres_1 ... done
Starting jarbas_elm_1 ... done
Starting jarbas_tasks_1 ... done
Creating test database for alias 'default'...
Cloning test database for alias 'default'...
Cloning test database for alias 'default'...
System check identified no issues (0 silenced).
...........................................................................................................................................................................
----------------------------------------------------------------------
Ran 171 tests in 4.787s

OK
Destroying test database for alias 'default'...
Destroying test database for alias 'default'...
Destroying test database for alias 'default'...

In development localhost:8000: image

Search vector, combined with year: image

Long test, to check if the modification has everything ok! 🎉