Skip to content

marceloboeira/BVGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

55 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

BVGame

๐Ÿ’› An unofficial BVG Stations Game

Motivation

The ideia is to learn more about functional programming & front-end applications with Elm.

Disclaimer don't take the code here too seriously, it's probably crappy since it's my first attempt to build an SPA and also my first app with Elm. ๐Ÿ˜‰

The Game

The game is about Subway Stations and Lines from the Berliner Verkehrsbetriebe BVG. The players must guess at least one train Line that cross a given station.

Architecture

How does it work?

Web

Static SPA served with GitHub Pages

The code of the application is written in Elm. During build, the Elm files are compiled to a single Javascript, application.js that is served statically, together with raw CSS and HTML files. Everything under dist/ is served with Github Pages, built from the master branch of this repo to the gh-pages branch by Travis-CI.

The application also requires data coming from the dist/data folder, which is generated from the pipeline.

Data Pipeline

Gathering data for the game

In order to gather information about the stations, a small pipeline was created, heavily inspired by derhuerst work on the VBB libraries.

The output of the pipeline is copied to dist/data/ as JSON files, consumed by the web-application as data source.

Last updated at: 22.01.2022

Contributing

Help us to improve the codebase

Found a bug? Have a suggestion? Please open an issue.

Want to contribute with code?

Developers

  1. Star the project. โญ๏ธ
  2. Open or find an issue here
  3. Fork it (https://github.com/marceloboeira/BVGame/fork)
  4. Create your feature branch (git checkout -b feature/awesome-parrot)
  5. Commit your changes
  6. Push to the branch (git push origin feature/awesome-parrot)
  7. Create a new Pull Request

Build & Run

Available commands

  • make run - Run the webserver at http://localhost:1928.
  • make build - Build the application.js file to the dist/ folder.
  • make setup - One time setup of dependencies.
  • make setup_pipeline - Install dependencies for the pipeline. (It's triggered by the setup)
  • make build_pipeline - Run the pipeline and copy the files to the dist/ folder. (It's triggered by the setup)
  • make test - Run the tests.
  • make test_watch - Run the tests watching for changes.
  • make check_format - Check if the code is formated
  • make format - Format the code following elm standards.

Credits