[DEPRECATED] 🚋 The server shared by all of the GitHunt client examples
Switch branches/tags
abernix/upgrade-engine apollo-bot/templates apollo-caching cacheControlSchemaImplementation deploy diff example-breaking-state feat/new-graphql graphql-server greenkeeper-babel-cli-6.14.0 greenkeeper-babel-cli-6.18.0 greenkeeper-babel-cli-6.22.0 greenkeeper-babel-cli-6.22.1 greenkeeper-babel-cli-6.22.2 greenkeeper-babel-core-6.22.0 greenkeeper-babel-core-6.22.1 greenkeeper-babel-preset-es2015-6.14.0 greenkeeper-babel-preset-es2015-6.18.0 greenkeeper-babel-preset-es2015-6.22.0 greenkeeper-babel-preset-react-6.11.1 greenkeeper-babel-preset-react-6.22.0 greenkeeper-babel-preset-react-6.23.0 greenkeeper-babel-preset-stage-2-6.13.0 greenkeeper-babel-preset-stage-2-6.18.0 greenkeeper-babel-preset-stage-2-6.22.0 greenkeeper-babel-register-6.14.0 greenkeeper-babel-register-6.18.0 greenkeeper-babel-register-6.22.0 greenkeeper-body-parser-1.16.0 greenkeeper-connect-session-knex-1.3.0 greenkeeper-connect-session-knex-1.3.1 greenkeeper-dotenv-3.0.0 greenkeeper-eslint-3.14.0 greenkeeper-eslint-3.17.0 greenkeeper-eslint-config-airbnb-11.1.0 greenkeeper-eslint-config-airbnb-11.2.0 greenkeeper-eslint-config-airbnb-12.0.0 greenkeeper-eslint-config-airbnb-13.0.0 greenkeeper-eslint-config-airbnb-14.0.0 greenkeeper-eslint-plugin-babel-4.0.0 greenkeeper-eslint-plugin-babel-4.0.1 greenkeeper-eslint-plugin-import-2.0.0 greenkeeper-eslint-plugin-import-2.0.1 greenkeeper-eslint-plugin-import-2.1.0 greenkeeper-eslint-plugin-import-2.2.0 greenkeeper-eslint-plugin-jsx-a11y-2.2.2 greenkeeper-eslint-plugin-jsx-a11y-2.2.3 greenkeeper-eslint-plugin-jsx-a11y-3.0.0 greenkeeper-eslint-plugin-jsx-a11y-3.0.1 greenkeeper-express-session-1.14.2 greenkeeper-express-session-1.15.0 greenkeeper-graphql-0.8.0 greenkeeper-graphql-0.8.1 greenkeeper-graphql-0.8.2 greenkeeper-graphql-0.9.0 greenkeeper-graphql-0.9.1 greenkeeper-graphql-server-express-0.5.0 greenkeeper-graphql-server-express-0.5.1 greenkeeper-graphql-subscriptions-0.2.3 greenkeeper-graphql-tools-0.9.1 greenkeeper-lodash-4.16.5 greenkeeper-lodash-4.17.0 greenkeeper-lodash-4.17.1 greenkeeper-lodash-4.17.2 greenkeeper-lodash-4.17.3 greenkeeper-optics-agent-1.1.0 greenkeeper-optics-agent-1.1.1 greenkeeper-sqlite3-3.1.8 greenkeeper-subscriptions-transport-ws-0.3.0 greenkeeper-subscriptions-transport-ws-0.3.1 greenkeeper-subscriptions-transport-ws-0.4.0 greenkeeper-update-all greenkeeper/babel-cli-6.24.1 greenkeeper/babel-core-6.25.0 greenkeeper/babel-eslint-7.2.2 greenkeeper/babel-eslint-7.2.3 greenkeeper/babel-preset-es2015-6.24.1 greenkeeper/babel-preset-stage-2-6.24.1 greenkeeper/babel-register-6.24.1 greenkeeper/body-parser-1.17.2 greenkeeper/cors-2.8.4 greenkeeper/cors-pin-2.8.3 greenkeeper/eslint-4.0.0 greenkeeper/eslint-4.1.0 greenkeeper/eslint-4.1.1 greenkeeper/eslint-4.2.0 greenkeeper/eslint-4.3.0 greenkeeper/eslint-config-airbnb-15.0.0 greenkeeper/eslint-config-airbnb-15.0.1 greenkeeper/eslint-config-airbnb-15.0.2 greenkeeper/eslint-config-airbnb-15.1.0 greenkeeper/eslint-plugin-babel-4.1.2 greenkeeper/eslint-plugin-import-2.3.0 greenkeeper/eslint-plugin-import-2.4.0 greenkeeper/eslint-plugin-import-2.5.0 greenkeeper/eslint-plugin-import-2.6.0 greenkeeper/eslint-plugin-import-2.6.1 greenkeeper/eslint-plugin-import-2.7.0 greenkeeper/eslint-plugin-jsx-a11y-5.0.0 greenkeeper/eslint-plugin-jsx-a11y-5.0.1 greenkeeper/eslint-plugin-jsx-a11y-5.0.2 greenkeeper/eslint-plugin-jsx-a11y-5.0.3 greenkeeper/eslint-plugin-jsx-a11y-5.1.0 greenkeeper/eslint-plugin-jsx-a11y-6.0.0 greenkeeper/eslint-plugin-jsx-a11y-6.0.1 greenkeeper/eslint-plugin-jsx-a11y-6.0.2 greenkeeper/eslint-plugin-react-7.0.1 greenkeeper/eslint-plugin-react-7.1.0 greenkeeper/express-session-1.15.3 greenkeeper/express-session-1.15.4 greenkeeper/graphql-0.10.4 greenkeeper/graphql-0.10.5 greenkeeper/graphql-pin-0.9.2 greenkeeper/graphql-pin-0.10.3 greenkeeper/graphql-server-express-1.0.0 greenkeeper/graphql-server-express-1.0.2 greenkeeper/graphql-server-express-1.0.4 greenkeeper/graphql-server-express-1.0.5 greenkeeper/optics-agent-1.1.5 greenkeeper/optics-agent-1.1.6 greenkeeper/optics-agent-pin-1.1.4 greenkeeper/pg-6.4.1 greenkeeper/pg-7.0.0 greenkeeper/pg-7.0.1 greenkeeper/pg-7.0.2 greenkeeper/pg-pin-6.4.0 greenkeeper/subscriptions-transport-ws-0.8.0 greenkeeper/subscriptions-transport-ws-0.8.1 greenkeeper/subscriptions-transport-ws-0.8.2 helfer-patch-1 helfer-patch-2 history klaire/cacheControl klaire/fixCaching klaire/fixLinting klaire/testTestSuites master mergeable_persisted nim/optics-agent optics-agent persisted_queries prod-db revert-2-helfer-patch-1 subscriptions telemetry timbotnik/fix-graphiql-wss timbotnik/upgrade-engine updateGitHunt
Nothing to show
Clone or download

README.md

[DEPRECATED] GitHunt

Please note: This project is no longer maintained. For an up to date example of modern day Apollo usage, please refer to the Apollo fullstack tutorial.

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.