Skip to content

hightemp/wapp_simple_stats_rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/<path> (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/<path>
    • Increments counter for <path> and returns a small SVG badge
    • Example: <img src="https://github.com/counter/example" alt="statistics badge" />
  • 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/<path>
    • 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:

<img src="https://your-host/counter/my-page" alt="statistics" />

Screenshots

License

MIT

About

Lightweight web counter written in Rust with sqlite3.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages