惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Schneier on Security
F
Fortinet All Blogs
B
Blog
GbyAI
GbyAI
P
Proofpoint News Feed
量子位
The Register - Security
The Register - Security
宝玉的分享
宝玉的分享
大猫的无限游戏
大猫的无限游戏
云风的 BLOG
云风的 BLOG
V
Visual Studio Blog
B
Blog RSS Feed
WordPress大学
WordPress大学
Recorded Future
Recorded Future
Recent Announcements
Recent Announcements
V
Vulnerabilities – Threatpost
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
Secure Thoughts
雷峰网
雷峰网
Stack Overflow Blog
Stack Overflow Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Webroot Blog
Webroot Blog
AWS News Blog
AWS News Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
The GitHub Blog
The GitHub Blog
爱范儿
爱范儿
O
OpenAI News
月光博客
月光博客
H
Hacker News: Front Page
S
Security Affairs
W
WeLiveSecurity
The Hacker News
The Hacker News
aimingoo的专栏
aimingoo的专栏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Help Net Security
Help Net Security
MongoDB | Blog
MongoDB | Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
D
Docker
T
The Blog of Author Tim Ferriss
Spread Privacy
Spread Privacy
Blog — PlanetScale
Blog — PlanetScale
J
Java Code Geeks
S
Securelist
Microsoft Azure Blog
Microsoft Azure Blog
TaoSecurity Blog
TaoSecurity Blog
T
Threat Research - Cisco Blogs
M
MIT News - Artificial intelligence
A
About on SuperTechFans

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
How I Built a Modern Dashboard for GoatCounter - Rate Limiting, World Maps, and a Single HTML File
Abhishekh Si · 2026-05-05 · via DEV Community

I use GoatCounter for my personal site analytics. If you haven't heard of it — it's a privacy-first, open-source analytics tool that doesn't track personal data. No cookies, no consent banners, lightweight script. I love it.

But the built-in dashboard is... minimal. It shows you the data, and that's about it. No interactive charts. No world map. No visual drill-down into browser versions or regions. For a tool that collects genuinely useful data, the presentation felt like it was leaving a lot on the table.

So I built my own dashboard.

Live demo (no account needed): https://abhishekhsingh.github.io/goatcounter-dashboard — click "Try Demo" to see it with sample data.

GitHub: https://github.com/abhishekhsingh/goatcounter-dashboard


What I wanted to build

I had a few constraints in mind from the start:

  • Single HTML file. No npm, no webpack, no build step. You should be able to fork the repo, enable GitHub Pages, and have a working dashboard. Or just download index.html and open it locally.
  • No server. The dashboard talks directly to your GoatCounter instance via the official API. My browser, your GoatCounter — nothing in between.
  • No tracking. Ironic to add analytics to an analytics dashboard. Zero telemetry, zero phone-home.
  • Privacy-first. API key stored in your browser's localStorage only. Never sent anywhere except your own GoatCounter instance. With those constraints locked, I started building.

The stack

React 18 + Recharts, loaded from CDN via <script> tags. JSX compiled in-browser by Babel standalone. Plain CSS with custom properties for theming. No bundler, no transpiler pipeline — the browser does everything.

Five CDN dependencies total: React, ReactDOM, Recharts, Babel standalone, and prop-types (a silent peer dependency Recharts needs at runtime).

The entire dashboard is about 3,000 lines in a single index.html. I know that sounds like a lot for one file, but it's surprisingly maintainable when you treat it as a self-contained application with clear component boundaries.

What the dashboard looks like

Here's what you get when you connect to your GoatCounter instance (or try the demo mode):

The layout, top to bottom:

  • 4 KPI cards with period-over-period trend arrows (▲ +12.5% vs previous period)
  • Traffic area chart — visitors over time with gradient fill
  • Top Pages with click-to-expand referrer drill-down per page
  • 3 donut charts — Browsers, OS, Devices — each with click-to-drill into versions
  • Choropleth world map with 174 countries, colored by visitor count, with a country list below that drills into regions/states
  • Languages card
  • Campaigns card (only shows when UTM data exists) Dark mode is the default. There's a light theme toggle if you prefer that.

The interesting technical challenges

1. Rate limiting without a backend

GoatCounter's API has a token-bucket rate limit — about 4 requests per second. My dashboard needs 13 API calls on initial load to populate all the cards. A naive Promise.all would fire all 13 at once and get throttled immediately.

I built a strict-sequential request queue. Each request waits for the previous one to complete (not just start), with a 500ms gap between completions. On the wire, that's about 2 requests per second including CORS preflights.

But 13 sequential requests at 500ms each means a 6-7 second load time. That's too slow. So I added lazy loading — the dashboard doesn't fetch data for cards that aren't visible yet.

Four tiers, triggered by IntersectionObserver:

  • Tier 1 (immediate): KPI totals + traffic chart — 3 requests
  • Tier 2 (scroll to donut row): Browsers, OS, Devices
  • Tier 3 (scroll to countries): Locations
  • Tier 4 (scroll to bottom): Campaigns The initial visible load is just 3-4 requests. Below-the-fold cards load as you scroll to them. Combined with a 60-second localStorage response cache, repeat visits are nearly instant.

2. A world map from TopoJSON with no build step

Dashboard in dark mode showing worldmap

I wanted a choropleth world map — countries colored by visitor count. The standard approach is d3-geo at runtime, but d3 is way too heavy to load from CDN for just a map.

Instead, I wrote a one-time Node.js script (scripts/build-world-map.js) that converts Natural Earth 110m TopoJSON into pre-projected SVG paths. The script handles antimeridian wrapping (Russia, Fiji, Alaska all cross the date line), applies a Natural Earth projection, and outputs a plain JS file with 174 country objects — each containing the ISO code, country name, and a pre-computed SVG path d attribute.

The generated file (assets/world-map.js) is loaded as a separate non-Babel script tag. This is deliberate — Babel standalone recompiles the entire <script type="text/babel"> block on every page load, so keeping the 27KB of map paths outside that block saves compilation time.

The map itself is plain SVG with CSS hover effects. Countries with visitor data get colored on a sqrt scale (so small-count countries aren't invisible next to large ones). Hover shows a tooltip. When you click a country in the list below the map, all its disjoint territories highlight together — mainland US, Alaska, and Hawaii all light up.

3. GoatCounter's timezone trap

This one was subtle. GoatCounter's hourly traffic data returns an array indexed by hour — index 0 is midnight, index 11 is 11 AM. But these hours are in your site's configured timezone, not UTC.

My chart was building ISO date strings with a "Z" suffix (UTC), then letting JavaScript's Date object parse them. Since my browser is in IST (UTC+5:30), every data point shifted by 5.5 hours. The traffic chart showed a spike at 2 AM that was actually a spike at 7:30 AM.

The fix: parse the hour integer directly and format it for display without ever creating a Date object. The data is already in the right timezone — just don't let JavaScript "help" you with timezone conversion.

4. Drill-down everywhere

Dashboard in dark mode showing all donut cards and drill down

The built-in GoatCounter dashboard lets you click on a browser or country to see detailed breakdowns. I wanted the same thing.

Now every card supports drill-down:

  • Click a browser → see version breakdown (Chrome 124, Chrome 123...)
  • Click an OS → see version breakdown (Windows 11, Windows 10...)
  • Click a device category → see pixel widths
  • Click a country → see regions/states (the map highlights the selected country too)
  • Click a page → see referrer sources
  • Click a campaign → see referrer URLs The donut chart slices pop out when selected — a subtle +6px radius expansion with an accent stroke. It's a small detail, but it makes the interaction feel responsive.

5. Demo mode that doesn't cheat

I wanted people to try the dashboard without needing a GoatCounter account. So I built a demo mode with a buildDemoData() generator function (~280 lines) that creates self-consistent fake data on demand.

The generated data includes:

  • Weekday/weekend traffic patterns (weekdays are higher)
  • Two viral spikes baked into the 30-day curve (a Hacker News hit on day 8, a Reddit hit on day 22)
  • 40 countries lighting up the world map
  • 15 realistic blog post paths about distributed systems and MCP
  • Referrer breakdowns (Google, HN, Reddit, Twitter, LinkedIn)
  • Campaign tracking (hackernews-apr, reddit-selfhosted, twitter-thread) Everything sums correctly — country visitor counts roughly equal total visitors, browser percentages add to 100%. The generator produces different scaled data per date range (7d, 30d, 90d) so switching ranges actually changes the view.

All drill-downs work in demo mode too — click Chrome and you see version data, click United States and you see states. No API calls, all from static lookup tables.

Self-hosting

Fork the repo → enable GitHub Pages → done. Literally that simple.

Or if you want to host it yourself: download index.html, open it in a browser. It works from the file system — no server needed.

The dashboard connects to your GoatCounter instance using your API key. I never see your data, because there's no intermediary. Your browser talks directly to your GoatCounter.

What I learned

Building a non-trivial single-page application inside one HTML file with no build step is surprisingly viable in 2026. React + Recharts via CDN, JSX in the browser, CSS custom properties for theming — it all just works. The trade-off is that Babel standalone prints a console warning every time (yes, I know it's not recommended for production), but the actual performance is fine for a dashboard that loads once and stays open.

The rate-limiting work was the most educational part. GoatCounter doesn't document its rate limit algorithm in detail, so I had to discover it empirically — firing bursts of requests and observing where it started returning 429s. The token-bucket model meant that even 350ms gaps between requests weren't enough during a 13-request burst. Only a strict sequential queue with completion-based timing kept it reliably under the limit.

Live demo: https://abhishekhsingh.github.io/goatcounter-dashboard — click "Try Demo"

GitHub: https://github.com/abhishekhsingh/goatcounter-dashboard

MIT licensed. If you use GoatCounter and want richer visualizations, give it a shot. If you have feature ideas or find bugs, open an issue — I'm actively maintaining this.

My Portfolio: [https://abhishekhsingh.github.io/]