Reportr

你人生的仪表盘。(Your life's personal dashboard.)

Github星跟蹤圖

Reportr

“你生命中的个人仪表盘”

Reportr 是一个完整的应用程序,它的工作原理类似于一个仪表板,用于跟踪您生活中的事件(使用一个非常简单的 API)。通过一个简单的界面,它可以帮助您跟踪和显示您的在线活动或实际活动(使用硬件跟踪器或像 Runkeeper 之类的应用程序)。在这个组织中有一些跟踪器可用。

该项目完全是开源的,您可以在自己的服务器或 Heroku 上托管自己的 Reportr 实例。

开始你的实例

Reportr 非常容易在本地或与 heroku 兼容的服务上运行。

$ git clone https://github.com/Reportr/dashboard.git
$ npm install

要在本地运行,您应该使用 foreman(配置可以存储在 .env 文件中):

$ foreman start

在 Heroku 上部署它:

$ heroku config:set MONGODB_URL=mongodb://...
$ heroku config:set AUTH_USERNAME=...
$ heroku config:set AUTH_PASSWORD=...
$ git push heroku master

API和事件

Reportr 使用 HTTP REST API 来跟踪事件。数据总是 JSON 编码的。

Endpoint HTTP Method 说明 参数
/api/infos GET Get 获取有关此实例的信息
/api/types GET 返回所有事件类型
/api/events POST 发布一个新事件 <string>type, <object>properties
/api/events GET 列出所有事件 <string>type, <int>start(0), <int>limit
/api/stats/categories GET 获取分类事件统计信息 <string>type,<string>field
/api/stats/time GET 获取时间统计信息 <string>type,<string>fields, <string>interval, <string>func
/api/reports POST 创建一个新的报告 <string>title
/api/reports GET 列出所有报告
/api/report/:id PUT 更新报告 <string>title, <array>visualizations
/api/report/:id DELETE 删除报告
/api/alerts GET 列出所有警报
/api/alerts POST 创建一个警报 <string>type, <string>eventName, <string>condition, <string>title

特殊事件

Name Description Properties
reportr.alert Triggered when an alert is triggered <string>type, <string>eventName

组态

Reportr 使用环境变量进行配置。

名称 说明
PORT 端口用于运行应用程序,默认值为5000
MONGODB_URL mongoDB数据库的 Url
REDIS_URL (可选)当使用工作模式时,Url为redis数据库
AUTH_USERNAME 认证的用户名
AUTH_PASSWORD 用于身份验证的密码

有关警报配置的信息,请参阅类型。

活动

一个事件表示要在一个确定的日期进行监视。例如,如果我正在监视家中的温度,我会发一个事件 home.temperature 属性温度:

$ curl -X POST -H "Content-Type: application/json" --data '{ "type":"home.temperature", "properties": { "temperature": 66 } }' http://localhost:5000/api/events

可视化

可视化是显示数据的配置方式,例如在饼图,条形图或时间图中。

类型

Type(类型) 说明

模板

可视化接受模板作为大部分渲染选项。模板使用 lodash 的 _.template 方法处理,具有一些特殊的功能:

  • $.date(date): returns a beautiful date

警报

Reportr 允许您配置在特定条件在特定时间间隔内有效时触发的警报。

类型

类型 说明 配置
webhook 将 HTTP 请求发送到一个特定的 url,该 url 的数据编码在正文中
mail 发送电子邮件通知 <string>MAIL_SERVICE, <string>MAIL_USERNAME, <string>MAIL_PASSWORD, <string>MAIL_FROM
sms 发送短信通知 <string>TWILIO_SID, <string>TWILIO_TOKEN, <string>TWILIO_FROM

条件

提醒条件非常易于编写,例如:COUNT>9,如果在警报间隔中至少有10个事件发布,则此条件将有效。条件也可以使用事件对象,例如:event.temperature> 80。

跟踪器

说明 链接
Google Chrome Navigation https://github.com/Reportr/tracker-googlechrome
家庭环境(温度,湿度,光照) https://github.com/Reportr/tracker-home-ambient
计算机的内存和CPU https://github.com/Reportr/tracker-machine
电池数据 https://github.com/hughrawlinson/tracker-machine-battery

扩展

Reportr 可以很容易地在 Heroku(和兼容机)上进行扩展,使用 REDIS_URL 在 worker 和 web 进程之间启用一个任务队列。

(First edition: vz edited at 2019.08.29)

概覽

名稱與所有者Reportr/dashboard
主編程語言JavaScript
編程語言JavaScript (語言數: 3)
平台Heroku, Linux, Mac, Windows
許可證Apache License 2.0
發布數18
最新版本名稱3.5.1 (發布於 )
第一版名稱v1.0.0 (發布於 )
創建於2013-10-06 10:01:47
推送於2015-10-21 03:18:50
最后一次提交2015-05-08 19:05:19
星數2.6k
關注者數111
派生數237
提交數276
已啟用問題?
問題數64
打開的問題數10
拉請求數8
打開的拉請求數3
關閉的拉請求數6
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?

Reportr

"Your life's personal dashboard."

Deploy

Reportr is a complete application which works like a dashboard for tracking events in your life (using a very simple API). With a simple interface, it helps you track and display your online activity or your real-life activity (with hardware trackers or applications like Runkeeper), some trackers are available on this organization.

The project is entirely open source and you can host your own Reportr instance on your own server or Heroku.

Screen Preview

Start your instance

Reportr is really easy to run locally or on heroku-compatible services.

$ git clone https://github.com/Reportr/dashboard.git
$ npm install .

To run it locally, you should use foreman (configuration can be stored in a .env file):

$ foreman start

To deploy it on Heroku:

$ heroku config:set MONGODB_URL=mongodb://...
$ heroku config:set AUTH_USERNAME=...
$ heroku config:set AUTH_PASSWORD=...
$ git push heroku master

API and Events

Reportr uses an HTTP REST API to track events. Datas are always JSON encoded.

Endpoint HTTP Method Description Arguments
/api/infos GET Get informations about this instance
/api/types GET Return all event types
/api/events POST Post a new event <string>type, <object>properties
/api/events GET List all events <string>type, <int>start(0), <int>limit
/api/stats/categories GET Get categorized events stats <string>type,<string>field
/api/stats/time GET Get time stats <string>type,<string>fields, <string>interval, <string>func
/api/reports POST Create a new report <string>title
/api/reports GET List all reports
/api/report/:id PUT Update a report <string>title, <array>visualizations
/api/report/:id DELETE Remove a report
/api/alerts GET List all alerts
/api/alerts POST Create an alert <string>type, <string>eventName, <string>condition, <string>title

Special Events

Name Description Properties
reportr.alert Triggered when an alert is triggered <string>type, <string>eventName

Configuration

Reportr is configured using environment variables.

Name Description
PORT Port for running the application, default is 5000
MONGODB_URL Url for the mongoDB database
REDIS_URL (Optional) Url for a redis database when using worker mode
AUTH_USERNAME Username for authentication
AUTH_PASSWORD Password for authentication

See types for informations about alert configurations.

Events

An event represent something to monitor at a defined date. For example if I'm monitoring the temperature in my home, I'll post an event home.temperature with a property temp:

$ curl -X POST -H "Content-Type: application/json" --data '{ "type":"home.temperature", "properties": { "temperature": 66 } }' http://localhost:5000/api/events

Visualizations

A visualization is a configured way to show data, for example in a pie, bar chart or time graph.

Types

Type Description

Templates

Visualizations accept templates as most of rendering options. Template are processed using lodash's _.template method with some special functions:

  • $.date(date): returns a beautiful date

Alerts

Reportr lets you configure alerts to be triggered when specific condition is valid at a specific interval.

Types

Type Description Configuration
webhook Post an HTTP request to a specific url with the data encoded in the body
mail Send an email notification <string>MAIL_SERVICE, <string>MAIL_USERNAME, <string>MAIL_PASSWORD, <string>MAIL_FROM
sms Send a text message notification <string>TWILIO_SID, <string>TWILIO_TOKEN, <string>TWILIO_FROM

Condition

Condition for alerts are really easy to write, for example: COUNT > 9, this condition will be valid if at least 10 events have been posted in the alert interval. Conditions can also use the event object, for example: event.temperature > 80.

Trackers

Description Link
Google Chrome Navigation https://github.com/Reportr/tracker-googlechrome
Home ambient (temperature, humidity, light) https://github.com/Reportr/tracker-home-ambient
Memory and CPU of computer https://github.com/Reportr/tracker-machine
Battery data https://github.com/hughrawlinson/tracker-machine-battery

Scale it

Reportr can easily be scaled on Heroku (and compatibles), use the REDIS_URL to enable a task queue between workers and web processes.

去到頂部