GitXplorerGitXplorer
n

serverless-graphql-app

public
34 stars
9 forks
1 issues

Commits

List of commits on branch master.
Unverified
70f6d00ad487882395f9d6cb1d4d0beb9d5a9c9b

Adds styling for the app ui

nnikhilaravi committed 9 years ago
Unverified
005edb423680779844acad71dc1dda127302f7b0

Updates app

nnikhilaravi committed 9 years ago
Unverified
e231c79e9889b6264f73cb032989d74f2fc7a034

Adds some style

nnikhilaravi committed 9 years ago
Unverified
5171ffc1fefafd81d0cb57924606df94b1765699

Updates demo link in readme

nnikhilaravi committed 9 years ago
Unverified
7f9d2a7214314b26ef8b7b741934e43e702bfe27

Updates scripts

nnikhilaravi committed 9 years ago
Unverified
eb9fc654a873998882a1b6767c85ebe7987281b9

updates readme

nnikhilaravi committed 9 years ago

README

The README file for this repository.

Serverless GraphQL Jukebox

Front end and GraphiQL IDE for serverless graphql jukebox app.

The code for the creation of a lambda function and api gateway endpoint can be found here https://github.com/nikhilaravi/serverless-graphql Follow the steps to create the api and lambda first!! You'll need an api invoke url in order to deploy the UI.

Demo app: http://demo-v1.s3-website-us-east-1.amazonaws.com/app/

Demo GraphiQL: http://demo-v1.s3-website-us-east-1.amazonaws.com/graphiql/

To try out GraphiQL paste this query into the query editor

query($query: String) {
  suggestions(query: $query) {
    name,
    artist,
    url,
    imageUrl
  }
}

and paste this into the query variables editor on the bottom left of the screen.

{
  "query": "name of a song"
}

Then hit the 'play' button!

Technologies

  • AWS s3 - host a static website for the UI
  • GraphiQL - IDE to inspect and query a GraphQl schema
  • React
  • Babel
  • Webpack

Before you start export your environment variables

export AWS_ACCESS_KEY_ID='yourkey'
export AWS_ACCESS_KEY_SECRET='yoursecretkey'
export AWS_REGION='region'

1. Create an S3 bucket and enable static website hosting

Set the name of the bucket in the ./scripts/s3-create-app.sh file as well as in the ./scripts/s3-update-app.sh and ./scripts/s3-update-graphiql.sh

Create the bucket by typing the command:

npm run create-s3

2. Add the api invoke url to config.js

This the url that will be used to invoke the API gateway endpoint to trigger the GraphQL lambda function

3. Check everything works by running locally

The app and GraphiQL can be run individually using

npm run app:serve

or

npm run graphiql:serve

4. Deploy to S3

To deploy both the App and Graphiql use the command:

npm run deploy:ui

or to deploy each separately use:

npm run deploy:app

or

npm run deploy:graphiql

View the website!

Great your app is now live!

To view the app visit the url: http://bucketname.s3-website-eu-west-1.amazonaws.com/ Swap bucketname for the name of your bucket!!!*

Add /app at the end of the url to view the app or /graphiql to view GraphiQL.