https://github.com/hightemp/wapp_simple_stats_rust
CGI счетчик посетителей на rust в базу sqlite3.
https://github.com/hightemp/wapp_simple_stats_rust
counter http-server rust sqlite
Last synced: about 2 months ago
JSON representation
CGI счетчик посетителей на rust в базу sqlite3.
- Host: GitHub
- URL: https://github.com/hightemp/wapp_simple_stats_rust
- Owner: hightemp
- Created: 2023-02-04T17:35:49.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-12T07:49:47.000Z (almost 3 years ago)
- Last Synced: 2025-02-16T00:42:55.025Z (over 1 year ago)
- Topics: counter, http-server, rust, sqlite
- Language: Rust
- Homepage:
- Size: 198 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# wapp_simple_stats_rust
Lightweight web counter written in Rust. It stores hits in SQLite and exposes:
- a badge endpoint you can embed anywhere to increment and display a named counter
- a protected statistics dashboard with charts and tables
UI is rendered with Tera templates and styled via bootstrap.css (CDN). Charts are rendered with Chart.js (CDN). Supports automatic light/dark theme selection.
## Features
- Named counters via `/counter/` (returns an SVG badge)
- Statistics dashboard:
- Index page: grouped counts by path
- Path page: daily counts for last 30 entries + last 10 raw visits
- Basic Auth (configurable)
- SQLite storage (file on disk)
- Auto light/dark theme, responsive layout
## Endpoints
- `GET /counter/`
- Increments counter for `` and returns a small SVG badge
- Example: `
`
- `GET /statistics`
- Protected by Basic Auth (if enabled)
- Summary table of all paths
- `GET /statistics/__all__`
- Protected by Basic Auth (if enabled)
- Daily counts (last 30 rows) aggregated for all paths + last 10 recent visits
- `GET /statistics/`
- Protected by Basic Auth (if enabled)
- Daily counts (last 30 rows) for specific path + last 10 recent visits
- `GET /statistics_self_full_json`
- Full dataset as JSON (not protected by default)
- Useful for tooling/integrations
## Usage Examples
Embed a counter badge:
```html
```
## Screenshots

## License
MIT
