-
Notifications
You must be signed in to change notification settings - Fork 0
Home
The hashmarks app consists of 3 main components: a React app, GraphQL API, and PostgreSQL database; it also has a number of utilities to support these components.
The following diagram describes the general system:
The client side React app's primary function is to display visualizations for individual player data. The app has a home page consisting of a player search input and pages for each individual player. The player pages display some general player data along with a rink visualization that displays different event data.
The GraphQL API centralizes data requests into a single endpoint by providing access to data from both the public NHL API, and the PostgreSQL database. The API itself is written in Python and extends an existing FastAPI app that forwards REST queries to the NHL API.
The database is used to store data that cannot not be easily requested via the public NHL API, i.e., arena-adjusted coordinates, time analysis data. However, It is tailored specifically to allow access to player events without querying every game endpoint.
The database follows the schema seen below:
Note: Foreign keys listed in this diagram without a relation/line are assumed to be keys from the public NHL API.
The DB update service is systemd service that is scheduled to run a Python script once every 24 hours. The script pulls all the data since the last update time, formats it, then updates the database with the new data.