The TRACE tool, developed as part of my Bachelor's thesis in Computer Science at the University of Salerno, is designed to analyse GitHub repositories, with the main purpose of calculating the Cultural Dispersion in a community of developers. The main challenge lies in identifying a developer's Culture from the limited information provided by a GitHub account. This identification is crucial, since it is subsequently used in the calculation of Cultural Dispersion, through the application of Shannon's Index.
The tool has been designed with a client-server structure, exploiting the potential of two modern technologies: React
for the front-end and Flask
for the back-end. Flask processes requests by exploiting mathematical formulas, artificial intelligence techniques, predictive models and API calls to an online service to ensure the processing of an accurate result.
For more details, we recommend reading the Thesis, in Italian.
client
directory: client based on React.server
directory: server based on Flask.thesis
directory: Thesis.
- Memory: minimum of 16 GB RAM to support in-memory loading of ML model.
- Internet connection: required for API calls.
Clone the repository.
-
Download and Configure Assets
- Download the TRACE_ML_ASSETS archive containing the directories,
models
andvectorizers
. - Transfer
models
andvectorizers
directories to theserver
directory.
- Download the TRACE_ML_ASSETS archive containing the directories,
-
Create
.env
file- Create a file called
.env
in theserver
directory. - Add the following variables, populating it with the specified credentials:
GITHUB_API_TOKEN="" OPENAI_API_KEY="" OPENAI_ORGANIZATION_ID="" GOOGLE_API_KEY=""
. It is important to note that entering these configuration credentials is optional. However, by entering them all, the tool will be able to operate to its full potential.
- Create a file called
-
Create Virtual Environment
venv
- Navigate to the
server
directory and run:python -m venv venv
.
- Navigate to the
-
Start the virtual environment
venv
- Still in the
server
directory, run:venv\Scripts\activate
.
- Still in the
-
Dependencies Installation
- Still in the
server
directory, run:pip install -r requirements.txt
.
- Still in the
-
Dependencies Installation
- Navigate to the
client
directory and run:npm install
.
- Navigate to the
-
Communication Port Configuration
- The React client, by default, connects to the Flask server on port
5000
. - If necessary, change the
proxy
variable in thepackage.json
file in theclient
directory:"proxy": "http://127.0.0.1:5000"
.
- The React client, by default, connects to the Flask server on port
-
Start the virtual environment
venv
- Navigate to the
server
directory and run:venv\Scripts\activate
.
- Navigate to the
-
Start the Flask server
- Still in the
server
directory, run:flask run
. Make sure the server is running on port5000
.
- Still in the
- Start the React client
- Navigate to the
client
directory and run:npm start
. The application will start automatically in the default browser.
- Navigate to the
Once the client and server are started, the web interface of TRACE can be accessed.
To analyse a repository:
- Enter the repository in the input field using the
OWNER/NAME
format. - Click the
submit
button. - During processing, a loader will be shown. When processing is complete, detailed results or an error message will be shown.
- The server
logs
can be consulted to monitor the processing.
Il tool TRACE, sviluppato nell'ambito della mia Tesi di Laurea in Informatica presso l'Università degli Studi di Salerno, è progettato per analizzare le repository GitHub, con lo scopo principale di effettuare il calcolo della Dispersione Culturale in una comunità di sviluppatori. La sfida principale risiede nell'identificazione della Cultura di uno sviluppatore, a partire dalle limitate informazioni fornite da un account GitHub. Tale identificazione è fondamentale, poiché è utilizzata, successivamente, nel calcolo della Dispersione Culturale, mediante l'applicazione dell'Indice di Shannon.
Il tool è stato progettato con una struttura client-server sfruttando le potenzialità di due moderne tecnologie: React
per il front-end e Flask
per il back-end. Flask elabora le richieste sfruttando formule matematiche, tecniche di Intelligenza Artificiale, cinque modelli predittivi e chiamate API a servizio online per assicurare l'elaborazione di un risultato accurato.
Per maggiori approfondimenti si consiglia la lettura della Tesi, in italiano.
- directory
client
: client basato su React. - directory
server
: server basato su Flask. - directory
thesis
: Tesi di Laurea.
- Memoria: minimo 16 GB di RAM per supportare il caricamento in memoria del modello di ML.
- Connessione Internet: necessaria per le chiamate API.
Effettuare il clone della repository.
-
Download e Configurazione Assets
- Scaricare l'archivio TRACE_ML_ASSETS contenente le directory,
models
evectorizers
. - Trasferire le directory
models
evectorizers
nella directoryserver
.
- Scaricare l'archivio TRACE_ML_ASSETS contenente le directory,
-
Creazione file
.env
- Creare un file denominato
.env
nella directoryserver
. - Aggiungere le seguenti variabili, popolandolo con le credenziali specifiche:
GITHUB_API_TOKEN="" OPENAI_API_KEY="" OPENAI_ORGANIZATION_ID="" GOOGLE_API_KEY=""
. È importante notare che l'inserimento di tali credenziali è facoltativo. Tuttavia, inserendole tutte, il tool sarà in grado di operare al massimo delle potenzialità.
- Creare un file denominato
-
Creazione Ambiente Virtuale
venv
- Navigare fino alla directory
server
ed eseguire:python -m venv venv
.
- Navigare fino alla directory
-
Avviare l'ambiente virtuale
venv
- Sempre nella directory
server
, eseguire:venv\Scripts\activate
.
- Sempre nella directory
-
Installazione Dipendenze
- Sempre nella directory
server
, eseguire:pip install -r requirements.txt
.
- Sempre nella directory
-
Installazione Dipendenze
- Navigare fino alla directory
client
ed eseguire:npm install
.
- Navigare fino alla directory
-
Configurazione Porta di Comunicazione
- Il client React, di default, si connette al server Flask sulla porta
5000
. - Se necessario, modificare la variabile
proxy
nel filepackage.json
nella directoryclient
:"proxy": "http://127.0.0.1:5000"
.
- Il client React, di default, si connette al server Flask sulla porta
-
Avviare l'ambiente virtuale
venv
- Navigare fino alla directory
server
ed eseguire:venv\Scripts\activate
.
- Navigare fino alla directory
-
Avviare il server Flask
- Sempre nella directory
server
, eseguire:flask run
. Assicurarsi che il server sia in esecuzione sulla porta5000
.
- Sempre nella directory
- Avviare il client React
- Navigare fino alla directory
client
ed eseguire:npm start
. L'applicazione verrà avviata automaticamente nel browser predefinito.
- Navigare fino alla directory
Una volta avviati client e server, è possibile accedere all'interfaccia web di TRACE.
Per analizzare una repository:
- Inserire la repository nel campo di input usando il formato
OWNER/NAME
. - Cliccare il pulsante
submit
. - Durante l'elaborazione, verrà mostrato un loader. Al termine dell'elaborazione, verranno mostrati i risultati dettagliati o un messaggio di errore.
- I
log
del server possono essere consultati per monitorare il processo di elaborazione.