Skip to content

Commit a82b4ce

Browse files
authored
Merge pull request #1 from iFixit/port-lighthouse-docker
2 parents a5023a4 + e3f1df1 commit a82b4ce

11 files changed

+1618
-4
lines changed

.env.template

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
DD_API_KEY=
2+
DD_APP_KEY=

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,10 @@ node_modules/
2929

3030
# VSCode Misc.
3131
.vscode
32+
33+
# Config Files
34+
urls.json
35+
metrics-config.json
36+
37+
# TSC Output
38+
dist

README.md

+32-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,33 @@
1-
# vigilo
1+
# Vigilo
2+
🚧 Still in development 🚧
3+
24
Vigilo is a monitoring tool that automates Lighthouse audits and sends key metrics to Datadog. Designed to keep a vigilant eye on your web application's performance and accessibility.
5+
6+
### Setup
7+
1. Clone the repo
8+
2. Run `pnpm install`
9+
3. Run `pnpm run build`
10+
4. Run `cp .env.template .env`
11+
5. Add your Datadog API key and Datadog Application key to the `.env` file
12+
6. Run `cp urls.example.json urls.json`
13+
7. Add your URLs to the `urls.json` file
14+
8. Run `cp metrics.example.json metrics.json`
15+
9. Add the metrics you want to send to Datadog to the `metrics.json` file
16+
17+
⚠️ If you are setting this up on a Windows machine via WSL, then you will need to run the following commands to ensure the correct linux dependencies are installed:
18+
**Make sure dependencies are up to date**
19+
```
20+
sudo apt update && sudo apt -y upgrade && sudo apt -y autoremove
21+
```
22+
**Download and Install Chrome**
23+
```
24+
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
25+
sudo apt -y install ./google-chrome-stable_current_amd64.deb
26+
```
27+
**Check Chrome was Successfully Installed**
28+
```
29+
google-chrome --version
30+
```
31+
32+
### Usage
33+
1. After setup, run `pnpm start` to run vigilo and send metrics to Datadog

metrics-config.example.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"audits": [
3+
"largest-contentful-paint",
4+
"first-contentful-paint",
5+
"cumulative-layout-shift",
6+
"total-blocking-time",
7+
"speed-index",
8+
"total-byte-weight",
9+
"server-response-time",
10+
"is-crawlable",
11+
"screenshot-thumbnails"
12+
]
13+
}

package.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"type": "module",
88
"scripts": {
99
"start": "node dist/index.js",
10-
"build": "tsc",
10+
"clean": "rm -rf dist",
11+
"build": "pnpm clean && tsc",
1112
"test": "echo \"Error: no test specified\" && exit 1"
1213
},
1314
"keywords": [],
@@ -17,5 +18,11 @@
1718
"@tsconfig/node18": "^18.2.1",
1819
"@types/node": "^20.5.9",
1920
"typescript": "^5.2.2"
21+
},
22+
"dependencies": {
23+
"@datadog/datadog-api-client": "^1.16.0",
24+
"dotenv": "^16.3.1",
25+
"lighthouse": "^11.1.0",
26+
"puppeteer": "^21.2.1"
2027
}
2128
}

0 commit comments

Comments
 (0)