2025-10-12 06:41:17 -07:00
2025-10-12 06:38:44 -07:00
2025-10-12 06:38:44 -07:00
2025-10-12 06:38:44 -07:00
2025-10-12 06:38:44 -07:00
2025-10-12 06:38:44 -07:00
2025-10-12 06:38:44 -07:00
2025-10-12 06:38:44 -07:00
2025-10-12 06:38:44 -07:00
2025-10-12 06:38:44 -07:00
2025-10-12 06:38:44 -07:00
2025-10-12 06:38:44 -07:00
2025-10-12 06:38:44 -07:00

FitTrack Report Generator

FitTrack Report Generator is a FastAPI application for analyzing workout files. It provides a REST API for analyzing single or multiple workout files (FIT, TCX, GPX) and generating comprehensive reports and charts.

Features

  • Workout File Parsing: Supports FIT, TCX, and GPX file formats.
  • Comprehensive Analysis: Analyzes power, heart rate, speed, and elevation data.
  • Report Generation: Generates summary reports and charts.
  • REST API: Provides endpoints for single and batch workout analysis.

Technologies Used

  • Backend: Python 3.11, FastAPI
  • Data Analysis: pandas, numpy, scipy
  • File Parsing: fitparse, tcxparser, gpxpy
  • Chart Generation: matplotlib
  • Database: PostgreSQL
  • Testing: pytest

Project Structure

src/
├── core/
│   ├── batch_processor.py
│   ├── chart_generator.py
│   ├── file_parser.py
│   ├── logger.py
│   ├── report_generator.py
│   ├── workout_analyzer.py
│   └── workout_data.py
├── db/
│   ├── models.py
│   └── session.py
└── utils/
    └── zone_calculator.py

api/
├── routers/
│   └── analysis.py
├── main.py
└── schemas.py

tests/
├── unit/
├── integration/
├── contract/
└── performance/

Getting Started

Prerequisites

  • Python 3.11
  • Docker

Installation

  1. Clone the repository:
    git clone https://github.com/your-username/FitTrack_ReportGenerator.git
    
  2. Install the dependencies:
    pip install -r requirements.txt
    

Running the Application

  1. Start the application using Docker:
    docker-compose up -d --build
    
  2. The API will be available at http://localhost:8000.

API Usage

Analyze a Single Workout File

  • Endpoint: POST /api/analyze/workout
  • Request:
    curl -X POST \
      -H "Content-Type: multipart/form-data" \
      -F "file=@/path/to/your/workout.fit" \
      -F "user_id=a1b2c3d4-e5f6-7890-1234-567890abcdef" \
      -F "ftp_value=250" \
      http://localhost:8000/api/analyze/workout
    

Analyze Multiple Workout Files (Batch)

  • Endpoint: POST /api/analyze/batch
  • Request:
    curl -X POST \
      -H "Content-Type: multipart/form-data" \
      -F "zip_file=@/path/to/your/workouts.zip" \
      -F "user_id=a1b2c3d4-e5f6-7890-1234-567890abcdef" \
      http://localhost:8000/api/analyze/batch
    

Retrieve Charts for an Analysis

  • Endpoint: GET /api/analysis/{analysis_id}/charts
  • Request:
    curl -X GET http://localhost:8000/api/analysis/{analysis_id}/charts?chart_type=power_curve
    

Retrieve Analysis Summary

  • Endpoint: GET /api/analysis/{analysis_id}/summary
  • Request:
    curl -X GET http://localhost:8000/api/analysis/{analysis_id}/summary
    
Description
No description provided
Readme 656 KiB
Languages
Python 97%
HTML 2.7%
Dockerfile 0.3%