https://github.com/bkbilly/lnxlink_analyzer
https://github.com/bkbilly/lnxlink_analyzer
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bkbilly/lnxlink_analyzer
- Owner: bkbilly
- Created: 2024-02-23T20:03:41.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-03-02T23:00:00.000Z (over 2 years ago)
- Last Synced: 2025-03-31T00:16:41.768Z (over 1 year ago)
- Language: TypeScript
- Size: 25.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Analyzer
This CloudFlare Worker tracks an application's usage by storing daily data and displaying a graph for each version.
Each installation identifies itself by sending a unique identifier (UUID) and its installed version.
## API Calls
- `/api/lnxlink`: POST request with a JSON payload of `uuid` and `version` which is stored to the database and should be sent every 24 hours
- `/api/lnxlink/users`: GET request to show a list of app versions and per day usage
- `/api/lnxlink/countries`: GET request to show a list active users per country in the last 10 days
- `/lnxlink/graph`: GET request to show a line chart of active users per day
- `/lnxlink/map`: GET request to show a map of active users in the last 10 days
## Installation
The full guide for setting up your environment is located [here](https://developers.cloudflare.com/d1/get-started/).
With these commands you can create your own analytics server:
```bash
npx wrangler login
npx wrangler d1 execute prod-d1-analyzer --file=./schema.sql
npx wrangler deploy
```