visitor-badge

May 12, 2025 ยท View on GitHub

visitor badge visitor badge

Inspired by jwenjian/visitor-badge written in Python (PV stats only)

Function

  • PV (Number of visits)
  • UV (Number of visitors)
  • Multi-database selection (mongodb, redis, deta)

Deployment

Server

git clone https://github.com/Lete114/visitor-badge.git visitor-badge

cd visitor-badge

npm run start

ServerLess

See the other branches of the repository for details

Configuration Database

Rename the .env.example file to .env and edit it (just fill in the comments according to the file)

Use

![visitor badge](https://visitor-badge.imlete.cn/?id=github.lete114.visitor-badge)
![visitor badge](https://visitor-badge.imlete.cn/?id=github.lete114.visitor-badge&labelColor=f00)

where id is custom and it is not constrained in any way.

Here are some suggestions

  1. Specify a user's home page, e.g.: https://github.com/Lete114 using id=github.lete114
  2. Specify a user's repository, e.g.: https://github.com/Lete114/visitor-badge using id=github.lete114.visitor-badge
  3. Specify the issues in a user's repository, e.g.: https://github.com/Lete114/visitor-badge/issues/1 using id=github.lete114.visitor-badge.issues.1
  4. Specify a website, e.g.: https://blog.imlete.cn using id=blog.imlete.cn
  5. Specify a page of a website, e.g.: https://blog.imlete.cn/404.html using id=blog.imlete.cn.404
KeyDefaultRequiredOptionsDescription
idโœ…Page unique ID
typepv['pv', 'uv']Statistics type
labelvisitorsCustom label (left) name
labelColor555Custom label (left) color (Note: You can leave out the well number #)
color4c1Custom stats (right side) color (Note: You can leave out the well number #)
styleflat['plastic', 'flat', 'flat-square', 'for-the-badge', 'social']Custom badge style