Skip to content

Latest commit

 

History

History
72 lines (46 loc) · 1.74 KB

README.md

File metadata and controls

72 lines (46 loc) · 1.74 KB

GitHunt

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

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

git clone https://github.com/apollostack/GitHunt.git
cd GitHunt
npm install

3. Run Migrations

Set up the SQLite database and run migrations/seed data with the following commands:

npm run migrate
npm run seed

4. Get GitHub API keys

Github OAuth

On the following page, grab:

  • Client ID
  • Client Secret

OAuth Key

5. Add Environment Variables

Set your Client ID and Client Secret Environment variables:

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

Or you can use dotenv.

cp .env.default .env and edit with your Github keys.

6. Run the app

npm start