Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/florianjs/js-click-counter
JCC is a simple but yet useful Click Counter written in JS. Data are stored with the Realtime Firebase Database.
https://github.com/florianjs/js-click-counter
axios click counter firebase javascript tracker
Last synced: 13 days ago
JSON representation
JCC is a simple but yet useful Click Counter written in JS. Data are stored with the Realtime Firebase Database.
- Host: GitHub
- URL: https://github.com/florianjs/js-click-counter
- Owner: florianjs
- License: mit
- Created: 2020-06-27T13:33:45.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-06-27T13:52:09.000Z (over 4 years ago)
- Last Synced: 2024-01-01T18:21:37.720Z (11 months ago)
- Topics: axios, click, counter, firebase, javascript, tracker
- Language: JavaScript
- Homepage: https://icesofty.github.io/JS-Click-Counter
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![JS x Firebase](https://i.imgur.com/yul6hNy.png)
# Click Counter
JCC (JS Click Counter) is a simple and easy to use click counter.
Let your visitors share a like on your website, keep track of downloads and count how many time a link has been clicked with a single lightweight JS file.
## Install
```html
```
**JCC use Axios**
```html```
```html
Send some ❤️
```## Firebase Settings
**JCC work better with Firebase Realtime Database.**
1 - Create a Firebase account
https://firebase.google.com/2 - Add a New Project to Firebase
3 - Create a new Realtime Database
Add two childs to your Database :
```
your-project
|
|--firstChild
| |
| |--counter: 0 // For your "love" counter
|
|--secondChild
|
|--trackDownloads: 0 // For your "Downloads" counter
```Edit your .js file with your own informations :
```js
// If you want to add a "love" counter
const firesbase = "https://your-project.firebaseio.com/firstChild.json";// If you want to add a "Downloads" counter
const firesbaseDownload =
"https://your-project.firebaseio.com/secondChild.json";
```## Recommanded Firebase rules
```json
{
"rules": {
"firstChild": {
".read": true,
".write": "data.exists() && newData.exists()",
"counter": {
".validate": "newData.val() == data.val() + 1"
}
},"secondChild": {
".read": true,
".write": "data.exists() && newData.exists()",
"trackDownloads": {
".validate": "newData.val() == data.val() + 1"
}
}
}
}
```