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.
- 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
- 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
- Node.js (v18.0.0 or higher)
- npm or yarn
- An OpenRouteService API key (required for route generation)
- Clone the repository:
git clone https://github.com/yourusername/fartlek-ai.git
cd fartlek-ai- Install dependencies:
npm install
# or
yarn install- Create a
.envfile in the root directory with your OpenRouteService API key (optional):
VITE_ORS_API_KEY=your_api_key_here
Start the development server:
npm run dev
# or
yarn devOpen your browser and navigate to http://localhost:3000.
Build the application for production:
npm run build
# or
yarn buildThe build output will be in the dist directory.
- Navigate to the "Upload GPX" page
- (Optional) Adjust Fartlek settings like interval durations and repetitions
- Drag and drop your GPX file or click to browse
- View the processed route with Fartlek segments on the map
- Download the modified GPX file with Fartlek segments
- Navigate to the "Find a Route" page
- Allow location access when prompted
- Enter your OpenRouteService API key
- Set your desired route distance
- Click "Generate Route"
- View the generated route with Fartlek segments
- Download the GPX file for use in your running app
- 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
- Create a new site on Netlify
- Connect to your GitHub repository
- Set the build command to
npm run buildoryarn build - Set the publish directory to
dist - (Optional) Configure environment variables for your API keys
- Install the Vercel CLI:
npm install -g vercel - Login to Vercel:
vercel login - Deploy the app:
vercel - For production deployment:
vercel --prod
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add some amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenRouteService for the route generation API
- Leaflet for the interactive maps
- toGeoJSON for GPX parsing
- togpx for GeoJSON to GPX conversion
- Turf.js for geospatial analysis
