/tscw-daemon

Webserver to serve .xml files generated by statcrew for Tennessee Tech University's sports program

Primary LanguageTypeScriptGNU General Public License v3.0GPL-3.0

tscw-daemon

Webserver to serve .xml files generated by statcrew for Tennessee Tech University's sports program

Purpose

This application was built to as a solution for legacy software at Tennessee Tech University's sports program called Statcrew. The Statcrew software is very old, does not have vendor support (at least with TTU), and often running on a virtual 32-bit Windows machine on a separate network from the rest of the sports program.

My understanding of the Statcrew software was that one member of the department would enter information into it, the software generates a .xml file with stats for each player in the game, and another piece of software on the video board reads the stats. The problem became that the Statcrew software was running on a separate network with no routing, and frequently in another building, and IT was unable to remedy this in time.

Solution

We came up with a two piece design to solve the separate network issue; a relay server run outside of the school's private network that accepts HTTP requests, and this daemon server which connects to the relay to respond to requests.

Essentially, this application takes a watch/source folder, a list of valid files to serve, and a tscw-relay web socket address. On startup, it connects to the relay server and prepares to serve the files in realtime as HTTP requests are made to the relay server.

For the simplicity of deployment to my sister and her co-workers, and to negate the need to install any software as administrator, pkg is used to create self-contained executables for Linux (my development platform) and Windows (the target platform).

Configuration

An example file, [config.example.json], is included. It is easiest to copy this and rename it to config.json. It needs to be in the same directory as the executable.

There are several config values required for this application to work.

Variable Type Description Example
watchDir string Full path to the folder to watch. This is where the statcrew files live. Note that backslashes need to be entered twice in order to escape the character. C:\\statcrew\\data\\
validFiles string[] Array of strings of file names that are allowed to be served through the proxy system. [ "bsb.xml", "fb.xml" ]
relayServer string The full URL to the public-facing relay server, including the ws:// protocol at the beginning. I will provide you this information. ws://myserver.com

Example

{
  "watchDir": "C:\\temp\\",
  "validFiles": [
    "bsb.xml",
    "fb.xml",
    "mbb.xml",
    "sb.xml",
    "soc.xml",
    "wbb.xml"
  ],
  "relayServer": "ws://myserver.com"
}

Deployment

If memory serves, StatCrew is running on an internal Windows 7 32-bit virtual machine. As such, builds must support 32 bit deployment.