Skip to content

MichelangeloAM/FartlekAI

Repository files navigation

FartlekAI - Smart Running Interval Generator

FartlekAI is a web application that helps runners create structured Fartlek workouts by automatically dividing GPX routes into alternating "fast" and "easy" segments. You can either upload your own GPX files or generate new routes based on your location.

FartlekAI Screenshot

Features

  • GPX File Upload & Processing: Upload your existing GPX files and convert them to Fartlek workouts
  • Automatic Interval Creation: Divide routes into alternating "fast" and "easy" segments based on customizable settings
  • Visual Route Preview: View your route on an interactive map with color-coded segments
  • Route Generation: Find new running routes in your area using OpenRouteService API
  • GPX Download: Export your Fartlek workouts as GPX files for use in your favorite running app or device
  • Responsive Design: Works on desktop and mobile devices
  • Dark Mode Support: Toggle between light and dark themes

Tech Stack

  • Frontend: React with TypeScript
  • Routing: React Router
  • State Management: Zustand
  • Styling: Tailwind CSS
  • Map: Leaflet with React-Leaflet
  • GPX Processing: togeojson, togpx, turf.js
  • API Integration: OpenRouteService
  • Build Tool: Vite

Getting Started

Prerequisites

  • Node.js (v18.0.0 or higher)
  • npm or yarn
  • An OpenRouteService API key (required for route generation)

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/fartlek-ai.git
cd fartlek-ai
  1. Install dependencies:
npm install
# or
yarn install
  1. Create a .env file in the root directory with your OpenRouteService API key (optional):
VITE_ORS_API_KEY=your_api_key_here

Development

Start the development server:

npm run dev
# or
yarn dev

Open your browser and navigate to http://localhost:3000.

Building for Production

Build the application for production:

npm run build
# or
yarn build

The build output will be in the dist directory.

Usage Guide

Uploading a GPX File

  1. Navigate to the "Upload GPX" page
  2. (Optional) Adjust Fartlek settings like interval durations and repetitions
  3. Drag and drop your GPX file or click to browse
  4. View the processed route with Fartlek segments on the map
  5. Download the modified GPX file with Fartlek segments

Finding a New Route

  1. Navigate to the "Find a Route" page
  2. Allow location access when prompted
  3. Enter your OpenRouteService API key
  4. Set your desired route distance
  5. Click "Generate Route"
  6. View the generated route with Fartlek segments
  7. Download the GPX file for use in your running app

Customizing Fartlek Settings

  • Fast Interval: Duration of high-intensity segments (30s-5min)
  • Easy Interval: Duration of recovery segments (30s-5min)
  • Auto Repetitions: Automatically calculate the number of intervals based on route length
  • Warmup/Cooldown: Set durations for the beginning and end of your workout
  • Preferred Distance: Default distance for generated routes

Deployment

Deploying to Netlify

  1. Create a new site on Netlify
  2. Connect to your GitHub repository
  3. Set the build command to npm run build or yarn build
  4. Set the publish directory to dist
  5. (Optional) Configure environment variables for your API keys

Deploying to Vercel

  1. Install the Vercel CLI: npm install -g vercel
  2. Login to Vercel: vercel login
  3. Deploy the app: vercel
  4. For production deployment: vercel --prod

Contributing

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

  1. Fork the repository
  2. Create your feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add some amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages