GithubHelp home page GithubHelp logo

gdomiciano / contributors-chart Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 1.0 2.38 MB

Responsive application, that user can search for a repository and see contributors per user in a chart.

Home Page: https://gdomiciano.github.io/contributors-chart/

JavaScript 82.45% CSS 1.33% Vue 16.03% Dockerfile 0.20%
nuxt vuex cypress-io typeahead chart responsive

contributors-chart's Introduction

contributors-chart

Responsive application, that user can search for a repository and see contributions per user in a chart.

Introduction

This project is a code challenge that has been developed with Vue.js and Nuxt.js to cover the SSR, it is also preconfigured to work as a PWA. The application is integrated with GitHub API, it consists on a typeahead field that receives the github username and suggests it respective repositories for selection, once the user selects one of the repositories suggesteds, its possible to visualize a chart - based on vue-chartjs - that shows contributions per user in the selected repository. In case the user does not exist or has no repositories available an error message is shown.

Image Image Image Image Image

Install

  • Clone the project: git clone https://github.com/gdomiciano/contributors-chart.git
  • Go to project's folder: cd contributors-chart
  • Install dependencies: npm i or yarn

Usage

To run this project locally:

About the application

Base framework: I have chosen to build this application based on Nuxt.js PWA version, due to I really believe that PWA is going to be the future of web applications considering the advantages, such as:

  • Add website to homescreen adn run it as a mobile app;
  • Offline availability;
  • size, the PWA will always be lighter than a mobile app, so it has less chance to be uninstalled;
  • Service worker will be available on Safari on December, 2017;
  • Successfull cases (e.g. Aliexpress, Flipkart et cetera);

Beyond the PWA feature, I have started this development with Nuxt.js to cover the SSR (Server Side Rendering), which means the page will be availabe for SEO ad still being a SPA, and this part is covered by Vue.js framework.

Responsive: This application was developed with mobile first.

Typeahead: I have decided to develop this feature from scratch, actually just to challenge myself, since I have never done something alike, even though it costs the time of implement tests. The typeahead field contains a debounce custom directive, that waits 500ms after the user stop typing to call the github API and then show the suggestions. The choice of debounce over throttle was based on my previous knowledge on angular debounce directive.

Once the user finish typing, and the suggestion list appears, s/he can navigate among them via arrow down/up keys and select one pressing enter or scrolling the list via touch move/mouse and select with click/touch event according to the device.

I did not use tag for the typeahead, due to the lack of support on Safari.

Chart/Graph: Usually implement chart from scratch is really complex, so I took a look on all available chart integrations availables on Awesome Vue Repository and I decided to implement Vue-chartjs owing to the cross-browser support, it is resizable and easy to integrate, specially with Nuxt.js, because some plugins/integrations are impossible to get working with SSR.

Components: There are components in the whole application, the communication between components is going through events, furthermore I have created a Vuex Store to keep the data updated for the whole application, such as the list of repositories, the chart info and the error messages, all the resquests are executed via actions and saved on a state that is easily accessed into the application scope.

Required features

Basic version:

  • Create a search field with a (repo) typeahead, where user can type any github username and the search would return the list of users github repos
  • User can then select a repo from the typeahead dropdown and the app should display a graph of contributions per user for this repo (x axis users, y axis number of contributions)
  • Make sure to handle the case, when username does not exist or user has no repos

Fancy version:

  • Use ECMAScript 6
  • [-] Make it look nice design wise

Additional info:

General guidelines:

  • Project should be build with one of the Javascript frameworks/libraries of your choosing
  • [-] The code should be readable and clearly commented when needed
  • The project should be pushed to a public github repository
  • You can use all the open source libraries you need
  • README.md should contain project documentation (how to run and build the project locally from scratch, project structure, gotchas,... anything worth mentioning)
  • [-] The project should support IE10+, Android native browser 4.4+ and all modern browsers (current version - 1)
  • The UI should be responsive
  • HTML should be semantic

To Do

During the development I have created a Github Projects to Kanban Board to organize my development process:

  • Backlog: indicates features/improvements that will be developed after the MVP
  • ToDo: show all features have to be delivered for the MVP
  • In Progress: tasks that are being developed
  • Done: expose all tasks that are developed and tested.

Image

contributors-chart's People

Contributors

gdomiciano avatar geisy-domiciano avatar mvitiuk avatar dependabot[bot] avatar

Stargazers

Kami Development avatar Dayana Maia avatar Emiliano Barbosa avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

mvitiuk

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.