A command-line tool to industrialize web quality measurement.
Scodi is a tool that centralize the use of famous web quality measurement services (Google Lighthouse, GreenIT Analysis or Mozilla Observatory) in a unique CLI.
With his modular approach, it makes easy to process the analysis results into a database to track metrics over time, or send them into a communication tool like Slack.
Moreover the command-line interface allows a smooth integration into a CI/CD chain.
Exemple scenario:
scodi
Slack channel when the analysis is over.Install the packages
npm install @scodi/lighthouse @scodi/slack @scodi/mysql
Set the credentials for Slack (API key) and MySQL (database URL)
echo SCODI_SLACK_ACCESS_TOKEN=xoxb-rest-of-token >> .env
echo SCODI_MYSQL_DATABASE_URL=login:password@127.0.0.1:3306 >> .env
Create a Slack channel named scodi
and a database with the same name.
Start the analysis
npx scodi lighthouse --config '{"url":"https://www.ipcc.ch/"}'
Once the analysis is over, you will receive a Slack notification to quickly identify what can be improved:
And the results will be stored in a report
table, which you can exploit with tools like Grafana:
For more options, have a look at the help by using npx scodi -h
Scodi is also available as a Docker image.
With the example scenario given previously, the Docker image is used as follow:
docker run --rm\
--env SCODI_SLACK_ACCESS_TOKEN=xoxb-rest-of-token\
--env SCODI_MYSQL_DATABASE_URL=login:password@127.0.0.1:3306\
fabernovel/heart:latest\
lighthouse --config '{"url":"https://www.ipcc.ch"}' --only-listeners=mysql,slack
If you're using GitHub, you can simplify the integration of Scodi in your CI scripts by using the GitHub Action.
With the example scenario given previously, the GitHub Action is used as follow:
- uses: faberNovel/heart-action@v4
with:
analysis_service: lighthouse
listener_services_only: mysql,slack
mysql_database_url: ${{ secrets.MYSQL_DATABASE_URL }}
SCODI_SLACK_ACCESS_TOKEN: ${{ secrets.SCODI_SLACK_ACCESS_TOKEN }}
Scodi has been designed to be as light as possible, which explains its modular approach: you only install what you need.
To do so, Scodi is divided in 3 types of packages.
Type | Mission | Example |
---|---|---|
Runner | Starts an analysis | using the CLI or the HTTP API |
Analysis | Analyzes URLs using third-party services | using GreenIT Analysis |
Listener | Do thing with the results of the analysis | send them into a Slack channel |
The minimum setup you need to run Scodi, is to have the Scodi CLI runner module and a single analysis module.
Name | Type | Purpose | |
---|---|---|---|
Scodi API | Runner | Exposes an HTTP API that starts an analysis when it is requested | |
Scodi CLI | Runner | Control the other modules by using a CLI | |
Scodi GreenIT | Analysis | Analyzes URLs with GreenIT Analysis | |
Scodi Lighthouse | Analysis | Analyzes URLs with Google Lighthouse | |
Scodi Observatory | Analysis | Analyzes URLs with Mozilla Observatory | |
Scodi SSL Labs Server | Analysis | Analyzes URLs with Qualys SSL Labs Server | |
Scodi MySQL | Listener | Stores the results of the analysis into a MySQL database | |
Scodi Slack | Listener | Sends the results of the analysis to a Slack channel |