A modern, browser-based GPS track visualization tool that supports GPX, TCX, and FIT files. StrataLines allows you to upload, visualize, and analyze multiple GPS tracks on an interactive map with customizable styling and export capabilities.
- Multiple Format Support: Import GPX, TCX, and FIT files
- Compressed File Support: Automatically handles gzipped files (
.gpx.gz,.tcx.gz,.fit.gz) - Interactive Map: Pan, zoom, and explore your tracks on multiple tile layer options
- Track Management: Toggle visibility, rename, and delete tracks
- Custom Styling: Adjust colors, line thickness, and visual properties
- Export Functionality: Export tracks as GPX files or map screenshots
- Persistent Storage: Tracks are saved in IndexedDB for offline access
- Comprehensive Testing: 70%+ code coverage with automated tests
StrataLines uses a modern build-first architecture:
- TypeScript: Strict type checking with full compilation
- Vite: Fast, optimized bundling for production
- Tree-shaking: Only includes code that's actually used
- Code splitting: Optimized chunk sizes for faster loading
- Vitest: Fast, modern testing framework with watch mode
- Coverage Reports: Automated code coverage analysis (70%+ coverage)
- Unit Tests: Comprehensive test suites for all core modules
- CI/CD Ready: Automated testing in GitHub Actions
- Cloudflare Pages: Optimized for global CDN distribution
- Static Build: No server-side rendering required
- Progressive Enhancement: Works offline after initial load
- Node.js 20+ (or 22.x)
- npm or yarn
# Clone the repository
git clone <your-repo-url>
cd strata-lines
# Install dependencies
npm install# Start development server with hot reload
npm run dev
# The app will be available at http://localhost:5173# Run tests once
npm test
# Run tests in watch mode
npm run test:watch
# Generate coverage report
npm run test:coverage
# Open coverage report UI
npm run test:ui# Type check and build
npm run build
# Preview production build locally
npm run previewstrata-lines/
├── components/ # React components
│ ├── ControlsPanel.tsx
│ ├── MapComponent.tsx
│ └── DraggableBoundsBox.tsx
├── services/ # Core business logic
│ ├── db.ts # IndexedDB operations
│ ├── gpxProcessor.ts # File parsing (GPX/TCX/FIT)
│ ├── gpxGenerator.ts # GPX export
│ └── utils.ts # Utility functions
├── tests/ # Test suites
│ ├── setup.ts # Test configuration
│ ├── db.test.ts
│ ├── gpxProcessor.test.ts
│ ├── gpxGenerator.test.ts
│ └── utils.test.ts
├── types.ts # TypeScript type definitions
├── constants.ts # App constants
├── App.tsx # Main application component
├── index.tsx # Application entry point
├── index.html # HTML template
├── vite.config.ts # Vite build configuration
├── vitest.config.ts # Vitest test configuration
├── tsconfig.json # TypeScript configuration
├── wrangler.toml # Cloudflare Pages configuration
└── public/ # Static assets
└── _headers # Security headers
Handles parsing of multiple GPS file formats:
- GPX: Standard GPS exchange format
- TCX: Garmin Training Center XML
- FIT: Garmin FIT binary format
- Compressed files: Automatic gzip decompression
Color manipulation and geographic calculations:
- Hex/RGB/HSV color conversions
- Random color generation
- Track bounds calculation
Exports tracks to standard GPX format with proper XML structure and CDATA escaping.
IndexedDB operations for persistent track storage:
- Add/delete tracks
- Retrieve all tracks
- Clear database
The project includes comprehensive test coverage:
- Unit Tests: All core modules have dedicated test suites
- Integration Tests: File processing workflows
- Mock Data: Realistic test fixtures for GPX, TCX formats
- Coverage Thresholds: Minimum 70% coverage enforced
Run tests with coverage:
npm run test:coverageView the HTML coverage report:
open coverage/index.htmlThe project is configured for Cloudflare Pages deployment:
- Build Command:
npm run build - Build Output Directory:
dist - Node Version: 18+
The wrangler.toml file contains the configuration.
# Build the project
npm run build
# The dist/ folder contains the deployable assets
# Upload to any static hosting service- Chrome/Edge 90+
- Firefox 88+
- Safari 14+
Requires support for:
- ES2022
- IndexedDB
- File API
- Web Workers
- Initial Load: ~275KB gzipped JavaScript
- Offline Support: IndexedDB for track storage
- Lazy Loading: Components loaded on demand
- Tree Shaking: Unused code automatically removed
- Content Security Policy headers
- XSS protection
- No inline scripts
- Secure cookie handling
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass:
npm test - Submit a pull request
Changes to React components, styles, and most TypeScript files will hot reload without losing state.
Run TypeScript type checking without building:
npm run type-checkUse the Vitest UI for interactive debugging:
npm run test:uiAim for 70%+ coverage on new code. The CI will fail if coverage drops below thresholds.
This project is licensed under the MIT License.
- Leaflet - Interactive map library
- React Leaflet - React components for Leaflet
- Vite - Next-generation frontend tooling
- Vitest - Blazing fast unit test framework
