Giter Site home page Giter Site logo

vertotem / visit-stat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lete114/visit-stat

0.0 0.0 0.0 103 KB

Website visitor statistics system | 网站访问量统计系统

Home Page: https://visit-stat.vercel.app

License: MIT License

Shell 11.57% JavaScript 80.07% HTML 8.36%

visit-stat's Introduction

网站访问量统计系统

  • 轻量,简洁
  • 支持 site_uv, site_pv, page_pv
  • 存储[redis, mongodb]
  • Nodejs 编写,多平台部署(Server,ServerLess)

服务端

服务器部署

服务器需要有 nodejs 运行环境

mkdir Visit-Stat                      # 创建目录
cd Visit-Stat                         # 进入目录
npm install visit-stat --save         # 安装 Visit-Stat
touch index.js .env                   # 创建 index.js 以及 .env(环境配置文件)

环境配置文件详细请看 .env.example 编辑index.js文件,编辑好后,保存并执行node index.js命令启动服务

require('visit-stat').server()

无服务器部署

同服务器部署类似

mkdir Visit-Stat                      # 创建目录
cd Visit-Stat                         # 进入目录
npm install visit-stat --save         # 安装 Visit-Stat
touch index.js .env                   # 创建 index.js 以及 .env(环境配置文件)

无服务器可以不需要.env环境配置文件,一般无服务器平台有专门的环境配置选项(每个平台各有不同)

编辑index.js文件,编辑好后,保存并推送到无服务器平台即可

module.exports = require('visit-stat').main

客户端

dist/visit-stat.min.js 内的//localhost:6870服务端地址替换为你自己部署的服务端地址,然后在你的网站上引用即可

返回的数据会主动寻找标签 id 属性为:vs_site_uv, vs_site_pv, vs_page_pv的标签并替换内容。不懂请看 public/index.html

visit-stat's People

Contributors

lete114 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.