Skip to content

gitjpk/strydash

Repository files navigation

StryDash

A modern Next.js dashboard to visualize your Stryd running activities from a SQLite database.

Next.js React TypeScript License

✨ Features

πŸƒ Activity Management

  • Activity List - Browse all your activities with key statistics (distance, duration, pace, power, heart rate)
  • Detailed View - Complete activity breakdown with all metrics and statistics
  • Filtering - Multi-select filter by activity type (easy, tempo, interval, etc.)
  • Tag-based Filtering - Click on tags to filter activities
  • Calendar View - Weekly calendar showing activities with navigation for multiple activities per day

πŸ“Š Data Visualization

  • Interactive Charts - Time series visualization for power, heart rate, speed, cadence, stride length, and elevation
  • Power Zones - Visual power zone distribution
  • Lap/Split Filtering - Zoom into specific segments of your activity
  • GPS Route Display - View your route on an interactive map with power-based color gradient

πŸ€– StrAId - AI Assistant

  • Intelligent Chat - Ask questions about your training data and get insights
  • Context-Aware - AI understands your activity history and provides personalized advice
  • Powered by Ollama - Local LLM integration (Mistral) for privacy-focused AI interactions
  • Training Analysis - Get recommendations, analyze patterns, and understand your performance

πŸ“ˆ Trends & Analytics

  • Performance Trends - Visualize your progress over time
  • Statistics Dashboard - Key metrics and performance indicators
  • Historical Comparison - Track improvements and identify patterns

πŸ—ΊοΈ Maps

  • Dual Map Providers - Choose between OpenStreetMap (Leaflet) or MapLibre GL JS
  • Power Gradient - Route colored by power output (green β†’ yellow β†’ red)
  • Start/Finish Markers - Clear visual indicators for route beginning and end

🌐 Internationalization

  • Multi-language Support - Full English and French translations
  • Easy Language Switching - Change language from settings page

🎨 Customization

  • Dark Mode - Toggle between light and dark themes
  • Responsive Design - Optimized for desktop and mobile devices
  • Modern UI - Clean, gradient-based design with smooth animations

πŸ› οΈ Technologies

πŸ“¦ Installation

  1. Clone the repository
git clone <repository-url>
cd strydash
  1. Install dependencies
pnpm install
  1. Setup Ollama (optional, for AI features)

    • Install Ollama
    • Pull the Mistral model: ollama pull mistral
    • Ensure Ollama is running: ollama serve
  2. Ensure the database file is present

    • Place your stryd_activities.db file in the project root
  3. Start the development server

pnpm dev
  1. Open your browser

πŸ—„οΈ Database Schema

The project expects the following SQLite tables:

  • activities - General activity information (name, date, distance, duration, type, tags, etc.)
  • gps_data - GPS coordinates with timestamps and power values
  • timeseries_power - Power data over time
  • timeseries_cardio - Heart rate data
  • timeseries_kinematics - Speed, cadence, stride length
  • timeseries_elevation - Elevation data
  • laps - Activity splits/laps

πŸ“ Project Structure

strydash/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ activities/[id]/
β”‚   β”‚   └── page.tsx           # Activity detail page
β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”œβ”€β”€ chat/
β”‚   β”‚   β”‚   └── route.ts       # AI chat API endpoint
β”‚   β”‚   └── models/
β”‚   β”‚       └── route.ts       # Ollama models API endpoint
β”‚   β”œβ”€β”€ calendar/
β”‚   β”‚   └── page.tsx           # Calendar view page
β”‚   β”œβ”€β”€ overview/
β”‚   β”‚   └── page.tsx           # Overview/dashboard page
β”‚   β”œβ”€β”€ settings/
β”‚   β”‚   └── page.tsx           # Settings page
β”‚   β”œβ”€β”€ straid/
β”‚   β”‚   └── page.tsx           # StrAId AI assistant page
β”‚   β”œβ”€β”€ trends/
β”‚   β”‚   └── page.tsx           # Trends and analytics page
β”‚   β”œβ”€β”€ layout.tsx             # Root layout with theme provider
β”‚   β”œβ”€β”€ page.tsx               # Home page (activity list)
β”‚   └── globals.css            # Global styles
β”‚
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ ActivityDetailClient.tsx  # Client-side activity detail
β”‚   β”œβ”€β”€ ActivityList.tsx          # Activity list with stats
β”‚   β”œβ”€β”€ CalendarClient.tsx        # Weekly calendar view
β”‚   β”œβ”€β”€ ChatButton.tsx            # AI chat interface button
β”‚   β”œβ”€β”€ FilterBar.tsx             # Activity filtering UI
β”‚   β”œβ”€β”€ HomeClient.tsx            # Home page client wrapper
β”‚   β”œβ”€β”€ MapLibreMap.tsx           # MapLibre GL JS implementation
β”‚   β”œβ”€β”€ PowerZones.tsx            # Power zone visualization
β”‚   β”œβ”€β”€ PreferencesProvider.tsx   # User preferences context
β”‚   β”œβ”€β”€ RouteMap.tsx              # GPS route display
β”‚   β”œβ”€β”€ Sidebar.tsx               # Navigation sidebar
β”‚   β”œβ”€β”€ TimeseriesChart.tsx       # Interactive time series chart
β”‚   └── TrendsClient.tsx          # Trends page client component
β”‚
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ db.ts                  # SQLite database functions
β”‚   β”œβ”€β”€ preferences.ts         # User preferences management
β”‚   └── translations.ts        # i18n translations (EN/FR)
β”‚
β”œβ”€β”€ stryd_activities.db        # SQLite database (not in repo)
└── package.json               # Project dependencies

🎯 Usage

Activity List

  • View all activities with key metrics
  • Use the Select Type dropdown to filter by activity type (multiple selection)
  • Click on tags to add them to filters
  • Click on any activity card to view details

Activity Detail

  • Complete statistics breakdown
  • Interactive time series chart with metric selection
  • Power zone distribution
  • GPS route with power gradient coloring
  • Filter by laps/splits to focus on specific segments

Calendar View

  • Weekly layout (Monday to Sunday)
  • Activities displayed per day with name, type, distance, and duration
  • Weekly summary showing total distance and time
  • Navigate between multiple activities on the same day

Settings

  • Language - Switch between English and French
  • Theme - Toggle between light and dark mode
  • Map Provider - Choose between Leaflet (OpenStreetMap) or MapLibre GL JS

StrAId (AI Assistant)

  • Ask questions about your training in natural language
  • Get personalized insights and recommendations
  • Analyze patterns in your activity data
  • Requires Ollama with Mistral model installed and running

Trends

  • View performance trends over time
  • Analyze training load and progression
  • Track key metrics evolution

πŸš€ Build for Production

# Create optimized production build
pnpm build

# Start production server
pnpm start

βš™οΈ Configuration

User Preferences

Preferences are stored in localStorage and include:

  • Language (en | fr)
  • Theme (light | dark)
  • Map Provider (leaflet | maplibre)

Environment

The application uses Node.js with Corepack enabled. Ensure your PATH includes:

export PATH="/usr/share/nodejs/corepack/shims:$PATH"

πŸ“ License

MIT

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.


Note: This project requires a Stryd activities database (stryd_activities.db). The database structure should match the schema described above.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages