{"id":17306714,"url":"https://github.com/evannotfound/vercount","last_synced_at":"2025-04-05T14:04:17.689Z","repository":{"id":215189555,"uuid":"738334242","full_name":"EvanNotFound/vercount","owner":"EvanNotFound","description":"Busuanzi Compatible Website Counter Powered by Vercel + Redis","archived":false,"fork":false,"pushed_at":"2025-03-10T01:25:08.000Z","size":578,"stargazers_count":152,"open_issues_count":5,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T13:05:17.928Z","etag":null,"topics":["busuanzi","busuanzi-statistics","counter","hexo","statistics","website-counter"],"latest_commit_sha":null,"homepage":"https://vercount.one","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EvanNotFound.png","metadata":{"files":{"readme":"README.en.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-03T01:49:27.000Z","updated_at":"2025-03-27T00:35:32.000Z","dependencies_parsed_at":"2024-02-01T07:25:14.404Z","dependency_job_id":"9d81d7b6-0b6b-49f5-9d8d-f4cde0d3a9bb","html_url":"https://github.com/EvanNotFound/vercount","commit_stats":{"total_commits":117,"total_committers":1,"mean_commits":117.0,"dds":0.0,"last_synced_commit":"ee53d50400dde15fa88a03e325785d8f3829b68d"},"previous_names":["evannotfound/vercount"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvanNotFound%2Fvercount","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvanNotFound%2Fvercount/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvanNotFound%2Fvercount/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvanNotFound%2Fvercount/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EvanNotFound","download_url":"https://codeload.github.com/EvanNotFound/vercount/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247345850,"owners_count":20924102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["busuanzi","busuanzi-statistics","counter","hexo","statistics","website-counter"],"created_at":"2024-10-15T11:59:11.089Z","updated_at":"2025-04-05T14:04:17.673Z","avatar_url":"https://github.com/EvanNotFound.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"right\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/-English-4A628A?style=for-the-badge\" alt=\"English\" /\u003e\n  \u003ca title=\"zh-CN\" href=\"README.md\"\u003e  \u003cimg src=\"https://img.shields.io/badge/-%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87-545759?style=for-the-badge\" alt=\"简体中文\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n![vercount banner@3x](https://github.com/user-attachments/assets/e41667c9-f5f3-426f-b9f0-ece87d404840)\n\n# Vercount Website Counter\n\n\u003e Powered by: 🚀 NextJS + ✨ Redis + ▲ Vercel\n\nLooking for a simple, easy-to-use website counter? Try Vercount! It's the ultimate solution for fast and reliable statistics.\n\nVercount is an efficient website counter based on NextJS and Redis, featuring:\n\n- **Lightning Fast**: Server response time under 10ms.\n- **High Availability**: 99.99% uptime with global CDN support.\n- **Accurate Statistics**: Utilizes POST requests for precise data.\n- **Security**: JSON callback to eliminate CSRF attack risks; learn more: [JSONP](https://en.wikipedia.org/wiki/JSONP).\n- **Automatic Data Sync**: No manual operation needed; data auto-syncs.\n- **Seamless Compatibility**: Easy integration with existing HTML.\n- **Persistent Data Storage**: Regular Redis backups to prevent data loss.\n- **Serverless Architecture**: Back-end support via Vercel Serverless Functions.\n\n## Why Choose Vercount?\n\nVercount is designed to be faster, more stable, and secure. Easy deployment requires only adding a script tag. Future updates will include customizable statistics.\n\n## Project Website\n\n- [vercount.one](https://vercount.one)\n\n## Quick Start\n\n**For React projects, use [vercount-react](https://github.com/EvanNotFound/vercount-react).**\n\nTo get started, simply add this script to your site:\n\n```html\n\u003cscript defer src=\"https://cn.vercount.one/js\"\u003e\u003c/script\u003e\n```\n\nAfter adding the script, use these tags to start counting:\n\n```html\nTotal reads: \u003cspan id=\"vercount_value_page_pv\"\u003eLoading\u003c/span\u003e\nTotal visits: \u003cspan id=\"vercount_value_site_pv\"\u003eLoading\u003c/span\u003e\nTotal unique visitors: \u003cspan id=\"vercount_value_site_uv\"\u003eLoading\u003c/span\u003e\n```\n\n## Counting Method\n\n- **Page Views**: Increment by one for each visit.\n- **Unique Visitors**: Determined via UserAgent and IP address.\n\n## ⚠️ Important Notice\n\n**It is strictly forbidden to use scripts or programs to attempt to modify visit counts!** Such behavior violates our terms of service and may result in your IP being permanently banned.\n\nPlease note that this service is entirely funded by me personally, and Vercel charges for each edge request. Spamming the endpoint with scripts only increases operational costs and may ultimately force me to suspend or terminate this public service.\n\nIf you have special requirements to modify counts, please contact us through [evannotfound.com/contact](https://evannotfound.com/contact). We will evaluate your request based on specific circumstances.\n\nWe have implemented multiple layers of security measures to detect and block automated script access, including but not limited to:\n- User agent detection\n- IP blocking\n- Browser fingerprinting\n- Access frequency limitations\n\n## Self-Hosting Guide\n\nThis guide will help you set up your own instance of Vercount. The setup consists of two main parts:\n1. Redis KV Store\n2. NextJS Application\n\n### Prerequisites\n\n- A server with Docker and Docker Compose installed\n- A Vercel account (or any platform that can host NextJS applications)\n- Basic knowledge of command line operations\n\n### Part 1: Setting Up Redis KV Store\n\nFirst, we'll set up the Redis instance that will store your counter data. Create a new directory for your Redis setup:\n\n```bash\nmkdir vercount-redis\ncd vercount-redis\n```\n\nCreate a `docker-compose.yml` file:\n\n```yaml\nservices:\n  redis:\n    image: redis:latest\n    environment:\n      - REDIS_PASSWORD=${REDIS_PASSWORD}\n    command: redis-server --requirepass ${REDIS_PASSWORD}\n    volumes:\n      - ./data:/data\n    restart: unless-stopped\n    ports:\n      - \"6379:6379\"\n    healthcheck:\n      test: [\"CMD-SHELL\", \"redis-cli -a ${REDIS_PASSWORD} ping | grep PONG\"]\n      interval: 1s\n      timeout: 3s\n      retries: 5\n\n  serverless-redis-http:\n    image: hiett/serverless-redis-http:latest\n    ports:\n      - '8080:80'\n    environment:\n      - SRH_MODE=env\n      - SRH_TOKEN=${REST_TOKEN}\n      - SRH_CONNECTION_STRING=redis://:${REDIS_PASSWORD}@redis:6379\n    restart: unless-stopped\n    depends_on:\n      - redis\n```\n\nCreate a `.env` file:\n\n```env\nREDIS_PASSWORD=your_secure_password_here\nREST_TOKEN=your_secure_token_here\n```\n\nStart the Redis services:\n\n```bash\ndocker-compose up -d\n```\n\n### Part 2: Deploying the NextJS Application\n\n1. Fork the Vercount repository from GitHub:\n   ```bash\n   git clone https://github.com/EvanNotFound/vercount.git\n   cd vercount\n   ```\n\n2. Create a `.env` file with your Redis configuration:\n   ```env\n   KV_URL=redis://:your_secure_password_here@your_server_ip:6379\n   KV_REST_API_URL=http://your_server_ip:8080\n   KV_REST_API_TOKEN=your_secure_token_here\n   ```\n\n3. Deploy to Vercel:\n   ```bash\n   vercel deploy\n   ```\n\n   Or deploy to your preferred hosting platform that supports NextJS applications.\n\n## Configuration\n\n1. Update your domain's DNS settings to point to your deployed application.\n\n2. Add the script tag to your website, replacing the domain with your own:\n   ```html\n   \u003cscript defer src=\"https://your-domain.com/js\"\u003e\u003c/script\u003e\n   ```\n\n3. Add the counter elements to your HTML:\n   ```html\n   Total reads: \u003cspan id=\"vercount_value_page_pv\"\u003eLoading\u003c/span\u003e\n   Total visits: \u003cspan id=\"vercount_value_site_pv\"\u003eLoading\u003c/span\u003e\n   Total unique visitors: \u003cspan id=\"vercount_value_site_uv\"\u003eLoading\u003c/span\u003e\n   ```\n\n## Security Considerations\n\n1. Always use strong passwords for Redis\n2. Configure proper firewall rules to restrict Redis access\n3. Keep your REST_TOKEN secure and never expose it publicly\n4. Regularly update both Redis and the application\n\n## Maintenance\n\n1. Monitor Redis disk usage\n2. Set up regular backups of the Redis data directory\n3. Keep the application and dependencies updated\n4. Monitor application logs for any issues\n\n## Troubleshooting\n\n- If counters don't update, check Redis connectivity\n- Verify Redis credentials are correct\n- Check application logs for errors\n- Ensure ports are properly exposed and accessible\n\nFor additional support, please open an issue on the GitHub repository.\n\n## 💗 Support Me\n\nThis is a non-profit project, and your support is sincerely appreciated. Even small donations help maintain the project's longevity.\n\n\u003cdetails\u003e\u003csummary\u003e📝 Expense Details\u003c/summary\u003e\nI cover the operation costs personally, including Vercel fees and database server costs. Monthly and annual expenses are as follows:\n\nMonthly expenses:\n- Vercel Pro subscription: $20 USD\n- Vercel Function Invocations: $1 USD\n- Edge Middleware Invocations: $1 USD\n- Total: approx. ¥154 CNY\n\nAnnual expenses:\n- Database server fees: $40 USD\n- Domain fees: $15 USD\n- Total: approx. ¥390 CNY\n\nI hope for your support as the project grows.\n\u003c/details\u003e\n\nYou can visit my [personal website donation page](https://evannotfound.com/sponsor) to donate.\n\nOr support my other projects, like [GPT Plus Share](https://gpt.oknice.ca), which allows sharing multiple ChatGPT Plus accounts with the same interface, starting at only 17 RMB per month!\n\n[![GPT Billboard](https://github.com/EvanNotFound/hexo-theme-redefine/assets/68590232/55346629-cd54-45a4-9b31-3f979750b0c0)](https://gpt.oknice.ca)\n\n## Disclaimer\n\nThe ultimate interpretation rights belong to EvanNotFound.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevannotfound%2Fvercount","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevannotfound%2Fvercount","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevannotfound%2Fvercount/lists"}