Git Product home page Git Product logo

movieql's Introduction

MovieQL

Build Status


Graphql+Salesforce -based React Native Movie Application

This app is featured in a Dreamforce 2016 talk: Leverage GraphQL to Efficiently Query Data Relationships in Salesforce

MovieQL


MovieQL is a project handling both React Native client and the GraphQL server.

The root of the project is the React Native app, while what's in /data is the GraphQL schema server.

Installation

You will need to setup Node 6+ and React Native first.

Then you have to choose how to run this:

Clone the repository

First, you need to get the code!

git clone https://github.com/rricard/movieql.git
cd movieql

Install the dependencies

npm install

Use the public endpoint

Skip this step if you use your own Salesforce setup

You need to change the code to point to the public endpoint in every case:

app/client.js

- const GRAPHQL_ENDPOINT = __DEV__ ? 'http://localhost:3000/graphql' : 'https://movieql.herokuapp.com/graphql';
+ const GRAPHQL_ENDPOINT = 'https://movieql.herokuapp.com/graphql';

Configure the Salesforce Org.

Skip this step if you use the public endpoint

You will need to setup the following custom objects in Salesforce (using the Schema Builder):

Relations

Once it is done, populate some Movie, Actor and Role in Salesforce, correctly linking them to numeric MovieDB IDS.

Example: Reservoir Dogs has the following url on MovieDB: https://www.themoviedb.org/movie/500-reservoir-dogs?language=en. In this URL, the ID is 500.

Get auth to Salesforce and MovieDB

Skip this step if you use the public endpoint

Create a .env file in the repository directory with the following contents:

MOVIE_DB_TOKEN=<Get this token on https://www.themoviedb.org/documentation/api>
SFDC_USERNAME=<enter your salesforce email used for login>
SFDC_PWD_AND_TOKEN=<enter your salesforce password><security token - help here: https://help.salesforce.com/HTViewHelpDoc?id=user_security_token.htm>

Run!

Start the GraphQL server

Skip this step if you use the public endpoint

Now everything is ready to start!

npm start

Start the React Native server

npm run rn-start

Start the App on iOS

react-native run-ios

Start the App on Android

react-native run-android

Run code checks

Static Typechecking (flow)

./node_modules/.bin/flow

Unit tests

npm test

Linter

npm run lint

movieql's People

Contributors

rricard avatar pmdartus avatar

Watchers

Praneel PIDIKITI 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.