Context file for AI assistants working on PingDiff.
pingdiff/
โโโ desktop/ # Windows desktop app (Python)
โ โโโ src/
โ โ โโโ main.py # Entry point
โ โ โโโ gui.py # tkinter UI (PillButton, GlowingRing, AppleToggle)
โ โ โโโ ping_tester.py # ICMP ping logic (ThreadPoolExecutor)
โ โ โโโ api_client.py # HTTP client + Settings persistence
โ โ โโโ config.py # Constants (colors, regions, version)
โ โโโ build.py # PyInstaller build script
โ โโโ requirements.txt
โ
โโโ web/ # Next.js web app
โ โโโ src/
โ โ โโโ app/
โ โ โ โโโ api/
โ โ โ โ โโโ servers/route.ts # GET /api/servers
โ โ โ โ โโโ results/route.ts # POST /api/results
โ โ โ โโโ dashboard/ # Community stats page
โ โ โ โโโ download/ # Desktop app download
โ โ โ โโโ page.tsx # Landing page
โ โ โโโ lib/
โ โ โโโ supabase.ts # DB client + types
โ โโโ package.json
โ โโโ .env.example
โ
โโโ supabase/
โ โโโ migrations/ # SQL migrations for game servers
โ
โโโ .gitlab-ci.yml # CI/CD (Windows build + release)
โโโ CLAUDE.md # AI assistant instructions
โโโ CONTEXT.md # This file
| Category | Technology | Purpose |
|---|---|---|
| Desktop | Python 3.11 | Core language |
| tkinter | GUI framework | |
| subprocess ping | ICMP ping (system) | |
| PyInstaller | Exe packaging | |
| Inno Setup | Windows installer | |
| Web | Next.js 16 | React framework |
| TypeScript | Type safety | |
| Tailwind CSS | Styling | |
| Zod | Schema validation | |
| Database | Supabase | PostgreSQL hosting |
| Row Level Security | Data protection | |
| Hosting | Vercel | Web app hosting |
| GitHub Releases | Desktop downloads | |
| CI/CD | GitLab CI | Build automation |
| VCS | Git | Version control |
| GitHub | Primary repo (issues, releases, stars) | |
| GitLab | Mirror (CI builds only) |
Name: PingDiff
Website: www.pingdiff.com
Description: Free, open-source game server ping testing tool that helps gamers test ping, packet loss, and jitter to game servers before queuing. Supports 9 games across 141 servers in 8 regions.
Key Features:
- Real ICMP ping testing against actual game server IPs
- Multi-region comparison (EU, NA, ASIA) with ranked results
- ISP performance tracking with community data
- 100% open source, no tracking, MIT license
Stats:
- 10k+ tests run
- 50+ ISPs tracked
- 8 server regions
Current Task: None - project is stable and published
Potential Future Tasks:
- Add new game servers
- Improve community dashboard
- Add macOS/Linux desktop support
| Language | Standard |
|---|---|
| Python | Type hints required, use dataclasses, follow PEP 8 |
| TypeScript | Strict mode, Zod for validation, ESLint |
| SQL | Lowercase keywords, UUID primary keys |
- IP validation: Always validate IPs before ping to prevent command injection
- Rate limiting: 30 requests/minute on API endpoints
- RLS: Row Level Security on all user data tables
- Anonymous allowed: test_results accepts NULL user_id
- Theme: Dark mode (zinc-950 background)
- Components: Apple-inspired design (PillButton, GlowingRing, AppleToggle)
- Colors: Defined in
desktop/src/config.pyCOLORS dict
- Commits: Semantic style (feat:, fix:, docs:, etc.)
- Branches: main is production
- Tags: Version tags
v*trigger CI builds - CI: GitLab CI builds Windows installer on tag push
- Validation: Zod schemas on all inputs
- Errors: Return structured JSON errors
- Rate limit: 30 req/min per IP
- Primary keys: UUID
- Migrations: SQL files in
supabase/migrations/ - Naming: snake_case for tables and columns