{"id":48926993,"url":"https://github.com/pokle/glidecomp","last_synced_at":"2026-04-17T07:04:36.042Z","repository":{"id":341369950,"uuid":"1131427209","full_name":"pokle/glidecomp","owner":"pokle","description":"Hang Gliding and Paragliding competition task score and flight analysis","archived":false,"fork":false,"pushed_at":"2026-04-10T12:37:14.000Z","size":21951,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-10T13:29:19.577Z","etag":null,"topics":["flight","gliding","hanggliding","map","paragliding"],"latest_commit_sha":null,"homepage":"https://glidecomp.com/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pokle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-10T01:54:36.000Z","updated_at":"2026-04-10T12:21:37.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pokle/glidecomp","commit_stats":null,"previous_names":["pokle/taskscore"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/pokle/glidecomp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pokle%2Fglidecomp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pokle%2Fglidecomp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pokle%2Fglidecomp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pokle%2Fglidecomp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pokle","download_url":"https://codeload.github.com/pokle/glidecomp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pokle%2Fglidecomp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31918841,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flight","gliding","hanggliding","map","paragliding"],"created_at":"2026-04-17T07:04:35.573Z","updated_at":"2026-04-17T07:04:36.017Z","avatar_url":"https://github.com/pokle.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"web/frontend/public/icon.svg\" alt=\"GlideComp logo\" width=\"32\" height=\"32\" /\u003e GlideComp\n\n**GlideComp** is a web application for analyzing hanggliding and paragliding competition flights.\n\n**What it does:**\n- Pilots (or competition organizers) load IGC track log files and XCTask task files in the browser\n- The app analyzes flights: task completion, scoring explanations, glide performance, thermal/climb analysis\n- Full **CIVL GAP scoring** implementation (FAI Sporting Code Section 7F) — distance, time, leading, and arrival points for both PG and HG\n- Includes 2D (Mapbox) and 3D (Three.js globe) map visualization of flight tracks\n- Competition management features: pilot registration, task setup, scoring, penalties, with a full audit log for transparency\n\n**How it's built:**\n- **Client-side first** — IGC parsing and flight analysis happen entirely in the browser, no server required for core functionality\n- **Frontend**: TypeScript SPA hosted on Cloudflare Pages, using Basecoat UI components and Tailwind CSS\n- **Backend**: Cloudflare Workers API for competition management, with D1 (SQLite) database and R2 storage\n- **Engine**: A dedicated `@glidecomp/engine` package handles geo calculations (WGS84 ellipsoid math, Vincenty formulas) and flight analysis\n\n**Key design principles:**\n- No server-side storage needed for basic use — drag-and-drop files and analyze locally\n- All scoring decisions are explainable and auditable\n- Every mutation affecting competition scores is audit-logged\n\nThe app is live at **[glidecomp.com](https://glidecomp.com)**.\n\n### Features\n\n- **Flight event detection** — automatic detection of takeoff, landing, thermals, glides, start/goal crossings, and turnpoint tagging\n- **Thermal analysis** — entry/exit times, altitude gain, average climb rate\n- **Glide analysis** — distance, altitude lost, L/D ratio, plus sink detection for poor glides\n- **GAP scoring** — CIVL GAP scoring with distance, time, leading, and arrival points\n- **Competition management** — create competitions, register pilots, upload IGC tracks, manage tasks, apply penalties, with full audit logging\n- **Authentication** — Google OAuth login with user profiles\n- **Task editor** — create and edit tasks with drag-to-reorder turnpoints, waypoint database search, and click-on-map placement\n- **Multiple data sources** — drag \u0026 drop IGC/XCTSK files, import from XContest by task code, or import from AirScore by URL\n- **Interactive map** — 2D (Mapbox/Leaflet) and 3D views with track overlay, task cylinders, and map annotations\n- **Altitude sparkline** — clickable time-series chart linked to events and map position\n- **Theme editor** — customizable UI themes with color and font controls, import/export support\n- **Configurable units \u0026 detection** — speed, altitude, distance, climb rate units; adjustable thermal/glide detection thresholds\n\n## Web Development\n\n### Prerequisites\n\n- [Bun](https://bun.sh/) (also requires Node.js 20+)\n- A [MapBox](https://www.mapbox.com/) access token (for the map). If your token has URL restrictions, ensure `glidecomp.com` and `localhost:3000` are in the allowed URLs list.\n\n### Setup\n\n```bash\nbun install\n\n# Copy .env.example and add your MapBox token\ncp .env.example .env\n# Edit .env and set VITE_MAPBOX_TOKEN=your_token_here\n```\n\n### Running locally (Docker)\n\nThe easiest way to start everything. Only the frontend port is exposed:\n\n```bash\ndocker compose up --build\n```\n\nTo run multiple worktrees side-by-side, override the port:\n\n```bash\nPORT=3001 docker compose up --build\n```\n\n### Running locally (native)\n\nStart the frontend and all API workers together:\n\n```bash\nbun run dev\n```\n\nThis starts three services:\n- **Frontend** — Vite dev server at http://localhost:3000\n- **Auth API** — authentication worker at http://localhost:8788\n- **Competition API** — competition management worker at http://localhost:8789\n\nThe auth worker requires a `.dev.vars` file in `web/workers/auth-api/` — see [docs/auth.md](docs/auth.md) for setup.\n\nTo start only the frontend (without any workers):\n\n```bash\nbun run dev:frontend\n```\n\nTo use AirScore features, also start the AirScore API worker (http://localhost:8787) in a separate terminal:\n\n```bash\nbun run --filter airscore-api dev\n```\n\nThe frontend automatically detects the local worker. If you'd rather skip the worker and use the production API instead:\n\n```bash\nVITE_AIRSCORE_URL=https://glidecomp.com/api/airscore bun run dev\n```\n\n### Tests and type checking\n\n```bash\nbun run test             # Run unit tests (engine + airscore worker) and type check\nbun run test:comp        # Run competition API tests\nbun run test:all         # Run all unit tests\nbun run test:e2e         # Run Playwright end-to-end tests\nbun run typecheck        # Type check root project\nbun run typecheck:all    # Type check everything (frontend + engine + workers)\n```\n\n### Chrome MCP server set up\n\nRead https://developer.chrome.com/blog/chrome-devtools-mcp-debug-your-browser-session\n\n### GlideComp MCP server\n\nGlideComp exposes an MCP server at `https://glidecomp.com/mcp` so AI agents can manage competitions, tasks, pilots, tracks, and scores. See [docs/mcp.md](docs/mcp.md) for setup and available tools.\n\n### Deployment\n\n- Push to `master` → deploys to production\n- Push to other branches → deploys to preview URL\n\n```bash\nbun run deploy           # Manual deploy to Cloudflare Pages\nbun run deploy:worker    # Manual deploy AirScore API Worker\nbun run deploy:comp      # Manual deploy Competition API Worker\nbun run deploy:auth      # Manual deploy Auth API Worker\nbun run deploy:all       # Deploy Pages + all Workers\n```\n\n**URLs:**\n- Production: https://glidecomp.com\n- Previews: https://{branch}.glidecomp.pages.dev\n\n### CLI Scripts\n\n**detect-events** - Detect flight events from an IGC file, outputting CSV:\n\n```bash\nbun run detect-events -- \u003cflight.igc\u003e [task.xctsk]\n\n# Example with sample data\nbun run detect-events -- \\\n  web/frontend/public/data/tracks/2025-01-05-Tushar-Corryong.igc \\\n  web/frontend/public/data/tasks/buje.xctsk\n```\n\n**get-xcontest-task** - Download a task from XContest by code:\n\n```bash\nbun run get-xcontest-task -- face\nbun run get-xcontest-task -- --file task.json\n```\n\n**score-task** - Score multiple pilots against a task using CIVL GAP (FAI Sporting Code Section 7F):\n\n```bash\nbun run score-task \u003ctask.xctsk\u003e \u003cigc-file-or-folder\u003e... [options]\n\n# Options:\n#   --scoring \u003cPG|HG\u003e         Sport type (default: PG)\n#   --nominal-distance \u003cm\u003e    Nominal distance in meters (default: 70% of task distance)\n#   --nominal-goal \u003cratio\u003e    Nominal goal ratio 0-1 (default: 0.2)\n#   --nominal-time \u003cs\u003e        Nominal time in seconds (default: 5400)\n#   --min-distance \u003cm\u003e        Minimum distance in meters (default: 5000)\n#   --no-leading              Disable leading (departure) points\n#   --no-arrival              Disable arrival points\n#   --json                    Output as JSON\n\n# Example: score Corryong Cup 2026 Task 1 (HG, no leading/arrival)\nbun run score-task \\\n  web/engine/tests/fixtures/corryong-cup-2026-t1/task.xctsk \\\n  web/engine/tests/fixtures/corryong-cup-2026-t1/ \\\n  --scoring HG --no-leading --no-arrival \\\n  --nominal-distance 35000 --nominal-goal 0.3\n```\n\nExample output:\n\n```\n=== Task Scoring Results (CIVL GAP) ===\n\nTask distance:    73.9 km\nPilots:           32 flying / 32 present\nIn goal:          12 (37.5%)\nBest time:        1:37:43\n\nTask Validity:    100.0%\nAvailable Points: 1000 (dist: 486, time: 514, lead: 0, arr: 0)\n\n   #  Pilot                            Dist        Time   Dist Pts   Time Pts   Lead Pts    Arr Pts    Total\n------------------------------------------------------------------------------------------------------------\n   1  Jon Durand                    73.9 km     1:37:43      485.6      514.4        0.0        0.0     1000\n   2  Rohan Holtkamp                73.9 km     1:46:05      485.6      386.9        0.0        0.0      872\n   3  Peter  Burkitt                73.9 km     1:49:00      485.6      358.8        0.0        0.0      844\n  ...\n  13  Rich Reinauer                 72.0 km           -      473.1        0.0        0.0        0.0      473\n  ...\n  29  Rennick Kerr                   5.0 km           -       32.9        0.0        0.0        0.0       33\n```\n\n## Project Structure\n\n```\nweb/\n  frontend/              - Cloudflare Pages frontend (Vite + TypeScript)\n  engine/                - Shared analysis library (IGC parsing, event detection, GAP scoring)\n    cli/                 - CLI utilities (detect-events, get-xcontest-task, score-task)\n  workers/\n    auth-api/            - Authentication API (Cloudflare Worker + D1)\n    competition-api/     - Competition management API (Cloudflare Worker + D1 + R2)\n    mcp-api/             - MCP server for AI agents (Cloudflare Worker)\n    airscore-api/        - AirScore caching proxy (Cloudflare Worker)\n  scripts/               - Operational scripts (secrets, test emails)\ne2e/                     - Playwright end-to-end tests\ndocs/                    - Feature and architecture specifications\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpokle%2Fglidecomp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpokle%2Fglidecomp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpokle%2Fglidecomp/lists"}