Giter VIP home page Giter VIP logo

point-hub's Introduction

The point platform which can collect the events of user.

Require:

  • Nodejs
  • MySQL

Run for production

For server site

Edit conf.json file, fill your mysql info.

Run:

npm install
npm start

It will listen 3000 port and receive data form '/events'

For client

Import sdk:

<script src="https://example.com/sdk/1.0/browser.js"></script>

Init sdk to set built-in info and send a point:

(function () {
    const eventSender = new EventSender('https://example.com/events', {
        // ses sdk/browser.ts#EventBody
        uid: 123456,
        app_name: 'my-app',
        get referer() { return location.href; },
    });
    eventSender.setContent({
        ua: navigator.userAgent,
    });
    
    // Send a point
    eventSender.send('pv', {
        // extra data
    });
})();

Deploy using docker

docker run pea3nut/point-hub:master

It will expose 80, 3000 and 3306 port for:

  • 80: PhpMyAdmin
  • 3000: point-server
  • 3306: MySQL

MySQL Password

The first time that you run your container, a new user admin with all privileges will be created in MySQL with a random password. To get the password, check the logs of the container by running:

docker logs $CONTAINER_ID

Transfer From Older

1.0 -> 1.1

  1. Run sql below:
ALTER TABLE `events` ADD `date` INT NULL AFTER `uid`;
ALTER TABLE `events` ADD INDEX(`date`);
  1. update point-server

  2. Run sql, it need some time:

UPDATE `events` SET `date` = date_format(time, '%Y%m%d') where date is NULL;

point-hub's People

Contributors

pea3nut avatar

Watchers

 avatar  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.