GitHub Profile Views

Track your GitHub profile visitors with SVG badges

📦 View on GitHub

Example of how your badge will look:

Profile Views

What does this do?

This project creates a simple API that tracks how many people visit your GitHub profile. When someone views your profile, it increments a counter and shows a nice SVG badge with the number of views.

How to Deploy

Step 1: Setup Upstash Redis (Free Database)

  1. Go to https://console.upstash.com/
  2. Create a free account
  3. Click "Create Database" and choose Redis
  4. Copy your UPSTASH_REDIS_REST_URL
  5. Copy your UPSTASH_REDIS_REST_TOKEN
Important: Keep these credentials safe - you'll need them in the next step.

Step 2: Get the Code

  1. Fork or download the repository from GitHub
  2. Create a file called .env.local in the project folder
  3. Add your Upstash credentials:
UPSTASH_REDIS_REST_URL=your_redis_rest_url_here
UPSTASH_REDIS_REST_TOKEN=your_redis_rest_token_here

Step 3: Deploy to Vercel (Recommended)

  1. Go to https://vercel.com
  2. Sign up with your GitHub account
  3. Click "New Project" and import your repository
  4. Add your environment variables in the Vercel dashboard:
    • UPSTASH_REDIS_REST_URL
    • UPSTASH_REDIS_REST_TOKEN
  5. Click "Deploy"

Step 4: Add Badge to Your GitHub Profile

Once deployed, add this to your GitHub profile README:

![Profile Views](https://domain_name/api/your-github-username)

Replace:

  • your-app-name with your Vercel app name
  • your-github-username with your actual GitHub username
That's it! Your profile view counter is now working. Every time someone visits your GitHub profile, the counter will increase.
  1. Connect your GitHub repository to Railway
  2. Add environment variables
  3. Deploy

Testing Your Setup

After deployment, test your API by visiting:

https://your_domain/api/your-username

You should see an SVG badge with a view count that increases each time you refresh the page.

Free Tier Limits

Troubleshooting

Badge not showing?

Counter not incrementing?

Need Help?

If you run into issues:

Crafted by Shyam Mahanta