Skip to content

reddiamond1234/project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Cycling Data Visualization

An interactive web application for visualizing cycling data from .fit files. This project was built for a university final project in Information Visualization.

Features

πŸš΄β€β™‚οΈ Interactive Website

  • Modern, responsive design with mouse and keyboard interactions
  • Drag & drop file upload for .fit files
  • Real-time data processing and visualization

πŸ“Š Multiple Views

  1. Upload Page - Drag & drop .fit file upload with progress indication
  2. Dashboard - Overview of ride statistics and summary metrics
  3. Analysis - Detailed charts for speed, heart rate, power, cadence, and altitude
  4. Comparison - Side-by-side comparison of multiple rides
  5. Timeline - Temporal analysis of cycling progress over time, including custom date range selection

⏰ Temporal Attributes

  • Ride creation dates and timestamps
  • Time-based filtering (week, month, year, custom range)
  • Progress tracking over time
  • Historical performance analysis

🎯 Interactive Tasks (5+ Complexities)

  1. Display ride statistics - Show number of rides, total distance, duration
  2. Interactive route visualization - Map-based route display with hover details
  3. Time-based filtering - Filter rides by different time periods or custom date range
  4. Performance comparison - Compare multiple rides side-by-side
  5. Metric analysis - Detailed charts for various cycling metrics
  6. Progress tracking - Visual progress bars and cumulative statistics

Technology Stack

  • Frontend: React 18 + TypeScript
  • Styling: Tailwind CSS
  • Charts: Recharts (D3.js based)
  • Icons: Lucide React
  • Build Tool: Vite
  • Routing: React Router DOM
  • Backend: Python (official Garmin FIT SDK, no framework)

Getting Started

Prerequisites

  • Node.js (v16 or higher)
  • npm or yarn
  • Python 3.9+

Installation

  1. Clone the repository:
git clone <repository-url>
cd cycling-data-viz
  1. Install frontend dependencies:
npm install
  1. (Optional) Create and activate a Python virtual environment:
python3 -m venv venv
source venv/bin/activate
  1. Install backend dependencies:
pip install -r requirements.txt

Running the Development Environment

You can start both the backend and frontend with a single shell script:

1. Create a script called dev.sh in the project root:

#!/bin/bash
# Start backend
source venv/bin/activate
python3 fit_parser_service_no_flask.py &
BACKEND_PID=$!
# Wait a bit for backend to start
sleep 2
# Start frontend
yarn install || npm install
npm run dev
# Kill backend on exit
kill $BACKEND_PID

2. Make it executable:

chmod +x dev.sh

3. Run the dev environment:

./dev.sh

Manual Start (if you prefer separate terminals)

  • In one terminal:
    source venv/bin/activate
    python3 fit_parser_service_no_flask.py
  • In another terminal:
    npm run dev

Building for Production

npm run build

Note: For production, you should use a production-ready Python web server (e.g., Gunicorn, uWSGI) and a proper process manager. The current backend is suitable for development and prototyping.

Usage

  1. Upload .fit Files: Drag and drop your .fit files onto the upload area or click to browse
  2. View Dashboard: See an overview of your latest ride with key metrics
  3. Analyze Data: Explore detailed charts for speed, heart rate, power, and more
  4. Compare Rides: Select multiple rides to compare performance metrics
  5. Track Progress: View your cycling timeline and progress over time, including custom date range selection

Data Visualization Features

Charts and Graphs

  • Line Charts: Time-series data for speed, heart rate, power, cadence, altitude
  • Bar Charts: Comparison charts for multiple rides
  • Progress Bars: Cumulative distance and performance tracking
  • Timeline Visualization: Chronological ride history with custom range

Interactive Elements

  • Hover Tooltips: Detailed information on data points
  • Zoom and Pan: Interactive chart navigation
  • Filter Controls: Time-based and metric-based filtering, custom date range
  • Responsive Design: Works on desktop, tablet, and mobile

Supported Data

The application can visualize the following data from .fit files:

  • GPS coordinates and route tracking
  • Speed (average and maximum, with 2 decimal precision)
  • Heart rate data
  • Power output (if available)
  • Cadence information
  • Elevation and altitude data
  • Ride duration and distance
  • Calories burned

Project Structure

src/
β”œβ”€β”€ components/          # Reusable UI components
β”‚   └── Navbar.tsx      # Navigation component
β”œβ”€β”€ pages/              # Main application pages
β”‚   β”œβ”€β”€ UploadPage.tsx  # File upload interface
β”‚   β”œβ”€β”€ Dashboard.tsx   # Overview dashboard
β”‚   β”œβ”€β”€ Analysis.tsx    # Detailed analysis charts
β”‚   β”œβ”€β”€ Comparison.tsx  # Ride comparison tools
β”‚   └── Timeline.tsx    # Temporal analysis (with custom range)
β”œβ”€β”€ types/              # TypeScript type definitions
β”‚   └── RideData.ts     # Ride data interfaces
β”œβ”€β”€ utils/              # Utility functions
β”‚   └── fitParser.ts    # .fit file parsing logic
β”œβ”€β”€ App.tsx             # Main application component
β”œβ”€β”€ main.tsx            # Application entry point
└── index.css           # Global styles

Production Readiness

  • βœ… Frontend: Production build with npm run build (Vite/React/TypeScript, fully typed)
  • βœ… Backend: Official Garmin FIT SDK, robust error handling, CORS, JSON sanitization
  • βœ… Data: Real .fit file parsing, no mock data, all metrics validated
  • βœ… UI/UX: Responsive, accessible, modern design
  • βœ… Testing: Manual testing with real .fit files
  • ⚠️ Note: For true production, use a WSGI server (e.g., Gunicorn) for the backend and serve the frontend with a static file server or CDN. The current backend is suitable for development and prototyping.

Academic Requirements Met

βœ… Interactive Website: Full mouse/keyboard interaction support βœ… Multiple Views: 5 distinct pages with different visualizations βœ… Temporal Attributes: Date-based analysis and timeline features (including custom range) βœ… 5+ Interactive Tasks: Various complexity levels from basic stats to advanced comparisons βœ… Modern UI/UX: Professional design with responsive layout

Future Enhancements

  • Map integration with Leaflet for route visualization
  • Export functionality for charts and data
  • Social sharing features
  • Advanced analytics and insights
  • Mobile app version

License

This project is created for educational purposes as part of a university final project.

Contributing

This is a final project submission. For educational purposes only.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks