Backend API & Frontent UI for live departure board for UK Rail.
This repository has been archived on 2023-08-24. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
2022-12-19 23:52:27 +00:00
.vscode Implement ENV Vars 2022-12-19 22:26:51 +00:00
src Implement ENV Vars 2022-12-19 22:26:51 +00:00
static Begin front-end board work 2022-12-19 23:52:27 +00:00
.dockerignore Preparation for Dockerising 2022-12-12 14:28:40 +00:00
.gitignore Initial commit 2022-11-29 19:28:24 +00:00
app.js Implement ENV Vars 2022-12-19 22:26:51 +00:00
Dockerfile Adjust dockerfile 2022-12-19 11:08:30 +00:00
LICENSE General Development 2022-11-30 22:08:27 +00:00
package-lock.json Prepare for DB integration 2022-12-09 20:59:18 +00:00
package.json Package changes 2022-12-14 14:49:55 +00:00
README.md Readme update 2022-12-19 12:10:35 +00:00

OwlBoard

OwlBoard is both a backend API, and a frontend Arrival/Departure board webapp.

Powered by Node.JS and using the ldbs-json module, the OwlBoard API provides up to date train departure information for any station in the UK.

Whilst the application is open source, the webservice (owlboard.fb-infra.uk) is not openly available. National Rail Enquiries have limits on API access so to use this software yourself, you'll need to run your own instance after obtaining your own API key.

The webservice (owlboard.fb-infra.uk) may contain ads to support the running of the service, if ads are implemented, I intend to avoid 'dubious' advertisers that target and track users.

Currently only the public API is available as I am currently unable to request a key for the staff version.

Requirements:

To run this server you will need:

  • Docker or Kubernetes

WebApp Colours:

  • See CSS Variables

API Endpoints:

  • /api/v1:

    • /test:

      • GET: Check your connection with the server
        • If Authentication: Basic header is provided your key will be checked, if not then just the conenction will be tested.
    • /list:

      • GET: Get list of stations
        • Request Header - Basic Auth -- Not Currently Implemented/Required on this route
        • Returns JSON: {"STATION NAME":{"CRS":"code","TIPLOC":"code"}}
    • /ldb:

      • /{crs}:
        • GET: Get arrival/departure board for {crs}
          • Request Header - Basic Auth -- Not Currently Implemented/Required on this route
          • Returns JSON: Formatted as per ldbs-json module.
    • /gitea:

  • /api/kube:

    • /alive:

      • GET: Check alive
        • Returns JSON: {"status":"alive"}
    • /ready:

      • GET: Check ready
        • Returns JSON: {"state":""} ready or not_ready.

Stack:

  • app.js -> Launches server, Entry Point, defines routers and middlewares.
    • routes -> Routers - Directs requests to controllers.

      • controllers -> Checks auth, sends response. Request doesn't pass further.
        • services -> Provide data and do tasks, uses other services and utils.
    • utils -> Provide utility functions that can be called by services.

    • configs -> Provide configuration details for other files.

    • static -> Holds files for static service, should be hosted behind a caching proxy.

Configuration:

The app is designed to be run within Kubernetes or within a Docker container, as such configuration is provided with environment variables. See the variable name and default options below. If a required configuration is not present the program will exit when that feature is initialised.

VAR DEFAULT REQUIRED PURPOSE
OWL_SRV_PORT 8460 NO Web Server Port
OWL_SRV_LISTEN 0.0.0.0 NO Web Server Listen Address
OWL_DB_USER YES Database Username
OWL_DB_PASS YES Database Password
OWL_DB_NAME owlboard NO Database Name
OWL_DB_PORT 3306 NO Database Server Port
OWL_DB_HOST database NO Database Server Host
OWL_LDB_KEY YES National Rail LDBWS API Key
OWL_LDB_SVKEY NO National Rail LDBSVWS API Key
OWL_LDB_CORPUSUSER YES Network Rail CORPUS API Username
OWL_LDB_CORPUSPASS YES Network Rail CORPUS API Password
OWL_GIT_ISSUEBOT NO Gitea API Key for issue reporting

In the case that OWL_LDB_SVKEY is not available, staff versions of departure board, etc. will not be available.

In the case that OWL_GIT_ISSUEBOT is not available, the 'Report Issue' page will not be able to POST data.