Homepage numbers should be pulled from the API #6

Open
DavidLemayian opened this Issue May 9, 2016 · 7 comments

Comments

Projects
None yet
3 participants
@DavidLemayian
Member

DavidLemayian commented May 9, 2016

Currently the number of organisations are a static metric. They should instead be called from sourceAFRICA's API.

@alfmoh

This comment has been minimized.

Show comment
Hide comment
@alfmoh

alfmoh Jun 10, 2017

Hello, I would like to help. Any documentation available on how to go about things?

alfmoh commented Jun 10, 2017

Hello, I would like to help. Any documentation available on how to go about things?

@DavidLemayian

This comment has been minimized.

Show comment
Hide comment
@DavidLemayian

DavidLemayian Jun 11, 2017

Member

Hi @alfmoh. Unfortunately not much documentation. In-fact the plan is to move this entire functionality into sourceAFRICA which is Ruby based with also scanty documentation on deployment. :(

Member

DavidLemayian commented Jun 11, 2017

Hi @alfmoh. Unfortunately not much documentation. In-fact the plan is to move this entire functionality into sourceAFRICA which is Ruby based with also scanty documentation on deployment. :(

@alfmoh

This comment has been minimized.

Show comment
Hide comment
@alfmoh

alfmoh Jun 11, 2017

I'd like to help but since I know nothing about the API, it will be difficult.

alfmoh commented Jun 11, 2017

I'd like to help but since I know nothing about the API, it will be difficult.

@DavidLemayian

This comment has been minimized.

Show comment
Hide comment
@DavidLemayian

DavidLemayian Jun 11, 2017

Member

@alfmoh The API documentation is here but nothing available for orgs - https://sourceafrica.net/help/api

Member

DavidLemayian commented Jun 11, 2017

@alfmoh The API documentation is here but nothing available for orgs - https://sourceafrica.net/help/api

@alfmoh

This comment has been minimized.

Show comment
Hide comment
@alfmoh

alfmoh Jun 11, 2017

Alright, will go through and see what I can produce. 😊

alfmoh commented Jun 11, 2017

Alright, will go through and see what I can produce. 😊

@rmaitra

This comment has been minimized.

Show comment
Hide comment
@rmaitra

rmaitra Oct 17, 2017

@DavidLemayian are these issues open to the public solve? It seems this issue has to do with getting a count for the number of orgs, contributors, documents, and pages from sourceAFRICA:

https://github.com/CodeForAfrica/sourceAFRICA.app-Briefcase/blob/master/index.html#L42

 <div class="col-sm-6 first bg-primary">
      <p>PUBLIC DOCUMENTS FROM</p>
      <h3>47 Organizations</h3>
      <p><small>No. of Contributors:</small> 137</p>
      <a href="/organizations.html" class="btn btn-sm btn-default">View all Organizations <i class="fui-arrow-right"></i></a>
    </div>
    <div class="col-sm-6 second">
      <p>COLLECTION OF</p>
      <h3>115,126 Documents</h3>
      <p><small>No. of Pages:</small> 1,243,213</p>
      <a href="/search.html" class="btn btn-sm btn-default">View all Resources <i class="fui-arrow-right"></i></a>
    </div>

and sourceAFRICA has these in their db:

Entity Code line in schema.rb
organizations https://github.com/CodeForAfrica/sourceAFRICA/blob/master/db/schema.rb#L216
documents https://github.com/CodeForAfrica/sourceAFRICA/blob/master/db/schema.rb#L132
pages https://github.com/CodeForAfrica/sourceAFRICA/blob/master/db/schema.rb#L234

nothing for contributors unless that is membership. And you are right, the sourceAFRICA api doesn't seem to have endpoints for these entities except documents:

 # API
  scope(:api, controller: 'api') do
    scope(via: 'options', action: 'cors_options') do
      match 'documents/pending.:format',            allowed_methods: [:get]
      match 'documents/:id.:format',                allowed_methods: [:get, :put, :delete]
      match 'documents/:id/entities.:format',       allowed_methods: [:get]
      match 'documents/:id/note/:note_id.:format',  allowed_methods: [:get]
      match 'documents/:id/notes/:note_id.:format', allowed_methods: [:get]
      match 'projects/:id.:format',                 allowed_methods: [:get, :put, :delete]
      match 'projects.:format',                     allowed_methods: [:get, :post]
      match 'search.:format',                       allowed_methods: [:get]
    end

    put 'documents/:id.:format',                action: 'update'
    delete 'documents/:id.:format',             action: 'destroy'
    get 'documents/:id/entities.:format',       action: 'entities'
    get 'documents/:id/note/:note_id.:format',  action: 'notes'
    get 'documents/:id/notes/:note_id.:format', action: 'notes'
    get 'documents/pending.:format',            action: 'pending'
    get 'projects/:id.:format',                 action: 'project'
    get 'projects.:format',                     action: 'projects'
    post 'projects.:format',                    action: 'create_project'
    put 'projects/:id.:format',                 action: 'update_project'
    delete 'projects/:id.:format',              action: 'destroy_project'
  end

Is the data actually in the database? If so, it would be easy to probably add an endpoint for strictly counting these entities. Not sure if @alfmoh is already working on this. Also, since there are no pull requests to sourceAFRICA's repository that there has been development unless people just merge and push on their localhost. Anyways, let me know! Hope I can help in any way. I'm a ruby guy so looks interesting.

rmaitra commented Oct 17, 2017

@DavidLemayian are these issues open to the public solve? It seems this issue has to do with getting a count for the number of orgs, contributors, documents, and pages from sourceAFRICA:

https://github.com/CodeForAfrica/sourceAFRICA.app-Briefcase/blob/master/index.html#L42

 <div class="col-sm-6 first bg-primary">
      <p>PUBLIC DOCUMENTS FROM</p>
      <h3>47 Organizations</h3>
      <p><small>No. of Contributors:</small> 137</p>
      <a href="/organizations.html" class="btn btn-sm btn-default">View all Organizations <i class="fui-arrow-right"></i></a>
    </div>
    <div class="col-sm-6 second">
      <p>COLLECTION OF</p>
      <h3>115,126 Documents</h3>
      <p><small>No. of Pages:</small> 1,243,213</p>
      <a href="/search.html" class="btn btn-sm btn-default">View all Resources <i class="fui-arrow-right"></i></a>
    </div>

and sourceAFRICA has these in their db:

Entity Code line in schema.rb
organizations https://github.com/CodeForAfrica/sourceAFRICA/blob/master/db/schema.rb#L216
documents https://github.com/CodeForAfrica/sourceAFRICA/blob/master/db/schema.rb#L132
pages https://github.com/CodeForAfrica/sourceAFRICA/blob/master/db/schema.rb#L234

nothing for contributors unless that is membership. And you are right, the sourceAFRICA api doesn't seem to have endpoints for these entities except documents:

 # API
  scope(:api, controller: 'api') do
    scope(via: 'options', action: 'cors_options') do
      match 'documents/pending.:format',            allowed_methods: [:get]
      match 'documents/:id.:format',                allowed_methods: [:get, :put, :delete]
      match 'documents/:id/entities.:format',       allowed_methods: [:get]
      match 'documents/:id/note/:note_id.:format',  allowed_methods: [:get]
      match 'documents/:id/notes/:note_id.:format', allowed_methods: [:get]
      match 'projects/:id.:format',                 allowed_methods: [:get, :put, :delete]
      match 'projects.:format',                     allowed_methods: [:get, :post]
      match 'search.:format',                       allowed_methods: [:get]
    end

    put 'documents/:id.:format',                action: 'update'
    delete 'documents/:id.:format',             action: 'destroy'
    get 'documents/:id/entities.:format',       action: 'entities'
    get 'documents/:id/note/:note_id.:format',  action: 'notes'
    get 'documents/:id/notes/:note_id.:format', action: 'notes'
    get 'documents/pending.:format',            action: 'pending'
    get 'projects/:id.:format',                 action: 'project'
    get 'projects.:format',                     action: 'projects'
    post 'projects.:format',                    action: 'create_project'
    put 'projects/:id.:format',                 action: 'update_project'
    delete 'projects/:id.:format',              action: 'destroy_project'
  end

Is the data actually in the database? If so, it would be easy to probably add an endpoint for strictly counting these entities. Not sure if @alfmoh is already working on this. Also, since there are no pull requests to sourceAFRICA's repository that there has been development unless people just merge and push on their localhost. Anyways, let me know! Hope I can help in any way. I'm a ruby guy so looks interesting.

@DavidLemayian

This comment has been minimized.

Show comment
Hide comment
@DavidLemayian

DavidLemayian Oct 18, 2017

Member

@rmaitra These issues certainly are open to the public to solve. :)

Yip, an endpoint specifically to give summary of counts on sourceAFRICA would be needed to achieve this. A PR on this would be more than welcome.

Member

DavidLemayian commented Oct 18, 2017

@rmaitra These issues certainly are open to the public to solve. :)

Yip, an endpoint specifically to give summary of counts on sourceAFRICA would be needed to achieve this. A PR on this would be more than welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment