Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ script:
- npm run lint
- npm run test:check-coverage
after_script:
# - npm run report-coverage
- npm run report-coverage
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
[![logo](https://i.imgur.com/3OtP3p8.png)](https://softwareengineeringdaily.com/)

# SEDaily Event Stream Processor
# SEDaily Logging, Monitoring, and Analytics

The real time event processing infrastructure gateway server for the Software Engineering Daily [Android](https://github.com/SoftwareEngineeringDaily/SEDaily-Android), [iOS](https://github.com/SoftwareEngineeringDaily/se-daily-iOS), and [web front end](https://github.com/SoftwareEngineeringDaily/sedaily-front-end). The SEDaily event stream is responsible for authenticating connecting clients and validating event payload schemas before putting the event on the SED event bus. Interested clients can subscribe to events on the stream.
The real time event processing infrastructure gateway server for the Software Engineering Daily [Android](https://github.com/SoftwareEngineeringDaily/SEDaily-Android), [iOS](https://github.com/SoftwareEngineeringDaily/se-daily-iOS), and [web front end](https://github.com/SoftwareEngineeringDaily/sedaily-front-end). The SEDaily event stream is responsible for validating event payload schemas before putting the event into InfluxDB. The resulting database is queried using Grafana to get up to the second analytics reporting.


<a href="https://travis-ci.org/SoftwareEngineeringDaily/sedaily-devops"><img src="https://travis-ci.org/SoftwareEngineeringDaily/sedaily-devops.svg?branch=develop"></img></a>
<div>
<a href="https://travis-ci.org/SoftwareEngineeringDaily/sedaily-devops"><img src="https://travis-ci.org/SoftwareEngineeringDaily/sedaily-devops.svg?branch=develop"></img></a>
<img src="https://wt-1364ed7c3f0364e6608ffd3c14d53518-0.run.webtask.io/coverage-badge" hspace="10"></img>
</div>

## Getting Started
```sh
$ git clone https://github.com/SoftwareEngineeringDaily/sedaily-event-stream.git
$ cd sedaily-event-stream
$ git clone https://github.com/SoftwareEngineeringDaily/sedaily-devops.git
$ cd sedaily-devops
```

### Set up (local)
<!-- Temporarily commented out until Redis Streams is in merged into the master branch - Install and run a local [Redis](https://github.com/antirez/redis) client -->
- Install and run a local [InfluxDB](https://github.com/influxdata/influxdb) client
- `cp .env.local_example .env`
- `npm install` or `yarn install`
Expand All @@ -26,10 +27,6 @@ $ cd sedaily-event-stream
- Run `docker-compose up`
- If dependencies are updated in package.json, run `docker-compose down` and then `docker-compose up --build`. This will remove the old container and rebuild the API image which installs the new dependencies.

## Current State

The current state of the SEDaily event stream is analytics focused. The event stream backend relies on Redis Streams, which is only currently available in the [`unstable`](https://github.com/antirez/redis/tree/unstable) branch. Until it is stable, the SEDaily event stream will only directly input events into InfluxDB. Data analytics can be run against queries on the InfluxDB events database.

## Contributing
We use the develop branch to perform work in. Fork the project and clone it, create a branch off of develop and perform your changes. Then submit a pull request to merge your branch into the develop branch here. We have an active Slack community that you can reach out to for more information or just to chat with anyone. Check out the [<img src="https://upload.wikimedia.org/wikipedia/commons/7/76/Slack_Icon.png" alt="Slack Channel" width="20px"/> SED app development](https://softwaredaily.slack.com/app_redirect?channel=sed_app_development) slack channel. Also see the [Open Source Guide](https://softwareengineeringdaily.github.io/).

Expand Down
32 changes: 32 additions & 0 deletions config/lcov2badge.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const request = require('request');
const lcov2badge = require('lcov2badge');

const filePath = process.argv[2];

const options = {
filePath: filePath || './coverage/lcov.info',
warnThreshold: 80, // default is 80
koThreshold: 60, // default is 60
};

function sendCoverageBadge(coverageBadge) {
const requestOptions = {
method: 'post',
body: { coverageBadge, coverageBadgeToken: process.env.COVERAGE_BADGE_TOKEN },
json: true,
url: process.env.COVERAGE_BADGE_URL
};
request(requestOptions, (err, res, body) => {
if (err) {
throw err;
} else {
console.log(body.result); // eslint-disable-line no-console
}
});
}


lcov2badge.badge(options, (err, svgBadge) => {
if (err) throw err;
sendCoverageBadge(svgBadge);
});
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"test:watch": "npm run test -- --watch",
"test:coverage": "cross-env NODE_ENV=test ./node_modules/.bin/istanbul cover _mocha -- --ui bdd --reporter spec --colors --compilers js:babel-core/register tests --recursive",
"test:check-coverage": "npm run test:coverage && istanbul check-coverage",
"report-coverage": "coveralls < ./coverage/lcov.info"
"report-coverage": "node config/lcov2badge.js"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -103,7 +103,9 @@
]
},
"devDependencies": {
"lcov2badge": "^0.1.0",
"minimist": "^1.2.0",
"request": "^2.83.0",
"swagger-node-express": "^2.1.3"
}
}