Skip to content

Commit

Permalink
Merge branch 'release/3.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
electerious committed Jun 27, 2021
2 parents 264df73 + a9926dc commit 4d8bf15
Show file tree
Hide file tree
Showing 407 changed files with 7,835 additions and 7,208 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

strategy:
matrix:
node-version: [14.x,15.x]
node-version: [14.x, 16.x]
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,26 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [3.1.0] - 2021-06-27

> ⚠️ Contains breaking changes in the GraphQL API
This release contains a refactored front-end that takes advantage of the GraphQL API that has been a part of Ackee since version 2. Better caching and instant domain, event and permanent token updates. And: An active visitor counter that updated periodically without reloading the UI.

### Added

- Views and duration details: Click on a chart bar on the overview and insights page to see more details
- Percentage changes of average views and duration in the facts panel
- Active visitors counter updates periodically without reloading the UI
- Tooltips for text in lists (#266)

### Changed

- `DomainStatistics` and `EventStatistics` (GraphQL API) now contain a unique id field
- `View`, `Duration` and `EventChartEntry` (GraphQL API) now contain their date in a `value` field in the format: YYYY, YYYY-MM or YYYY-MM-DD. The format depends on the chosen interval.
- `DomainStatistics` and `EventStatistics` (GraphQL API) now contain a unique id in the `id` field. The previous data has been renamed to `value`, because it was never unique and therefore shouldn't be named `id`.
- `averageViews` and `averageDuration` (GraphQL API) are now types and don't contain the values directly

## [3.0.6] - 2021-04-02

### Changed
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ Get Ackee up and running…
- […with Netlify](docs/Get%20started.md#with-netlify)
- […with Vercel](docs/Get%20started.md#with-vercel)
- […with Heroku](docs/Get%20started.md#with-heroku)
- […with Qovery](docs/Get%20started.md#with-qovery)
- […with Render](docs/Get%20started.md#with-render)
- […with Railway](docs/Get%20started.md#with-railway)

And configure Ackee and your server correctly…

Expand Down Expand Up @@ -92,6 +94,8 @@ I am working hard on continuously developing and maintaining Ackee. Please consi
- [gridsome-plugin-ackee](https://github.com/DenzoNL/gridsome-plugin-ackee) - Gridsome plugin for Ackee
- [vuepress-plugin-ackee](https://github.com/spekulatius/vuepress-plugin-ackee) - VuePress plugin for Ackee
- [svelte-ackee](https://github.com/gaia-green-tech/svelte-ackee) - Svelte module for Ackee
- [ackee_dart](https://github.com/marchellodev/ackee_dart) - Ackee plugin for Dart/Flutter ([pub.dev](https://pub.dev/packages/ackee_dart))


### Links

Expand Down
2 changes: 1 addition & 1 deletion dist/index.css

Large diffs are not rendered by default.

602 changes: 576 additions & 26 deletions dist/index.js

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions docs/Get started.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ The node server shows you the UI and receives the request from all of your sites
- [With Netlify](#with-netlify)
- [With Vercel](#with-vercel)
- [With Heroku](#with-heroku)
- [With Qovery](#with-qovery)
- [With Render](#with-render)
- [With Railway](#with-railway)

## With Docker Compose

Expand Down Expand Up @@ -237,6 +239,28 @@ git push heroku master

After your application re-deploys you'll have the latest version of Ackee!

## With Qovery

[Qovery](https://qovery.com) is a fully-managed cloud platform that runs on your AWS, GCP, Azure and Digital Ocean account where you can host static sites, backend APIs, databases, cron jobs, and all your other apps in one place.

### 1. Create a Qovery account.

Visit the [Qovery dashboard](https://console.qovery.com) to create an account if you don't already have one.

### 2. Create a project

Click on "Create a new project" and give a name to your project.

### 3. Add an application

Click on "Create an application" then choose "I have an application" and select your GitHub or GitLab repository where your Ackee app is located.

Select "MongoDB" service then choose a version. Give the database a name and continue with "Next".

Click on "Deploy".

Chat with Qovery developers on [Discord](https://discord.qovery.com) if you need help.

## With Render

You can use [Render's](https://render.com/) one-click deploy button to get up and running with Ackee in minutes.
Expand All @@ -246,3 +270,11 @@ Click **Deploy to Render** below and follow the prompts to set up Ackee on Rende
[![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)](https://render.com/deploy?repo=https://github.com/render-examples/ackee)

Once your deploy has finished, you are ready to start using Ackee! Visit the URL for your service to login. You can get your login credentials from the `ACKEE_USERNAME` and `ACKEE_PASSWORD` environment variables in the **Environment** tab of your service. By default, your username will be `render` and your password will be a randomly generated string.

## With Railway

You can use the [Railway](https://railway.app/) button for a one-click deployment and have Ackee running within minutes.

[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new?template=https%3A%2F%2Fgithub.com%2Frailwayapp%2Fexamples%2Ftree%2Fmaster%2Fexamples%2Fackee&plugins=mongodb&envs=ACKEE_USERNAME%2CACKEE_PASSWORD)

Upon clicking the button, you will be asked to set the `ACKEE_USERNAME` and `ACKEE_PASSWORD` environment variables. Once you do that, everything should just work on it's own. Railway will automatically provision the MongoDB database for you and also link it to your Ackee deployment!
4 changes: 2 additions & 2 deletions docs/Privacy Policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ Although, we recommend to mention Ackee in your privacy policy. Let your visitor

```html
To get information about the behavior of our visitors, we use
<a href="https://ackee.electerious.com" target="_blank">Ackee</a>. This
<a href="https://ackee.electerious.com" target="_blank" rel="noopener noreferrer">Ackee</a>. This
analytics software gives us insight about our visitors only in general, but not
about individuals per se, as it does not track visitors and does not store any
personal identifiable information.
<a href="https://docs.ackee.electerious.com/#/docs/Anonymization" target="_blank">Go
<a href="https://docs.ackee.electerious.com/#/docs/Anonymization" target="_blank" rel="noopener noreferrer">Go
to their documentation</a> to find out what Ackee collects.
```

Expand Down
66 changes: 28 additions & 38 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ackee",
"private": true,
"version": "3.0.6",
"version": "3.1.0",
"authors": [
"Tobias Reich <[email protected]>"
],
Expand Down Expand Up @@ -29,65 +29,61 @@
"build": "node build.js",
"server": "node src/index.js",
"coveralls": "nyc report --reporter=lcov",
"test": "nyc ava",
"lint": "eslint '{functions,src,test}/**/*.js'"
"test": "npm run lint && nyc ava",
"lint": "eslint \"{functions,src,test}/**/*.js\""
},
"dependencies": {
"ackee-tracker": "^5.1.0",
"apollo-server-lambda": "^2.21.2",
"apollo-server-micro": "^2.21.2",
"apollo-server-lambda": "^2.25.1",
"apollo-server-micro": "^2.25.1",
"apollo-server-plugin-http-headers": "^0.1.4",
"date-fns": "^2.19.0",
"date-fns-tz": "^1.1.3",
"date-fns": "^2.22.1",
"date-fns-tz": "^1.1.4",
"debounce-promise": "^3.1.2",
"dotenv": "^8.2.0",
"dotenv": "^10.0.0",
"graphql": "^15.5.0",
"graphql-scalars": "^1.9.0",
"graphql-tools": "^7.0.4",
"graphql-scalars": "^1.10.0",
"graphql-tools": "^7.0.5",
"is-url": "^1.2.4",
"micro": "^9.3.4",
"microrouter": "^3.1.3",
"mongoose": "^5.12.1",
"mongoose": "^5.12.14",
"node-fetch": "^2.6.1",
"node-schedule": "^2.0.0",
"normalize-url": "^5.0.0",
"normalize-url": "^6.0.1",
"request-ip": "^2.1.3",
"sanitize-filename": "^1.6.3",
"signale": "^1.4.0",
"uuid": "^8.3.2"
},
"devDependencies": {
"@electerious/eslint-config": "^1.4.0",
"@apollo/client": "^3.3.20",
"@electerious/eslint-config": "^2.0.3",
"ava": "3.15.0",
"classnames": "^2.2.6",
"classnames": "^2.3.1",
"coveralls": "^3.1.0",
"eslint": "^7.22.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-react": "^7.22.0",
"eslint": "^7.29.0",
"eslint-plugin-ava": "^12.0.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-react-native": "^3.9.1",
"formbase": "^12.0.1",
"eslint-plugin-unicorn": "^33.0.1",
"formbase": "^12.0.2",
"history": "^5.0.0",
"human-number": "^1.0.6",
"husky": "^4.3.8",
"immer": "^8.0.1",
"mocked-env": "^1.3.2",
"mocked-env": "^1.3.4",
"mongodb-memory-server": "^6.9.6",
"nodemon": "^2.0.7",
"normalize.css": "^8.0.1",
"nyc": "^15.1.0",
"prop-types": "^15.7.2",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-error-boundary": "^3.1.1",
"react": "^17.0.2",
"react-apollo-network-status": "^5.0.1",
"react-dom": "^17.0.2",
"react-fast-compare": "^3.2.0",
"react-hotkeys-hook": "^3.2.1",
"react-redux": "^7.2.2",
"react-use": "^17.2.1",
"redux": "^4.0.5",
"redux-devtools-extension": "^2.13.9",
"redux-thunk": "^2.3.0",
"rosid-handler-js-next": "^1.0.0",
"react-hotkeys-hook": "^3.3.2",
"react-use": "^17.2.4",
"rosid-handler-js-next": "^1.0.1",
"rosid-handler-sass": "^8.0.0",
"s-ago": "^2.2.0",
"shortid": "^2.2.16",
Expand All @@ -112,12 +108,6 @@
"src"
]
},
"husky": {
"hooks": {
"pre-push": "npm run build:pre",
"pre-commit": "npm run lint"
}
},
"engines": {
"node": ">= 14"
}
Expand Down
8 changes: 3 additions & 5 deletions src/aggregations/aggregateActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ const intervals = require('../constants/intervals')
const matchEvents = require('../stages/matchEvents')

module.exports = (ids, average, interval, limit, dateDetails) => {

const aggregation = [
matchEvents(ids),
{
$group: {
_id: {}
}
}
_id: {},
},
},
]

aggregation[0].$match.created = { $gte: dateDetails.includeFnByInterval(interval)(limit) }
Expand All @@ -27,5 +26,4 @@ module.exports = (ids, average, interval, limit, dateDetails) => {
if (matchYear === true) aggregation[1].$group._id.year = { $year: dateExpression }

return aggregation

}
8 changes: 3 additions & 5 deletions src/aggregations/aggregateActiveVisitors.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@ const { DURATIONS_LIMIT, DURATIONS_INTERVAL } = require('../constants/durations'
const matchDomains = require('../stages/matchDomains')

module.exports = (ids, dateDetails) => {

const aggregation = [
matchDomains(ids),
{
$count: 'count'
}
$count: 'count',
},
]

// A user that navigates between pages will increase the counter temporary.
// It's therefore importend to count unique views only.
aggregation[0].$match.clientId = {
$exists: true,
$ne: null
$ne: null,
}

// Ignore users that are on the page for too long
Expand All @@ -26,5 +25,4 @@ module.exports = (ids, dateDetails) => {
aggregation[0].$match.updated = { $gte: dateDetails.lastMilliseconds(DURATIONS_INTERVAL * 2) }

return aggregation

}
10 changes: 4 additions & 6 deletions src/aggregations/aggregateDurations.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const projectMinInterval = require('../stages/projectMinInterval')
const matchLimit = require('../stages/matchLimit')

module.exports = (ids, interval, limit, dateDetails) => {

const aggregation = [
matchDomains(ids),
projectDuration(),
Expand All @@ -17,10 +16,10 @@ module.exports = (ids, interval, limit, dateDetails) => {
$group: {
_id: {},
count: {
$avg: '$duration'
}
}
}
$avg: '$duration',
},
},
},
]

aggregation[0].$match.created = { $gte: dateDetails.includeFnByInterval(interval)(limit) }
Expand All @@ -35,5 +34,4 @@ module.exports = (ids, interval, limit, dateDetails) => {
if (matchYear === true) aggregation[4].$group._id.year = { $year: dateExpression }

return aggregation

}
20 changes: 9 additions & 11 deletions src/aggregations/aggregateNewActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,32 @@
const matchEvents = require('../stages/matchEvents')

module.exports = (ids, limit) => {

const aggregation = [
matchEvents(ids),
{
$group: {
_id: {
key: '$key'
key: '$key',
},
count: {
$sum: '$value'
$sum: '$value',
},
created: {
$first: '$created'
}
}
$first: '$created',
},
},
},
{
$sort: {
created: -1
}
created: -1,
},
},
{
$limit: limit
}
$limit: limit,
},
]

aggregation[0].$match.key = { $ne: null }

return aggregation

}
Loading

1 comment on commit 4d8bf15

@vercel
Copy link

@vercel vercel bot commented on 4d8bf15 Jun 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.