Skip to content

anviaan/mc-telemetry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telemetry API

Description

This project is a Flask-based API for managing telemetry data of game mods. It allows you to create mods, receive telemetry data, and retrieve statistics about mod and game version usage.

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd <repository-directory>
  2. Create a virtual environment and activate it:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install the required packages:

    pip install -r requirements.txt
  4. Create a .env file and set the PASSWORD environment variable:

    echo "PASSWORD=your_password" > .env
  5. Run the application:

    python app.py

Usage

The API provides the following endpoints:

Check API Status

  • URL: /telemetry/health
  • Method: GET

Get All Mods

  • URL: /telemetry/mods
  • Method: GET

Create a Mod

  • URL: /telemetry/mods
  • Method: POST
  • Body:
    {
        "password": "your_password",
        "mod_id": "mod123",
        "mod_name": "Example Mod"
    }
  • Response:
    {
        "message": "Mod created successfully"
    }

Receive Telemetry Data

  • URL: /telemetry/data
  • Method: POST
  • Body:
    {
        "mod_id": "mod123",
        "game_version": "1.0",
        "mod_version": "1.0",
        "loader": "Forge"
    }
  • Response:
    {
        "message": "Data saved successfully"
    }

Export Telemetry Data to CSV

  • URL: /telemetry/export/csv
  • Method: GET
  • Query Parameters: password
  • Response: CSV file download

License

This project is licensed under the GPL-3.0 License. See the LICENSE file for more information.