GithubHelp home page GithubHelp logo

kangasta / timetbl Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 5 MB

Mobile friendly WebApp to show nearest HSL departures

Home Page: https://kangasta.github.io/timetbl/

License: MIT License

HTML 3.05% JavaScript 2.79% CSS 1.30% TypeScript 87.94% RobotFramework 3.48% Dockerfile 1.00% Shell 0.45%

timetbl's Introduction

timetbl

CI Deploy Maintainability Test Coverage

Simple timetable screen that uses Digitransit API to fetch HSL realtime data and React to render the data. See digitransit for details of the HSL API.

Photo of the app displayed on a phone screen

Usage

For WebApp behaviour navigate to the served page and enable location.

Client side routing and query parameters

The WebApp has three main modes, nearby, stop menu, and stop, accessible directly through URLs and configured with query parameters:

Nearby mode shows all nearby departures and is located at /#/nearby. Query parameters lat, lon, and r can be used to configure the latitude,longitude, and radius for a nearby query, respectively. For example, lat=60.198721&lon=24.933413&r=2000 will query nearest departures around Pasila station with radius of 2000m.

Stop menu provides a list of nearby stops with links to each stop mode view and in located at /#/menu. The stop menu mode reads the coordinates and radius similarly than the nearby mode.

Stop mode shows departures of specified stop or list of stops and is located at /#/stop. The stop code or name is passed in with query parameter code. The codes or names are separated with commas if multiple codes or names are given. For example, code=Karhusaarensolmu or code=E2036,E2037.

In both cases, query parameter follow=false can be used to disable the polling of the browser location.

Development

Application logic is developed under src/App/ directory. UI components are developed in src/Components directory.

Getting stared

To get development server running on your machine, run:

# Install dependencies and start dev server
npm install;
npm start;

Before committing

The code is linted and unit tested with:

# Lint
npm run lint
# or
npm run lint -- --fix
# to also fix automatically fixable errors

# Unit test
npm test
# or
npm test -- --coverage
# to also get coverage analysis

To create production build:

npm install && npm run build;

timetbl's People

Contributors

kangasta avatar dependabot[bot] avatar

Stargazers

Jaakko Lehtinen avatar

Watchers

James Cloos avatar  avatar  avatar

timetbl's Issues

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.