Skip to content

Commit 965cd68

Browse files
committed
Initial commit; All of the project
0 parents  commit 965cd68

25 files changed

+13361
-0
lines changed

.gitignore

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
6+
# Runtime data
7+
pids
8+
*.pid
9+
*.seed
10+
11+
# Directory for instrumented libs generated by jscoverage/JSCover
12+
lib-cov
13+
14+
# Coverage directory used by tools like istanbul
15+
coverage
16+
17+
# nyc test coverage
18+
.nyc_output
19+
20+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
21+
.grunt
22+
23+
# node-waf configuration
24+
.lock-wscript
25+
26+
# Compiled binary addons (http://nodejs.org/api/addons.html)
27+
build/Release
28+
29+
# Dependency directories
30+
node_modules
31+
jspm_packages
32+
33+
# Optional npm cache directory
34+
.npm
35+
36+
# Optional REPL history
37+
.node_repl_history
38+
39+
# 0x
40+
profile-*
41+
42+
# mac files
43+
.DS_Store
44+
45+
# vim swap files
46+
*.swp
47+
48+
# webstorm
49+
.idea
50+
51+
# vscode
52+
.vscode
53+
*code-workspace
54+
55+
# clinic
56+
profile*
57+
*clinic*
58+
*flamegraph*
59+
60+
# generated code
61+
examples/typescript-server.js
62+
test/types/index.js

README.md

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# crash-processor
2+
3+
## Requirements
4+
5+
- [Docker](https://www.docker.com/)
6+
- [docker-compose](https://docs.docker.com/compose/)
7+
8+
## Usage
9+
10+
- Clone the repository
11+
- In the repository root directory, run `docker-compose up` and wait for everything to start
12+
- The API can be found at `localhost:3000`
13+
14+
## Sending a crash report
15+
16+
To test with a crash report, you can use:
17+
18+
```
19+
curl --location --request POST 'localhost:3000/crash-reports' \
20+
--header 'Content-Type: application/json' \
21+
--data-raw '{
22+
"projectId": "1234",
23+
"severity": "error",
24+
"message": "An error occurred",
25+
"stacktrace": [
26+
{
27+
"file": "Crash.java",
28+
"method": "crashyMethod",
29+
"line": 10
30+
},
31+
{
32+
"file": "Main.java",
33+
"method": "main",
34+
"line": 5
35+
}
36+
],
37+
"metadata": {
38+
"customField": "customValue",
39+
"customEntity": {
40+
"id": "123",
41+
"description": "Sample metadata"
42+
}
43+
}
44+
}'
45+
```
46+
47+
## Getting crash reports stats
48+
49+
To get stats about a project, you can run:
50+
51+
```
52+
curl --location --request GET 'localhost:3000/crash-reports/1234'
53+
```

crash-processor-api/.env

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
REDIS_HOST=redis
2+
REDIS_PORT=6379
3+
REDIS_PASSWORD=pw123
4+
CRASH_REPORTS_QUEUE=crashReports

crash-processor-api/.eslintrc.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module.exports = {
2+
env: {
3+
commonjs: true,
4+
es6: true,
5+
node: true,
6+
},
7+
extends: [
8+
'airbnb-base',
9+
],
10+
globals: {
11+
Atomics: 'readonly',
12+
SharedArrayBuffer: 'readonly',
13+
},
14+
parserOptions: {
15+
ecmaVersion: 2018,
16+
},
17+
rules: {
18+
'no-unused-vars': 'off'
19+
},
20+
};

crash-processor-api/Dockerfile

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM node:lts-alpine
2+
3+
WORKDIR /usr/crash-processor-api
4+
5+
COPY package.json yarn.lock .env ./
6+
7+
RUN yarn
8+
9+
COPY src/ ./src
10+
11+
ENTRYPOINT yarn start

0 commit comments

Comments
 (0)