Skip to content

Developer Guidelines

Adnan I. edited this page Sep 2, 2015 · 7 revisions

Overview

WaiveCar is a service to provide rentals of electric cars. The idea is to allow users (in Los Angeles for the MVP) to open an App and view Car locations on a Map. They will then select a Car, book it, and receive walking directions to the Car. Upon arrival the Car will automatically unlock and they will be able to press a start button and drive. The rental will be free for the first 2 hours and the hope is that they will drop the Car back to a charging station upon completion of the rental.

The specifics on these requirements are still quite fluid (e.g. how much per hour is charged after 2 hours) but this is the general gist. The screens in Invision will be the best place to see how this all hangs together.

The service will secure revenue primarily by providing advertisement space on the Car (think: like a Taxi has advertisement on its roof). There is an eventual goal to implement some gamification in to the App for drivers (e.g. drive past Rodeo Drive and receive an additional 20 mins of free driving time).

The current target is to have 20 cars live in LA by November 1. There are some large blockers at present that may make this an impossible target, but this is the current expectation. For reference, development is scheduled to complete October 2nd but in light of this recent news regarding November 1, this date will most likely shift.

Technical Implementation

The solution currently includes an app, a website, and a shared API.

There is chatter about moving to a native App solution due to functional limitations of a hybrid solution. However, for now, we are using ionic for the App and we are targeting both Android and iOS platforms. React Native or native development may be the next step following MVP.

The website combines a marketing site, an admin portal, and some 'my account' features for users. It is written in React but development has only just commenced in this area.

The API is written using Reach, a new framework based on Koa, that Christoffer and myself have been working on. It is a modular architecture built specifically to support fast API development. Documentation for this is slowly being written but you can have a look at http://reach.github.io to get started. Functionally it is mostly complete.

Integrations

  • General Motors
    • The API integrates with the General Motors API to manage Cars and supports things like locating Cars, diagnostic information (e.g. how much charge is left), and commands like unlock doors, enable start. We have a test account the provides access to 10 mocked Cars that is quite limited. As such, we have mocked a lof the interactiosn with this service to allow development to not be blocked by not having live GM data with real Cars.
  • Stripe
    • store credit card details and process payments
  • Mandrill
    • send emails for notifications (e.g. password reset, email verification, etc.)
  • Twilio
    • confirm a user's phone number via SMS on signup.
  • Insurance Company
    • yet to be confirmed, the insurance company will provide us with an API to invoke to validate a license.
  • Ad Service
    • the App is to utilize an Ad service and this will be a key revenue generator for the service. We are yet to learn which Ad service will be used.
  • Skobbler
    • Skobbler has been selected as the mapping solution for the App. As it is a hybrid solution, native Apple/Google maps were not possible either due to web based limitations or licensing. Skobbler works well and our previous developer, Fabio, has spent significant time on building out ionic code to get it up and running.

Branching

To support multiple projects in a single repository the following branching strategy is used:

  • app/development -> app/master
  • api/development -> api/master
  • web/development -> web/master

Local Developer Setup

To easily work with this branching structure, create a local folder for waivecar and, under that folder, clone each development branch in to relevant folders. For example, my local structure is as follows.

  • github/
    • clevertech/
      • waivecar/
        • api
        • app
        • web

To then clone the project for each branch, cd in to a folder, e.g. api, and then run git clone git@github.com:clevertech/Waivecar.git. Once cloned, switch the branch to the relevant dev branch (in this example, api/development) and you are ready to code.

Setup Notes

App

After cloning the project, install dependencies and then ionic serve to run the App in a browser using live reload for development. To learn more about ionic, head over to it's website.

Dependencies:

npm i
npm i -g gulp
bower i

Api

After cloning the project run the following commands.

$ npm install -g nodemon reach
$ reach install --npm

You will need redis and mysql (and the latest version of Node) running locally. Once in place, create a local.js configuration file where applicable, and then run npm run local to develop locally.

Note that the App is configured to look at the development environment running on AWS so that it can be easily tested on device (localhost was having issues). As such, if you are working on the App, you probably don't need the Api set up locally.

Web

This is a React application that includes the marketing site, web app, and admin portal. After cloning the project, run npm install and then npm run local to run locally.