Skip to content

wszlosek/django-celery-frege-poc

 
 

Repository files navigation

Alt text


issues pull-requests

license

Table of Contents

About

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.

Getting Started

Prerequisites

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.

⚠️ When installing on Linux, please remember of post-installation steps!

Installation

⚠️ Every command needs to be run from the root of the project!

Follow these simple instruction to set up a development environment:

  1. Create .env file by following .env.template template. Simply run:
cp .env.template .env
  1. Build Docker container with following command:

⚠️ On older versions of Docker, you may need to substitute docker compose with docker-compose.

docker compose --profile dev build

Usage

Running application in dev environment:

docker compose --profile dev up

After running application in dev profile, check these sites:

  • localhost:3030 - front-end application
  • localhost:3000 - Grafana (use search to find dashboards)
  • localhost:5555 - Flower
  • localhost:8000 - back-end application

Running 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

Contributing

Linters

This project employs a number of linters and formatters for overall DX.

⚠️ 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):

  1. Install python packages:

pip install -r backend/requirements.txt

  1. Install npm packages:
cd frontend
npm install
  1. Install pre-commit git hook:
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

Commit message convention

In order to unify the commit messages creation strategy, it is strongly recommended adhering to conventional commits.

Documentation

⚠️ For in-depth description of the tool please refer to the Design Document.

Some information also can be found in:

About

Proof of concept for FREGE system refactor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 72.4%
  • Python 11.2%
  • TypeScript 5.4%
  • Java 3.7%
  • JavaScript 1.3%
  • SCSS 1.1%
  • Other 4.9%