Architecture

Repositories

View large image

Technology Choices

  • Scala for data processing and Play framework: solid, stable toolkit for dealing with complex data.
  • jsoup for rendering templates: dynamic, works well with HTML5 and XML.

Project layout

My preference is to have everything in a single Git repository but I did some refactoring to move the stable bits out of the repository into their own libraries/modules/repositories so that the stable stuff does not get in the way any more.

Developing

Install SBT: http://www.scala-sbt.org/download.html

Use IntelliJ Community Edition: https://www.jetbrains.com/idea/download/. Simply import the directory as an 'SBT' project.

sbt web/run

This will load all the data and cache the computations in-memory, so you can work on the front-end. If you wish to not cache all the data & would like to recompute it instead, use:

sbt 'web/run -Dfull.provider=normal'

Running tests

sbt clean test it:test

API endpoints

The API endpoints are intended to be stable.

We provide CSV where possible, and JSON otherwise.

[cors] means that you can call this API endpoint from a browser AJAX client. Where CORS is not allowed, we expect you to use server-side access instead. The list of these definitions is specified in application.conf play.filters.cors.pathPrefixes section.

Logs

We offer access to raw logs from ActionFPS.

  • Historical data: curl -s 'https://actionfps.com/logs.tsv?from=2017-01-01T00:00:00Z&to=2099-04-10T11:02:03Z' - get raw events for these time periods using the tab-separated values (TSV) format.
  • Live data from the end: curl -s 'https://actionfps.com/logs' - get live events using EventSource standard.
  • Live data from a specified time: curl -H 'Last-Event-ID: 2017-04-30T01:02:03Z' -i https://actionfps.com/logs - get live events from this last event ID. This is part of EventSource standard and is supported by EventSource clients such as Scala Alpakka one, Node.js one, as well as the JavaScript one. With this, you can resume from a broken stream of data.

Filtering

We filter out some data for privacy reasons:

  • IP Addresses are turned to 0.0.0.0.
  • Person-to-person messages are not displayed.

To have access to the true stream we use JWT.

Other

Dev endpoints

As defined in web/app/controllers/Dev.scala#L27.

So you can edit templates without having to have the true data.

DevOps

Continuous Deployment: master --> https://git.watch/ --> build & restart. Simple monolithic deployment.

results matching ""

    No results matching ""