Giter VIP home page Giter VIP logo

atlas7 / github-battle Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 40 KB

An ES5 style web app that compares two github user profile and determine who the winner is based on stats. The output is based on the GitHub Battle Project originated from the ReactJS Fundmental course by @tylermcginnis - I did not "invent" this web app but this does demonstrate the tech that I have worked with (and learnt from).

JavaScript 97.01% HTML 1.60% CSS 1.39%

github-battle's Introduction

A web app that compares two github user profile and determine who the winner is based on stats.

The output is based on the GitHub Battle Project originated from the ReactJS Fundmental course by @tylermcginnis - I did not "invent" this web app but this does demonstrate the tech that I have worked with (and learnt from).

Notes:

  • this app is not bullet proof - mainly used for educational / (my own) boiler-plate purposes. There are limitations.
  • though I did write this app up from scratch, I did so by following through the ReactJS Fundamentals course. All credits go to@tylermcginnis who created the course. This work is not entirely my own!
  • my development environment: Node v5.10.1, Mac OSX 10.11.
  • the app is written in JavaScript ES5. There is an opportunity to turn it into ES6/ES7.

Instruction

To run this app on your laptop (I used a Mac) do the followings:

Clone Repository

git clone this repository to an appropriate location on your machine:

git clone https://github.com/Atlas7/github-battle.git

Install NPM Dependencies

Navigate to the root level of the repository.

Install NPM dependencies:

npm install

Manually Setup GitHub API Access ID and Secret

At the root level of the repository, manually create a folder called secrets (this folder is included in .gitignore to avoid accidentally exposing your GitHub API access credentials):

mkdir secrets

Manually create a file called githubAPIConfig.js within this secrets directory:

touch secrets/githubAPIConfig.js

Populate the content of this githubAPIConfig.js like this:

module.exports = {
  id: "YOUR-GITHUB-API-ID",
  secret: "YOUT-GITHUB-API-SECRET"
}

Replace the string values for id and secret accordingly. You need to register an app that uses the GitHub API. Use the GitHub Register a new OAuth Application to register your application and obtain a new pair of GitHub API ID and Secret. I completed the fields like this:

Application Name: github-battle

Homepage URL: http://localhost:8080

Application Description: A fun web app that compares two GitHub User Profile stats and determine who the winner is.

Authorization callback URL: http://localhost:8080/callback

Once you have registered your app with GitHub you can retrieve your GitHub API ID and Secrets easily by going to your GitHub Profile -> Settings -> OAuth Applications -> Developer Applications -> github-battle (or whatever the app name you have registered with GitHub API).

Run the App in development mode

npm run start

Navigate via a browser (I use Chrome Incognito) at http://localhost:8080 - yay the app should be live!

(hosted by webpack-dev-server - essentially referencing app/index.html and app/index.js (non-minimized development version).

Run the App in production mode

npm run production

This will update dist/index.html and dist/index_bundle.js (minimized production version) - essentially your core web app production files.

Open the actual dist/index.html file (via Mac Finder) to start playing with the single page web app!

References

Check out this more (original and) comprehensive React-Fundamentals GitHub repository.

github-battle's People

Contributors

atlas7 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.