Giter VIP home page Giter VIP logo

t-performance-dash's Introduction

TransitMatters Data Dashboard

lint build deploy healthcheck

This is the repository for the TransitMatters Data Dashboard. Client code is written in JavaScript with React, and the backend is written in Python with Chalice.

Requirements to develop locally

  • node 16.x required, works with anything >=16.x and <17. (verify with node -v)
  • Python 3.9 with recent poetry (verify with python --version; poetry --version; poetry self update to update poetry)

Development Instructions

  1. Add MBTA_V2_API_KEY to your shell environment:
    • $ export MBTA_V2_API_KEY='KEY' in ~/.bashrc or ~/.zshrc
  2. Add your AWS credentials (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY) to your shell environment, OR add them to a .boto config file with awscli command $ aws configure.
  3. In the root directory, run $ npm install to install all frontend and backend dependencies
  4. Run $ npm start to start both the JavaScript development server and the Python backend at the same time.
  5. Navigate to http://localhost:3000 (or the url provided after running npm start)

Deployment Instructions

  1. Configure AWS CLI 1.x or 2.x with your AWS access key ID and secret under the profile name transitmatters.
  2. Configure shell environment variables for AWS ACM domain certificates.
    • TM_FRONTEND_CERT_ARN
    • TM_FRONTEND_CERT_ARN_BETA
    • TM_BACKEND_CERT_ARN
    • TM_BACKEND_CERT_ARN_BETA
    • (You may also need to set AWS_DEFAULT_REGION in your shell to us-east-1. Maybe not! We're not sure.)
  3. Execute $ ./deploy.sh (for beta) or $ ./deploy.sh -p (for production). If deploying from a CI platform (such as GitHub Actions) you may also want to include the -c flag.

Additional notes:

  • If you're running this locally, your local MBTA-performance API key (which might be your own) will get uploaded to AWS!
  • If you're on a platform with a non-GNU sed, deploy.sh might fail. On macOS, this is fixed by $ brew install gnu-sed and adding it to your PATH.
  • If you get an unexplained error, check the CloudFormation stack status in AWS Console. Good luck!

Linting

To lint frontend and backend code, run $ npm run lint in the root directory

To lint just frontend code, run $ npm run lint-frontend

To lint just backend code, run $ npm run lint-backend

Updating backend data

See server/rapid/gen_latest_rapid_data.sh and server/bus/gen_latest_bus_data.sh for instructions.

Support TransitMatters

If you've found this app helpful or interesting, please consider donating to TransitMatters to help support our mission to provide data-driven advocacy for a more reliable, sustainable, and equitable transit system in Metropolitan Boston.

t-performance-dash's People

Contributors

austinjpaul avatar mathcolo avatar friendchris avatar nathan-weinberg avatar crschmidt avatar idreyn avatar devinmatte avatar dependabot[bot] avatar patrickcleary avatar skaplan-dev avatar mxmeinhold avatar danielreynoldsma 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.