Skip to content

rafe95/VisitorBadgeReloaded

 
 

Repository files navigation

Visitor Badge Reloaded

Coverage Status

Visitor Badge Reloaded is a project inspired by visitor-badge which is no longer maintained, unfortunately.

In addition, it was missing some features which made it feel incomplete to me. It was also written using Python which I'm personally not a huge fan of, especially when used as a REST api.

Hence, something of better performance and functionality must be made!


VBR Visitor-Badge
Programming Language Golang Python
Performance Arguably better? Mux router is quick at matching and generation functions are optimized. Caching is available as well. Flask... 🤔
Features There are many additional features for customizability... Select your page_id?
Potential downtime? Nope, as long as Heroku is up. Glitch instance may reach a request limit 😢
Self hosting friendly? There are instructions and I am always open to help! Questionable documentation?
Maintained and under development? Yes... No, according to owner himself
Source code is readible? Maybe not? One file but not much better for readibility

Benchmarks

coming soon...

Settings/Configuration

Defaults

  • Colour: "blue"
  • Style: "square"
  • Text: "Visitors"
  • Logo: no logo
  • Cache: disabled

Examples

Migrating From Visitor Badge

TLDR; REPLACE THE DOMAIN NAME
ie. 'visitor-badge.glitch.me/badge?page_id=YOURPAGEID' --> 'visitor-badge-reloaded.herokuapp.com/badge?page_id=YOURPAGEID'

Visitor Badge Reloaded has ALL the same features as the original Visitor Badge with EVEN MORE FEATURES!

This means that all you have to do is replace the url of the badge with https://visitor-badge-reloaded.herokuapp.com/badge?page_id=<your own page_id here>. The total visits will remain the exact same as well!

Also, VBR features could be configured as a HTTP query parameter!

Options (add as a HTTP query parameter)

IMPORTANT: Other than the page_id option, there exists additional styling options and functional options (in the future). More details about the options could be found at the bottom of the Shields.io website. Also, all the options are specified as HTTP parameters!!!

  • page_id=<your id> --> identifies your badge, make this unique to yourself. eg. <your username.visitor.badge.reloaded or <username>-<username>
  • color=<colour here> --> the hex colour of the text background, do NOT include the #
  • lcolor=<colour here> --> the hex colour of the label background, do NOT include the #
  • style=<style name> --> refer to the Sheilds.IO website for the available options
  • text=<Some text other than "Visitors"> --> put a customizable label on your badge
  • logo --> logo to put beside the badge, go to https://simpleicons.org/ for the available names
  • logoColor --> refer to color for the formatting
  • cache --> *just put &cache=on at the end of the badge url

Deploying your own instance

If at any point, you feel the need to host your own instace, you could refer to the following information to do so. I personally don't believe in such a need but you are welcome to do so.

Docker/Kubernetes

This app could be packaged as a Docker image. Prebuilt docker images of VBR are also available on Docker Hub and on the Github Container Registry. Just run the relevant commands found in the Makefile. Then deploy to your choosen cloud service or even to your own server. However, note that there is no HTTPS support and VBR should be placed behind something else that provides HTTPS (eg. reverse proxy, Heroku...).

Heroku (recommended)

Heroku supports Docker containers even with their free dynos. __The current public instance of the app is deployed there as well. __Documentation for deploying Docker is found here. All the files necessary to deploy to Heroku is already present within the repository so this should be rather trivial. In addition make deploy-heroku pushes the git repo to the heroku remote if you have configured Heroku already.

You could also deploy to heroku using this widget (thanks to rzlamrr for the PR):

Deploy

"Stuff" Used

  • Golang
  • Docker
  • Mux (router)
  • Zerolog (logger)
  • shields.io

TODO

  • GOT FEATURE REQUEST??? Send me an issue!
  • website homepage
  • local badge generator (instead of relaying shields.io)
  • differentiates user by IP
  • differentiates user by Github account???
  • user analytics??
  • additional TODOs are in the code itself

Supporting this project!

I originally created this project because I personally wanted something that was built to my (relatively high) expectations of performance and customizability. I share this project and its hosted service to the public as I thought that this would be something that would benefit others. However, maintaining such a project and handling the demands of all the users that would use this service would incur additional work and costs for myself. Hence, it would be greatly appreciated if you could support this project by the following ways:

  1. Star ⭐ and share this project!
  2. Contribute to the development. Refer to Contributing
  3. Bug tracking! If you find any issues, please create an Issue so the problem could be fixed as soon as possible.

Contributing

If you are interested in helping make this project better, I highly welcome you to do so. I thank you in advance for your interest. If you are unsure of what you could do to improve the project, you may have a look in TODO list (above), or add to the list yourself

About

A Visitor Badge made with Golang that prioritizes performance and customizability. README for more details.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 87.7%
  • Makefile 5.1%
  • Dockerfile 5.0%
  • Shell 2.2%