Git Product home page Git Product logo

githunt-api's Introduction

GitHunt

The Apollo Server backend shared by all Apollo client example apps.

Interact with the API yourself at http://api.githunt.com/graphiql.

Get on Slack Build Status

Demonstrates:

  1. GraphQL schema, resolvers, models, and connectors to read from two different data sources, GitHub REST API and SQL
  2. Web server with authentication and basic authorization using Express, Passport, and Apollo Server

Please submit a pull request if you see anything that can be improved!

Running the server

  1. Install Node/npm. Make sure you have Node.js 4 or newer installed.
  2. Clone and install dependencies. Run the following commands:
git clone https://github.com/apollostack/GitHunt-API.git
cd GitHunt-API
npm install
  1. Run migrations. Set up the SQLite database and run migrations/seed data with the following commands:
npm run migrate
npm run seed
  1. Get GitHub API keys.

  2. Go to OAuth applications > Developer applications in GitHub settings

  3. Click 'Register a new application' button

  4. Register your application like below

  5. Click 'Register application' button at the bottom. It should look like this screenshot of the app setup page.

  6. On the following page, grab the Client ID and Client Secret, as indicated in this screenshot of the GitHub OAuth keys page.

  7. Add Environment Variables. Set your Client ID and Client Secret Environment variables in the terminal like this:

export GITHUB_CLIENT_ID="your Client ID"
export GITHUB_CLIENT_SECRET="your Client Secret"

Or you can use dotenv, to do this cp .env.default .env and edit with your Github keys.

  1. Run the app.
npm run dev
  1. Open the app. Open http://localhost:3010/ to see what to do next.

githunt-api's People

Contributors

abhiaiyer91 avatar amandajliu avatar aruntk avatar b091 avatar bendiuguid avatar calebmer avatar daniman avatar dburles avatar delgermurun avatar dotansimha avatar greenkeeper[bot] avatar greenkeeperio-bot avatar grigio avatar helfer avatar iurii-kyrylenko avatar jboothe avatar kamilkisiela avatar martijnwalraven avatar michaltakac avatar mikhaylk avatar mistic avatar poincare avatar pradel avatar robertohuertasm avatar rohit2b avatar slava avatar timmikeladze avatar tmeasday avatar tychota avatar urigo 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.