Summit-Stats

GPX track analytics for hiking and trail running, measuring progress terrain by terrain, by slope.

Latest change: OWASP security audit and API hardening (login rate limiting, security headers, protected XML parsing)

Recruiter view

Activity detail in Summit-Stats: split of the route between ascent, flat and descent, breakdown by slope class, and elevation profile of the outing
See the screenshot at full size
Problem
Strava or Garmin Connect give overall statistics, not progress on a given terrain. Questions like "what is my climbing rate on slopes steeper than 25%?" or "am I faster trail running than hiking on moderate slopes?" go unanswered.
What was built
A full-stack web application, with a Laravel API on PostgreSQL and a Vue 3 interface. Each GPX track is analyzed, smoothed, cut into ascent, flat and descent segments across five slope classes, then 22 metrics are stored per outing. A dashboard builds progress indicators with filters by slope range and activity type.
Result
The application is in production, behind Traefik. It is single-user, so private in practice, and I have tested it on four outings over different terrains. V1 shipped in two days, in strict TDD, and three releases followed in three weeks.
Skills
PHP / Laravel, Vue.js, GPS data processing, Testing and CI/CD
Stack
PHP, Laravel, PostgreSQL, Vue 3, Chart.js, Leaflet, Playwright, Docker

Lead dev view

Summit-Stats started from a hiker's question: am I really getting better on steep climbs, or only on the flat? Sports apps answer with averages over the whole outing, which blend terrains together. I wanted figures slope by slope.

Architecture

Summit-Stats architecture: GPX track, parsing, altitude enrichment and smoothing, then segmentation by slope class, 22 metrics per outing in PostgreSQL, Laravel API and Vue 3 dashboard with charts and map

The Laravel backend analyzes each track through a chain of single-responsibility services, coordinated by an orchestrator: GPX reading, optional altitude enrichment through OpenTopoData, distance and elevation computations, cutting into typed segments, metric aggregation. Import progress is streamed live to the browser. The Vue 3 frontend shows the dashboard, the zoomable elevation profile with Chart.js and the OpenStreetMap map with Leaflet, synchronized on hover. Map tiles go through a proxy with a cache capped in size and duration.

Key decisions

A difficulty

The first two releases were tested in depth, but only with unit and feature tests, on in-memory SQLite. The first time the end-to-end tests ran on the full Docker stack, uploading a GPX track failed. No error message, no failing test anywhere else: everything passed, except in the real environment.

It took about twenty diagnostic commits to find the cause: storage directories created at startup, PHP-FPM process permissions, the upload API tested on its own before Playwright, PHP environment diagnostics in the CI. The culprit was the storage library's stream-based file write, which failed without any signal under PHP-FPM in the container. Writing the file in one go, from its content, fixed it.

This bug only existed in the real stack, out of reach of tests that ran from the command line on an in-memory database. That is exactly what the third tier of tests is meant to catch, and it is what made me gate every deploy on their success.

Quality

The backend is tested with Pest, the frontend with Vitest, and the complete flows with Playwright, each in its own GitHub Actions CI job. Coverage is tracked separately per part on Codecov, with a minimum threshold enforced on the backend; the README badges give the current figures. PHPStan, Pint and ESLint run before each commit and in CI. An audit against the OWASP Top 10 and ASVS led to hardening the API: login attempt limiting, token expiry, restricted CORS, security headers, GPX parsing protected against XML attacks, bounded inputs. Decisions are recorded in ADRs.

Timeline

What I would do differently

I would set up Docker and end-to-end tests from the start. Two whole releases were validated on an in-memory database, without the real server, and the first run on the real stack revealed a bug the entire test suite had let through. A production-like stack from V1 would have shown it the same day, instead of costing a day of diagnostics.

Architecture decisions (ADR)