Giter Club home page Giter Club logo

trip-total-frontend's Introduction

This is the starter kit for Javascript SDK with React.

This kit contains a simple web application that displays car information using Smartcar's Javascript SDK and React as the front-end SPA framework.

Instructions

Before we get started, create an application on Smartcar's Developer Dashboard to get your API keys.

Note: On the dashboard, you will want to set your redirect_uri as https://javascript-sdk.smartcar.com/redirect-2.0.0?app_origin=http://localhost:3000.

Then, we can set these as environment variables -

$ export REACT_APP_CLIENT_ID=<your-client-id>
$ export REACT_APP_REDIRECT_URI=<your-redirect-uri>

Before setting up the client code, make sure to set up the server code. You can use any of our following back-end SDKs -

Follow the setup instructions in the back-end README except for the redirect_uri. Make sure the redirect_uri environment variable in the back-end directory is the same as the one we have set above.

Now that the server is ready, you can set up the client (the React application).

Set the server uri as an environment variable. This should be from your back-end directory and is set to http://localhost:8000 by default.

$ export REACT_APP_SERVER=<your-server-uri>

Make sure you have cloned this repo -

$ git clone https://github.com/smartcar/getting-started-javascript-sdk-react.git
$ cd getting-started-javascript-sdk-react/app

To install the required dependencies and run this React app -

$ npm install
$ npm run start

Once your server is up and running, you can authenticate your vehicle at http://localhost:3000 in your browser. In our current set up, we are using Smartcar's test mode, so you can log in with any username and password and you will see information of a simulated vehicle.

trip-total-frontend

trip-total-frontend

trip-total-frontend's People

Contributors

theodorewahle avatar

Watchers

James Cloos avatar  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.