Skip to content

robin-ivi/github-profile-views

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Visitor Counter

Visitor Count

A simple Node.js and Express.js project that counts the number of visitors to your GitHub profile or repository. The count updates every time someone visits the deployed link.

🚀 Features

  • Tracks and displays visitor count
  • Simple API to retrieve the count in JSON format
  • Easy to deploy on platforms like Render or Replit

📌 How It Works

  1. A Node.js server keeps track of visitors in a text file.
  2. Every time someone accesses the / endpoint, the count increases.
  3. The /count endpoint returns the current visitor count in JSON format.
  4. A badge in your README.md dynamically updates with the visitor count.

🔧 Setup & Installation

1️⃣ Clone Repository

git clone https://github.com/robin-ivi/github-profile-views.git
cd github-visitor-counter

2️⃣ Install Dependencies

npm install

3️⃣ Run Locally

node index.js
  • Open http://localhost:3000/ in your browser to see the visitor count.
  • Visit http://localhost:3000/count to get the count in JSON format.

🚀 Deployment

Option 1: Deploy on Render

  1. Go to Render.
  2. Create a New Web Service and link this repository.
  3. Set Build Command to:
    npm install
  4. Set Start Command to:
    node index.js
  5. Deploy and note your public URL.

Option 2: Deploy on Replit

  1. Go to Replit.
  2. Create a New Repl and select Node.js.
  3. Paste the index.js code and click Run.
  4. Copy the Replit URL.

📌 Add to GitHub README

Once deployed, add this to your README.md:

![Visitor Count](https://your-deployed-url.com/count)

This will dynamically update the visitor count every time someone views your profile!

🛠 API Endpoints

Endpoint Description
/ Displays the total visitor count
/count Returns the count in JSON format

🎯 License

This project is open-source and available under the MIT License.


💡 Need help? Feel free to reach out!

About

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors