GIT Contribution Tracker

Project: Git Contribution Tracker Tech Stack Used: Java Maven Dependencies: Apache POI Google gson External API's: Gitlab API Telegram API Project Description: This project can be able to find out the contributions made by a specifice user or a group of users. We built this project for our institution to track the trainee's contribution count on gitlab. Inputs: An Excel File that contains, +---------------+---------------+ |Personal Access| Gitlab | | token | username | +---------------+---------------+ | asdas-asd-as23| example_234 | +---------------+---------------+ This order is important. Output: +---------------+---------------+-----------------+ |Personal Access| Gitlab | | | token | username | 24-April-2025 | +---------------+---------------+-----------------+ | asdas-asd-as23| example_234 | 2 Contributions | +---------------+---------------+-----------------+ and also the contributions count for each person in the excel file will be send to the telegram group via bot. Project flow: Three class are coded in this project. GetUserProjects. Excelsample TelegramIntegration Write to the excel file. GetUserProjects. This is starting point of this project which contains main(String[] args) method. First of all it creates a object for Excelsample class & invoke the readfile() method. Thus method prompts the user to enter the filepath(excel file contains user gitlab info). After the user input it tries to open the file from the path, if its not found it will throws and an Exception called FileNotFoundException. If it is present, then it collects the user info in the nested arrayList like [["asd-asd-we2", "example2-32"],]. Then it returns the list to the main method. Main starts to iterate over the list and make an HTTP request on every iterations to get the user events on gitlab through GITLAB API. HTTP Client, HTTP Request, HTTP Response are the class plays the role of API between gitab and our project. Once the loop was ended we had all the user contribution info and write it to the excel file with today date. And It sends the info to a telegram channel through a telegram bot. Excelsample. It contains all the logic to read & write an excel file. import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFRow; import org.apache.poi.xssf.usermodel.XSSFCell; These are all the classes we had used to read & write to the excel file. TelegramIntegration. This class contains code for connecting the telegram bot with out project. Basically it is HTTP Request with query params & values to https://api.telegram.org/ endpoint . Gitlab Repo link : https://gitlab.com/vasudevan-repo/gitlab/-/tree/main/GitAutomation/src/main/java/main/GitAutomation?ref_type=heads If you note any issue or improvements in our code, Please reach to us, it helps us lot !

May 2, 2025 - 10:55
 0
GIT Contribution Tracker

Project: Git Contribution Tracker

git

Tech Stack Used:

Java
Maven

Dependencies:

Apache POI
Google gson

External API's:

Gitlab API
Telegram API

Project Description:

This project can be able to find out the contributions made by a specifice user or a group of users.

We built this project for our institution to track the trainee's contribution count on gitlab.

Inputs:

An Excel File that contains,

+---------------+---------------+
|Personal Access| Gitlab        |
|     token     | username      |
+---------------+---------------+
| asdas-asd-as23| example_234   |
+---------------+---------------+

This order is important.

Output:

+---------------+---------------+-----------------+
|Personal Access| Gitlab        |                 |
|     token     | username      | 24-April-2025   |
+---------------+---------------+-----------------+
| asdas-asd-as23| example_234   | 2 Contributions |
+---------------+---------------+-----------------+

and also the contributions count for each person in the excel file will be send to the telegram group via bot.

Project flow:

Three class are coded in this project.

  1. GetUserProjects.
  2. Excelsample
  3. TelegramIntegration
  4. Write to the excel file.

  5. GetUserProjects.

This is starting point of this project which contains main(String[] args) method.

First of all it creates a object for Excelsample class & invoke the readfile() method.

Thus method prompts the user to enter the filepath(excel file contains user gitlab info).

After the user input it tries to open the file from the path, if its not found it will throws and an Exception called FileNotFoundException.

If it is present, then it collects the user info in the nested arrayList like [["asd-asd-we2", "example2-32"],].

Then it returns the list to the main method. Main starts to iterate over the list and make an HTTP request on every iterations to get the user events on gitlab through GITLAB API.

HTTP Client, HTTP Request, HTTP Response are the class plays the role of API between gitab and our project.

Once the loop was ended we had all the user contribution info and write it to the excel file with today date.

And It sends the info to a telegram channel through a telegram bot.

  1. Excelsample.

It contains all the logic to read & write an excel file.

import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFCell;

These are all the classes we had used to read & write to the excel file.

  1. TelegramIntegration.

This class contains code for connecting the telegram bot with out project.

Basically it is HTTP Request with query params & values to https://api.telegram.org/ endpoint .

Gitlab Repo link : https://gitlab.com/vasudevan-repo/gitlab/-/tree/main/GitAutomation/src/main/java/main/GitAutomation?ref_type=heads

If you note any issue or improvements in our code, Please reach to us, it helps us lot !