Skip to content

Application for generating grafana reports related to contributions from multiple git repositories

License

Notifications You must be signed in to change notification settings

maneike/codeStats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues MIT License


Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. License
  5. Contact
  6. Known issues and basic troubleshooting

About The Project

Code stats is a project that allows you to make reports of git repositories. With these reports you can see the how someone contributes to a project and many more.

(back to top)

Built With

PreactDjangonginxRedisPostgreSQLDockerGrafana

(back to top)

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

This is an example of how to list things you need to use the software and how to install them.

  • docker & docker-compose
sudo apt install docker docker-compose
  • /backend/.env
check .env.example

Installation

  1. Clone the repo
git clone https://github.com/maneike/codeStats.git
  1. Add .env to /backend/
check .env.example
  1. Build with docker compose
docker compose up --build
  1. In new terminal
docker compose run backend python3 manage.py makemigrations
docker compose run backend python3 manage.py migrate
  1. Optional
docker compose run backend python3 manage.py createsuperuser

(back to top)

Usage

To start the project after building

docker compose up

To stop the project

docker compose down -v

(back to top)

App

Logo

For more examples, please refer to the Documentation

(back to top)

API

Request

POST /api/url/

{
  "receivers": ["email@example.com"],
  "mergedUrls": [
    {
      "old": {
        "name": "PRA2021-PRA2022",
        "url": "https://github.com/WitMar/PRA2021-PRA2022.git"
      },
      "new": {
        "name": "PRA2021-PRA2022",
        "url": "https://github.com/WitMar/PRA2021-PRA2022.git"
      }
    }
  ]
}

Response (partial)

{
  "data": [
    {
      "repo_name": "PRA2021-PRA2022",
      "users": [
        {
          "name": "marcin witkowski",
          "email": "marcin.witkowski@e-qsg.com"
        },
        {
          "name": "THINK",
          "email": "witkowski.mar@gmail.com"
        }
      ],
      "languages": ["Java"]
    }
  ]
}

Request

POST /api/merged/

{
  "repo_name": "PRA2021-PRA2022",
  "merged_users": [
    {
      "old_name": "marcin witkowski",
      "old_email": "marcin.witkowski@e-qsg.com",
      "new_name": "marcin witkowski",
      "new_email": "marcin.witkowski@e-qsg.com"
    },
    {
      "old_name": "THINK",
      "old_email": "witkowski.mar@gmail.com",
      "new_name": "THINK",
      "new_email": "witkowski.mar@gmail.com"
    },
    {
      "old_name": "Tomasz Zietkiewicz",
      "old_email": "tomek.zietkiewicz@gmail.com",
      "new_name": "Tomasz Zietkiewicz",
      "new_email": "tomek.zietkiewicz@gmail.com"
    }
  ],
  "languages": ["Java"]
}

Response

{
  "ok": "Raport jest w trakcie tworzenia"
}

Request

GET /api/report/:{repo_name}/

Response (partial)

{
  "branches": [
    {
      "branch_name": "HEAD",
      "commits": [
        {
          "author": "marcin witkowski",
          "branch": "HEAD",
          "date": "2020-10-18 16:24:11+02:00",
          "message": "Initial commit",
          "changed_files": [
            {
              "file_name": "pom.xml",
              "changes": {
                "insertions": 11,
                "deletions": 0,
                "lines": 11
              }
            },
            {
              "file_name": "src/main/java/introduction/HelloWorld.java",
              "changes": {
                "insertions": 8,
                "deletions": 0,
                "lines": 8
              }
            }
          ]
        }
      ]
    }
  ]
}

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Project Link: https://github.com/maneike/codeStats

(back to top)

Known issues and basic troubleshooting

  • Depending on your system, you might need to change CLRF to LF in the .env and Dockerfile/compose files. This can be done easily in VSCode by right clicking on the file and selecting "Change End of Line Sequence" and then selecting LF.

(back to top)

About

Application for generating grafana reports related to contributions from multiple git repositories

Resources

License

Stars

Watchers

Forks

Packages

No packages published