Skip to content

Dynamically generates an image of a hitcounter that display page views for a particular webpage. Built with NextJs and UpStash Redis.

Notifications You must be signed in to change notification settings

dasveloper/Hitcount.app

Repository files navigation

Hitcount.app

Dynamically generates an image of a hitcounter that display page views for a particular webpage. Built with NextJs and UpStash Redis.

Demo

https://hitcount.app

1 Clone the repo

git clone https://github.com/dasveloper/Hitcount.app.git hitcount-app

2 Set up environment variables

Copy the .env.local.example file in this directory to .env.local (which will be ignored by Git):

cp .env.local.example .env.local

3 Configuring Upstash

Go to the Upstash Console and create a new database

Upstash environment

  • UPSTASH_REDIS_REST_URL: Find the URL in the database details page in the REST API section.
  • UPSTASH_REDIS_REST_TOKEN: Find the URL in the database details page in the REST API section.

⚠️ Because of an issue with Node canvas on Vercel you must add this environment variable only on Vercel, not locally

  • LD_LIBRARY_PATH: /var/task/node_modules/canvas/build/Release:$LD_LIBRARY_PATH

This is also why we need the custom vercel-build step in package.json. See: https://github.com/jeetiss/vercel-canvas

4 Run the project

Start your local dev server

yarn dev

About

Dynamically generates an image of a hitcounter that display page views for a particular webpage. Built with NextJs and UpStash Redis.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published