GithubHelp home page GithubHelp logo

ncpleslie / wmata-train-tracker Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 24.23 MB

WMATA train tracking application for monitoring train arrival times at your station of choice. Built to run on the Raspberry Pi

Home Page: https://traintracking.nickleslie.dev/

Vue 26.70% TypeScript 39.33% JavaScript 6.18% Makefile 0.70% Go 26.69% HTML 0.35% CSS 0.06%
nuxt trpc vue washington washington-dc washingtondc wmata wmata-api metro go

wmata-train-tracker's Introduction

WMATA Train Tracker

WMATA train tracking application is for monitoring train arrival times at your station of choice in Washington, DC. Built to run on the Raspberry Pi Zero 2 W.

The UI is built to closely resemble the Metro's "old" LED arrival boards.

Check it out in the browser at https://traintracking.nickleslie.dev/

Table of Contents

Controls

  • Set Your Station: Tap/Click the left side of the screen.
  • View Incidents: Tap/Click the right side.
  • Refresh Data: Tap/Click the middle of the screen (UI updates automatically at regular intervals).

About

This application is built to run on the Raspberry Pi Zero 2 W (but could run on most other Raspberry Pis or devices) and the Pimoroni HyperPixel 4.0 - Touch display. It can be housed in this 3D printed enclosure.

If more devices are requested to be supported I will make my best effort to support them. Please add your requested devices in the issues.

Setup on device

Check out Raspberry Pi specific instructions on how to set it up on your devices. This application can run in the browser or as a standalone application.

Technical specifications

This application can run as a standalone Wails application or in the browser with Nuxt 3

Nuxt 3

Nuxt 3 provides a UI and API (Used by the Wails Application). It can be accessed by visiting https://traintracking.nickleslie.dev/.

For development instructions and more information on the Nuxt application, navigate to the nuxt directory. The Nuxt application can be used as your preferred method of installing/running this application, if desired. Instructions on how to set up a Raspberry Pi in Kiosk mode to display the Nuxt website can be found here

Wails

The Wails application provides an alternative way of running the application anywhere or on the Raspberry Pi. Wails allows you to "Build desktop applications using Go & Web Technologies".

The Wails application is written with Go and utilizes the API exposed by the Nuxt 3 application. This allows for easier installation of the application without having to worry about API keys, etc.

Development instructions for the Wails/Go application can be found here.

Instructions on how to set up a Raspberry Pi in Kiosk mode to run the Wails application can be found here

Structure

This application has been set up as a monorepo with PNPM. This is to allow the Vue 3 components to be used by two applications along with other common TypeScript code.

  • .github - Contains Github Actions for building the Wails application
  • app - Contains Go-specific code used by the Wails application
  • build - Output directory for the built Wails application. Currently contains the app icon
  • documentation - Information on how to install the application on the Raspberry Pi
  • frontend - Vue 3 code used by the Nuxt application and the Wails application
  • nuxt - A Nuxt 3 application providing a deployed UI that can be viewed in the browser and an API
  • shared - Shared TypeScript models and constants used between the Nuxt and Frontend application

Wails Development

Install Go using the standard steps. Next, install Wails using the standard steps.

Test

Tests can be run with the following command.

go test ./...

or

make test

Lint

Linting is provided by golangci-lint.

golangci-lint run ./...

or

make lint

SQL Generation

This application uses SQLC for SQL code gen. The SQL code can be found in the app/db directory. The application makes use of a SQLite database for storage of some user values.

Ensure SQLC is installed before continuing.

Use the following command to regenerate the required Go files.

sqlc generate

or

make sql-generate

Development

Use the standard Wails CLI commands for development

wails dev

or

make dev

make dev-no-bind # Without building frontend and bindings

Build

Run the standard Wails build CLI command and navigate to the build directory to see the output. Ensure the config.cfg file is located in the same directory as the executable. The application will fail to start otherwise.

wails build

or

make

Frontend

The UI for this application is created using Vue 3. These components are found in the frontend directory. These components are also used by the Nuxt 3 application. This is to provided a consistent experience between the Wails and Nuxt application.

wmata-train-tracker's People

Contributors

ncpleslie avatar

Watchers

 avatar  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.