https://github.com/thinkswan/express-tracking-dashboard
An Express app that tracks visits in realtime by using a tracking pixel.
https://github.com/thinkswan/express-tracking-dashboard
express javascript socket-io tutorial
Last synced: 6 months ago
JSON representation
An Express app that tracks visits in realtime by using a tracking pixel.
- Host: GitHub
- URL: https://github.com/thinkswan/express-tracking-dashboard
- Owner: thinkswan
- License: mit
- Created: 2019-06-27T18:15:49.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-03-09T15:26:34.000Z (about 5 years ago)
- Last Synced: 2025-01-03T19:24:13.081Z (over 1 year ago)
- Topics: express, javascript, socket-io, tutorial
- Language: JavaScript
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# express-tracking-dashboard
An Express app that tracks visits in realtime by using a tracking pixel.
Based on the tutorial found at
https://www.airpair.com/javascript/node-js-tutorial.
## How to use
```
git clone git@github.com:thinkswan/express-tracking-dashboard.git
npm install
npm start
```
This will start a server at http://localhost:5000.
To watch the dashboard track visits, open http://localhost:5000/track.gif in a
separate tab. Each time you refresh this new tab, the dashboard will log a new
visit.
## How to deploy
Click the button below to spin up your own copy of the app in a Heroku
instance.
[](https://heroku.com/deploy)
## How it works
The server (`server.js`) runs an Express app that uses Socket.IO to emit a
`visit` event each time the `/track.gif` URL is hit.
The client app (`app.js`) listens for the `visit` event and appends an element
with the visitor's details (time, IP, and user agent) to the dashboard.
The app is stateless, so refreshing the dashboard will clear all visits.
## License
MIT