FREGE is an open-source application dedicated to analyzing other open-source repositories available on Github, Gitlab ect. for various metrics like average number of lines of code, average cyclomatic complexity, token count or number of devs per project.
The main goal is to gather largest database of code metrics in order to analyze them (with little help of ML) to extract hidden patterns to what makes successful project overall.
Docker Desktop for your preferred system (Linux/Windows/Mac) is recommended way to get Docker with Compose plugin which are only prerequisites to run Frege project.
:warning: When installing on Linux, please remember of post-installation steps!
:warning: Every command needs to be run from the root of the project!
Follow these simple instruction to set up a development environment:
.env
file by following .env.template
template. Simply run:cp .env.template .env
:warning: On older versions of Docker, you may need to substitute docker compose with docker-compose.
docker compose --profile dev build
Running application in dev environment:
docker compose --profile dev up
After running application in dev profile, check these sites:
localhost:3030
- front-end applicationlocalhost:3000
- Grafana (use search to find dashboards)localhost:5555
- Flowerlocalhost:8000
- back-end applicationRunning tests for the application:
docker compose exec -T fregepoc-backend-dev pytest
Running application in prod environment (use with caution):
docker compose --profile prod up -d
This project employs a number of linters and formatters for overall DX.
:warning: To prevent common mistakes from being committed and pushed to the origin it is highly recommended to register git hooks configured via
pre-commit
. For this operation pip and npm will be needed. \ Alternatively, you can use extensions (such as prettier or black) to format your code in your IDE without installing anything more. However, with pip and npm already installed, pre-commit approached is more recommended.
There are three linters/formatters for Python: flake8
, isort
, black
; and there are two for Javascript/TypeScript: prettier
, eslint
.
In order to install pre-commit git-hook, run commands (recommended with venv previously created):
pip install -r backend/requirements.txt
For more information about development of BE please refer to backend/README.md
cd frontend
npm install
pre-commit install
Now, every commit will be formatted automatically. On rare occasions (such as line length) manual adjustments might be needed.
To run the linters and formatters over the entire codebase with pre-commit
, execute the following command:
pre-commit run --all-files
In order to unify the commit messages creation strategy, it is strongly recommended adhering to conventional commits.
:warning: For in-depth description of the tool please refer to the Design Document.
Some information also can be found in: