Skip to content

Latest commit

 

History

26 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kauntah

English | 日本語

A TypeScript-based hit counter running on Cloudflare Workers.

Usage

Simply add the following tag to your page:

<img src="https://counter.fjtd.dev/counter" referrerpolicy="origin" />

Generator (Preview)

https://kauntah-generate.fjtd.moe/

theme

asset version preview
normal-150 (default) Ver.0.91 normal-150
blue2-150 Ver.0.93 blue2-150
blue2-100 Ver.0.93 blue2-100
green-100 Ver.0.93 green-100

Parameters

Parameter Example Description
asset ?asset=normal-150 normal-150 (default) / blue2-150 / green-100 / blue2-100
offset ?offset=1000 Initial value added to the count (max: 1,000,000)
padding ?padding=4 Minimum display digits (1–16); pads with leading zeros

Mechanism

  • Automatically identifies the owner based on the hostname of the Referer header.
  • Creates an independent counter for each host.
  • Available for use by anyone with a site that has its own FQDN.

Tech Stack

Layer Technology Role
Compute Cloudflare Workers (Node.js compatible) Request handling
Framework Hono Routing
Counter SQLite-backed Durable Objects Atomic increment and the sole persistent count store
Image Cache Workers KV Generated SVG cache (24-hour TTL)
Image Processing Native SVG rendering Combines Base64 PNG digit assets in SVG
Rate Limiting Cloudflare Rate Limiting API Prevents count inflation (20 requests / 60 seconds per owner and IP)

Notes

  • Rate limiting: The count increases up to 20 times per 60 seconds for each owner and IP combination. Requests above the limit return the current counter image without increasing the count.
  • Each successful counter request performs one persistent write to its owner's SQLite-backed Durable Object.
  • Before deploying, run npm run check to type-check the Worker and verify that Wrangler can build its deployment bundle.
  • The original asset images are included in the repository for reference, but are not used directly at runtime. They are embedded as Base64-encoded strings in src/assets/.

Credits

  • Illustration: Kokage Kusaka (日下こかげ)
    • Originally distributed on "KK's WS" (now closed)
    • For more details, search for "Nekomimi Counter" and "Kokage Kusaka"
    • Non-commercial use, modification, and redistribution are permitted by the author

About

The easiest hit counter, powered by Cloudflare Workers.

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages