Skip to content

peclarke/np3

Repository files navigation

Neptunes Analytics 3

This app is purely an ETL Pipeline for storing timeseries data from a Neptune's Pride game. However, there is an optional extension for smart summaries and an alexa integration within the /ui directory

Features:

  • Queries the Neptune's Pride API and stores the data with DuckDB into an in-memory database
  • Creates useful views along with timestamped records in the table for long term analytics
  • AI Summaries with OpenAI (optional)

Screenshots / Examples

Example of the UI interface used to query data from one of the views: all_techs

image

Example of privileged data (contains data only obtainable from owner's API key) from stars view

image

Example of specific star view

image
  • Shows aggregate data on fleets that have been sent to this star (average ships, number of fleets sent per player)
  • Renders out essential star information graphically
  • Page accessible from all star tabulated data

Example API Output from an AI Generated Summary

{
  "view": "all_techs",
  "generated_at": "2026-01-12T17:04:05.639941",
  "summary": "The Announcer has been surpassed in Range technology by AssBandit, Jumbo Papa, and Sentient Specks of Dust. Each of these players is only one level ahead in this technology. AssBandit and Jumbo Papa are both members of the Gambling Coalition and friends, so there may be potential for trading with them. Sentient Specks of Dust is an enemy and should be treated cautiously. No technology shows a difference of two or more levels. Overall, The Announcer is only slightly behind in technology compared to these players.",
  "query_hours": null
}

Examples of Asking Alexa for Information:

  1. Alexa, open Neptune's Analytics and give me the tech update
  2. Alexa, open Neptune's Analytics and find players attacking me

How To Setup (ETL Pipeline)

  1. Clone the repository to a location where it won't be deleted for at least a month or two
  2. Create your own .env file. That includes getting an API key from Neptune's Pride (check options)
  3. Create a python virtual environment and install the requirements
  4. Configure the script.sh to have the correct paths to where your app is stored
  5. Setup a cronjob (if you're on unix, I recommend crontab) to run the script however often you want. I recommend 1 minute after after the hour passes
    • You will need to do this for both the ETL pipeline and the summary script if you want AI summaries.
    • An example of my crontab can be found below:
1 * * * * /root/np3/script.sh >> /var/log/np3-cron.log 2>&1
4 * * * * /root/np3/summary.sh >> /var/log/np3-summary.log 2>&1

Note: It's import to append the output of these scripts to a log file in case something breaks

AI Summaries (Optional)

More information can be found in the /ui folder. If you want to start running the API now and encounter issues later, start by running uvicorn api:app --reload after sourcing your environment. Good luck

How To Setup Locally (API/UI Viewer)

  1. Make sure you have your python environment activated (if you want to run locally)
  2. Run uvicorn api:ui --reload
  3. Go to /static and copy the example config file into config.json for proper user mappings on summaries

With Regards to Docker/Compose

A lot of the docker stuff is currently configured to work with my server. I've created a shared network that this app another uses at the same time. If you want to just use it normally, you can remove the external parameter in the network and change the port from 8000 to 80.

About

ETL pipeline for storing timeseries data, API data viewer, and Amazon Echo skill for integration with the online strategy game Neptune's Pride

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages