Giter Club home page Giter Club logo

realtimerail.nyc's Introduction

realtimerail.nyc

realtimerail.nyc is an open-source web app for the NYC subway. It displays train times based on realtime data from the MTA. The app's philosophy is to be very simple and 100% user-centric. No cookies, no tracking, no ads, etc.

This repository hosts the UI code. The app uses Transiter on the backend.

Contributions are very welcome!

Development guide

Assuming that you have node installed, the development build listing on port 3000 is launched using:

npm start

By default, all backend requests are proxied to staging.realtimerail.nyc so you don't need to run the backend yourself.

An optimized production build can be created using:

npm run build

However in production the app is deployed as a Docker image:

docker build .

The project's Docker image is an Nginx image containing the compiled files and some basic caching configuration.

Code layout

Each page in the app is a separate Typescript file in src/pages. Common UI elements are extracted and shared via in src/elements React hooks (for HTTP requests, loading favorites, GPS location) are in src/hooks. Non-React Javascript helper files are in src/lib.

Other files in the src directory are largely self-explanatory and generally don't need to be touched.

Formatting/linting/testing

Formatter: npx prettier . --write

Linter: npx eslint src

Tests: unfortunately almost non-existent. The few tests that exist can be run with npm test.

Backend

As mentioned above, all backend requests are proxied to staging.realtimerail.nyc. In general the app expects Transiter to be available at $DOMAIN/transiter/v0.6 and expects the NYC subway system to be installed in the Transiter instance with ID us-ny-subway. The transiter/v0.6 and us-ny-subway constants live in src/api/api.ts in case you want to change them.

License

MIT.

The icons used in the header are from Iconoir and are also MIT licensed.

The subway symbols are copyrighted by the MTA. The app has a license from the MTA to use them.

realtimerail.nyc's People

Contributors

jamespfennell avatar dependabot[bot] avatar bporter816 avatar kungpaogao avatar ashika-verma avatar evansobkowicz 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.