Git Product home page Git Product logo

client-side-compare's Introduction

Table of Contents

What is this for?

This is a dashboard to show Github statistics for some of the most popular client-side frameworks.

Github Data Cards

There are three data cards which repesent:

  1. Popularity of a framework - this is how many stars each framework has on Github.
  2. Commit activity of a framework - this is based on commits over the given period of time.
  3. Issue resolution ratio - this is the ratio of issues closed compared to the issues opened over the given period of time.

Why this data? I think the popularity of a framework represents a lot of intangibles - more articles, more people know about it, potentially more engineers know it (hirability), and more stack overflow questions. The commit activity speaks to the body of developer interaction that the framework still carries with it. The issue resolution ratio answers the question: if I have an issue, how likely will it be solved?

Github Data Table

The github data table shows the source data, as well as some extra information which was included with one of the API calls for stars - so I kept it in. Although, the main focus should be on the data cards*.

*Unless you have a hardware constraint - then check out the size column in this table.

How does it work?

The Main Component constructor will initialize the state of the app represented in defaultState.js.

Initial fetches to Github and a fetch to the Voter API are made once the Main Component mounts. After the initial fetch, fetches will be made at a frequency set in the 'frequency' variable of defaultState.js. The number of weeks you want to pull data from is also configurable in the 'activity' variable in defaultState.

Data and the results of the fetches will be stored in the state of the Main Component. From the Main Component, the state is passed as props down to the Home Component. From the Home Component, the props are distributed to different presentational sub components - rendering is conditional on data loading and data errors.

A voter handleSubmit() method is passed from Main Component down to the Voter Submit Form Component. A voter can cast a vote with the form at the bottom of the page, and review the vote tally for a given framework in the Vote Tally table.

Voting restrictions:

  • Only one vote per email
  • Only one vote per browser session

Fetches to Github

For each framework, the following fetches are made to the Github API at https://api.github.com once the main component mounts, and then at a frequency set in the 'frequency' var in the defaultState.js file.

Docs for more on each endpoint:

Learn more about queries for issues and PR's via the Github search endpoint here.

Github Endpoint HTTP Method For Stored in State
repos/:owner/:repo GET Repo info Entire response
search/issues?q=repo:owner/:repo+is:issue+state:open+created:>:startdate GET Issues Created only the 'total_count'
search/issues?q=repo:owner/:repo+is:issue+closed:>:startdate GET Issues Closed only the 'total_count'
repos/:owner/:repo/stats/commit_activity GET Commit Acitivity Sum 'total' per activity weeks

Fetches to Voter API

Votes are fetched and submitted to the voter api at https://voterstorage.herokuapp.com/.

More info on this API here.

Endpoint HTTP Method For Stored in State
votes/ GET Framework Votes Entire response
castvote/ POST Casting Vote Nothing

File Structure

│   App.css
│   App.js
│   App.test.js
│   index.css
│   index.js
│   serviceWorker.js
│   setupTests.js
│
├───components
│   │   HomeComponent.js                      #main presentational component
│   │   MainComponent.js                      #container component for making all of the fetches
│   │
│   └───sub
│           GithubActivityCardComponent.js
│           GithubDataTableComponent.js
│           GithubPopularityCardComponent.js
│           GithubResolutionCardComponent.js
│           StatsRowComponent.js
│           VoteSubmitFormComponent.js
│           VoteTableComponent.js
│
└───data
        baseUrls.js                           #URL's for API's 
        defaultState.js                       #init state of the UI 

Improvements

  • Add testing
  • Add workflow
  • Consolidate components for data tables into one (for a more modular approach)
  • Review data structure and improve
  • Add a voter reset button
  • Set a time limit on when voting opportunity closes
  • More descriptive error message when an email has already been used
  • Add a button to configure how many weeks of data you want to view (tie it to the 'activity' var in defaultState.js)
  • Pass specific props into the cards/table
  • Possibly remove catches in error handling, and simply throw exception
  • Utilize this for base URLs

Built With

Authors

  • Sammy Dowds - Initial work - Profile

Acknowledgments

Github is an amazing resource and offers great documentation. Thank you to a great team at Github!

Main docs that I used are here:

For deployment - the mars buildpack is essential, and amazing.

client-side-compare's People

Contributors

sammydowds avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.