इस प्रोजेक्ट के बारे में

Edgemetry provides a self‑hosted web analytics solution that runs entirely on the Cloudflare edge. A single Cloudflare Worker together with one D1 database stores raw events and aggregated rollups, eliminating the need for any additional server or container infrastructure. The tracking script is about 2.1 KB, served from the same domain as the site being measured, and does not set cookies, use localStorage, or perform fingerprinting. Visitor identification is based on a daily‑salted hash of the IP address and user‑agent, and raw event rows are discarded after 24–48 hours, leaving only aggregate counts. Because no personal data is stored, the system complies with GDPR requirements without a consent banner. Metrics displayed in the dashboard include visitors, pageviews, views per visit, bounce rate and average time on site. Each metric is shown with a sparkline and a comparison to the previous period. The interface supports stackable filters: clicking any row narrows all panels simultaneously, allowing breakdowns by page, entry page, exit page, referrer, country, browser, operating system, device, screen size and UTM tags. A real choropleth map is rendered directly from the Worker, and a live counter shows current online visitors, minute‑by‑minute traffic for the last thirty minutes, and a feed of pages being read right now. Multiple sites can be managed from a single deployment, each with its own snippet and isolated traffic data. User roles include Owner (full management) and Viewer (read‑only access to explicitly granted sites). Permissions are enforced server‑side, and owners cannot demote or delete their own account, preventing accidental lockout. The architecture is tuned to Cloudflare’s free‑tier limits. Raw events are written to per‑hour tables without indexes, costing one row write per pageview. Daily rollups and a stats cube provide aggregated data for filtered queries, keeping write costs around 1.2 rows per pageview. Reads are optimized by scanning once per dashboard load and grouping results for all panels, reducing the number of D1 reads dramatically. The free tier comfortably supports roughly 20 000 visits per day; beyond that, upgrading the Worker plan lifts all limits. Deployment is streamlined via a one‑click button that creates the D1 database, configures the Worker and sets up a custom domain. After deployment, the user claims the instance via a setup form, adds the provided snippet to the site’s head, and the dashboard populates automatically. Advanced users can also deploy from the command line with Wrangler. Configuration variables in wrangler.jsonc allow adjustment of hourly data retention, enabling or disabling the filter cube, setting PBKDF2 iterations for password hashing, and toggling automatic update checks. The system includes cron jobs for hourly and daily rollups, which are self‑healing if a run is missed. A live demo is available that runs the dashboard against a synthetic back‑end, showing all features without requiring a real deployment. Automated tests verify API consistency between the real Worker and the mock implementation. Overall, Edgemetry delivers a privacy‑respectful, low‑overhead analytics platform that can be run on a personal Cloudflare account with minimal cost and infrastructure.