Git Product home page Git Product logo

car-share-fare's Introduction

car-share-fare

CircleCI

Knowing which car share to use in Vancouver (the car share capital of North America) is non-trivial. This tool aims to help by making it easy to compare costs.

Try it out at https://carshare.now.sh

Supported services

  • Evo - one-way carsharing company
  • Lyft - ridesharing company
  • Modo - two-way carsharing co-operative

Development

This project was bootstrapped with TSDX.

Making a new release

  • Update CHANGELOG.md and commit that.
  • Run npm version <patch/minor/major> (this updates package.json and creates a tag).
  • Run git push --tags.

npm start

Start the app.

npm run build

Bundles the package (using Rollup) and copies static assets to the dist folder.

Use build:watch during development to watch for changes.

npm test

Runs the test watcher (Jest) in an interactive mode. By default, runs tests related to files changed since the last commit.

Deployment

Each build is deployed to https://carshare.now.sh with now. The configuration lives in now.json.

car-share-fare's People

Contributors

dependabot[bot] avatar wachunga avatar

Watchers

 avatar

car-share-fare's Issues

Update car2go costs - July 29

Prices are going up slightly effective July 29 according to an email I received Jun 29:

The long distance fee will be increasing from $0.45/kilometer to $0.49/kilometer. This fee only applies if you go over your allotted mileage in a Trip Package or surpass 200 km of driving when you select the Per Minute Rate.

For later: I suppose this will be a common use case. Probably we should include the notion of "effective date" so this config can be added in advance.

Add support for car2go

something like this:

const car2go = {
  key: "car2go-yvr",
  url: "https://www.car2go.com/CA/en/vancouver/rates/",
  lastUpdate: "2019-06-15",
  currency: "CAD",
  fees: {
    trip: 1, // first 200 trips per calendar year
    registration: 5,
    annual: 2,
    daily: 1.5 // tax on trips lasting 8 hours or more
  },
  packages: [
    {
      name: "minute rate - smart",
      vehicle: "smart fortwo",
      maxPassengers: 2,
      time: [{ per: 1, cost: 0.32 }],
      distance: {
        unit: "km",
        steps: [{ start: 0, end: 200, cost: 0 }, { start: 200, cost: 0.45 }]
      }
    },
    {
      name: "minute rate - mercedes",
      vehicle: "Mercedes Benz CLA/GLA",
      maxPassengers: 5,
      time: [{ per: 1, cost: 0.45 }],
      distance: {
        unit: "km",
        steps: [{ start: 0, end: 200, cost: 0 }, { start: 200, cost: 0.45 }]
      }
    },
    // TODO: 3 hours - smart
    {
      name: "3 hours - mercedes",
      vehicle: "Mercedes Benz CLA/GLA",
      maxPassengers: 5,
      time: [
        { start: 0, cost: 45 }, // 3 hours
        { start: 60 * 3, per: 1, cost: 0.32 }
      ],
      distance: {
        unit: "km",
        steps: [{ start: 0, end: 200, cost: 0 }, { start: 200, cost: 0.45 }]
      }
    },
    // TODO: 6 hours
    // TODO: 1 day (200)
    // TODO: 2 days (400)
    // TODO: 3 days - smart
    {
      name: "3 days - mercedes",
      vehicle: "Mercedes Benz CLA/GLA",
      maxPassengers: 5,
      time: [
        { start: 0, cost: 249 }, // 3 days
        { start: 60 * 24 * 3, per: 1, cost: 0.32 }
      ],
      distance: {
        unit: "km",
        steps: [{ start: 0, end: 600, cost: 0 }, { start: 600, cost: 0.45 }]
      }
    }
  ]
};

Add a basic UI

Just an MVP. Can polish later.

  • two inputs boxes (minutes, km)
  • submit calls computeCosts and presents the results in a table
  • host on github pages?

Later, we can integrate with google maps (or similar) to calculate the distance for you

Do money properly

There are floating point issues with handling currency just as numbers in javascript. Better deal with this sooner rather than later.

I've used big.js in the past but this looks promising: https://github.com/sarahdayan/dinero.js (comes with formatting, currencies, etc)

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.