Giter VIP home page Giter VIP logo

githubfinder's Introduction

GitHub Finder

JS Application to fetch github user data - View Demo

Practice

"I continue to push on... Longing to Master the Ways of JavaScript Ninjutsu"

What it is

An simple, well-commented, learning oriented, single page JS demo Project to practice ES6 programming concepts, using fetch API, Primses, async await (all that good stuff) and github API. Built with:

What it does

  • Finds Users on Keyup Event
  • Manipulates DOM to display User Data
  • Links Back to User Page
  • Retreives and displays latest User Repos
  • Link Back to Repos and Home Pages (if available)

Learning Points

  • ES6 Classes
  • Fetch API
  • Promises
  • Async Await
  • Iternary and Template Strings
  • DOM Manipulation & Traversal
  • Event Handing & Delegation
  • Creating & Appending Elements
  • A lil Bootstrap 4 syntax n Alerts

Some cool stuff

I think its So Cool that you can make multiple requests using async await in a single function. (a method actually, of the Github() made in the github.js file). Much better (and imho more reliable than ES5 callbacks/Ajax):

async getUser(user) {
    const profileResponse = await fetch(
      `https://api.github.com/users/${user}?client_id=${
        this.client_id
      }&client_secret=${this.client_secret}`
    );

    const repoResponse = await fetch(
      `https://api.github.com/users/${user}/repos?per_page=${
        this.repos_count
      }&sort=${this.repos_sort}&client_id=${this.client_id}&client_secret=${
        this.client_secret
      }`
    );

    const profile = await profileResponse.json();
    const repos = await repoResponse.json();

    return {
      profile,
      repos
    };
  }

Also, perhaps I wasn't doing it properly, but I had issues with using the iternary operator within the string literal, for the Homepage Links (in the repo object forEach() loop). So a work around I did was this:

let a = `<a href='${repo.homepage}' target="_blank"> View Demo </a>`,
  b = `Null`;
`Homepage: ${repo.homepage ? a : b}`; // in the loop

Also (Just a thought), this is probably how Sourcer.io Works... pretty cool.

Features in Development

Naaa... This is just about done and dusted far as I'm concerned, lol ^-^

Contribution

Contributions are highly welcome. Feel free to fork, clone, make pull requests, report issues etc.

Acknowledgments

  • Many thanks to @bradtraversy for his awesome courses - i will not fail you sensei
  • Thanks to @torvalds For Making the world a better place
  • And To anyone reading this... You're awesome!

That being said

Adieu, Till I push again... I must return to my meditations on the Ways of JS Ninjustu

githubfinder's People

Contributors

bankole2000 avatar

Stargazers

 avatar

Watchers

 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.