$ show yihong0618/running_page
A full-stack personal running activity dashboard that syncs workout data from over a dozen platforms (Strava, Garmin, Nike, Keep, Coros, etc.) via Python scripts, stores it in SQLite, and renders interactive web visualizations (React + Mapbox) and SVG posters (grid, heatmap, year summaries). It also includes a terminal UI (Textual) and an optional AI-powered share image generator. The architecture is a hybrid monolith: a shared SQLite database backs both the frontend (exported as JSON) and SVG generation. The frontend is themeable with two built-in themes (classic, dashboard). While the sync scripts are tightly coupled to each provider's API, the SVG poster drawer library and the terminal UI's data aggregation layer are well-isolated and potentially reusable. The project is actively maintained with frequent commits, CI/CD pipelines, and Docker support, though it carries moderate technical drift due to many unpinned dependencies and reliance on third-party APIs that may change.
The LLM identified 4 files worth highlighting for reuse:
A `Track` class that parses GPX, TCX, and FIT files into a unified data structure with polylines, heart rate, elevation, and moving time. It encapsulates file reading, coordinate extraction, and timezone handling. This can be extracted as a standalone library for any project needing to read diverse fitness file formats.
Abstract base class `TracksDrawer` defining the interface for SVG poster drawers. Concrete implementations (GridDrawer, GithubDrawer, CircularDrawer, MonthOfLifeDrawer, YearSummaryDrawer) each produce a distinct visual style. The pattern is cleanly separated from data loading and rendering, making it easy to extend or port to other vector formats.
A `RouteAnimator` class that smoothly animates the drawing of a polyline on a Mapbox map, chunk-by-chunk, using requestAnimationFrame and Promise-based delays. It handles start/end markers and dynamic speed control. This is a self-contained utility that could be reused in any map-based project needing route playback or progressive path rendering.
A React error boundary component with a retry button and configurable fallback UI. It catches rendering errors, logs them, and allows the user to attempt recovery. This is a standalone component that can be dropped into any React application for robust error handling.