SpringForge Architecture Classifier is the data collection, feature extraction, and machine learning training pipeline used to automatically detect the architectural style of Spring Boot projects:
- MVC Architecture
- Layered Architecture
- Clean Architecture
This repository powers the architecture prediction backend used by the SpringForge IntelliJ Plugin, enabling architecture-aware code generation using LLMs.
This repository provides:
Collect thousands of Spring Boot repositories using keyword & time-range-based crawling.
Extract 58 high-signal architecture features using staticAnalyzer.py.
Generate high-quality supervised datasets for model training.
A complete notebook for:
- Data exploration
- Visualization
- Preprocessing
- Dimensionality reduction (PCA)
- Model training & tuning (RandomForest)
- Model export
Used directly by the production FastAPI backend & IntelliJ plugin.
SPRINGFORGE-ARCHITECTURE-CLASSIFIER/
│
├── Data Extraction/
│ ├── Scripts/
│ │ ├── staticAnalyzer.py
│ │ ├── architecture_features_advanced.csv
│ │ ├── architecture_features_v2.csv
│
├── Data Gathering \ Scripts/
│ ├── collect_repos.py
│
├── Machine Learning Pipeline/
│ ├── Final Dataset/
│ │ ├── balanced_architecture_dataset.csv
│ │ ├── balanced_architecture_final.csv
│
├── Notebook Files/
│ ├── SpringForge_Architecture_Prediction.ipynb
│ ├── SpringForge_Code_Generation.ipynb
│
└── README.md
File: collect_repos.py
Automatically collects and organizes Spring Boot repositories based on:
- Keywords
- Year slicing
- Stars & relevance
- Pagination & rate limiting
File: staticAnalyzer.py
Extracts 58 features, including:
- Layer inference
- Cross-layer dependency counts
- Spring stereotype usage
- JPA + domain entities
- File-role detection
- LOC, class count, method count
- DTO indicators
- Spring Web, Data, Boot imports
Outputs:
architecture_features_v2.csv
architecture_features_advanced.csv
SpringForge_Architecture_Prediction.ipynb
Contains:
- EDA (distributions, correlations, imbalance analysis)
- Preprocessing + feature cleaning
- PCA dimensionality reduction
- RandomForest training
- Hyperparameter tuning
- Performance evaluation
- Model export (PCA + RF + scalers + encoders)
| Architecture | F1 Score |
|---|---|
| MVC | 0.94 |
| Layered | 0.92 |
| Clean | 0.89 |
Overall: 0.91 macro F1
Located under:
Machine Learning Pipeline / Final Dataset/
balanced_architecture_final.csvbalanced_architecture_dataset.csv
Both contain:
- 6000 MVC samples
- 6000 Layerated samples
- 6000 Clean samples
Stored in:
Trained Artifacts/
These include:
scaler.pklpca_encoder.pklrf_pca_model.pkllabel_encoder.pkl
Used later by the SpringForge backend (FastAPI) & plugin.
python collect_repos.pypython staticAnalyzer.pyOpen Notebook → run all cells.
Artifacts automatically saved under Trained Artifacts.
MIT License (or your preferred license)
Pull requests, issue reports, and feature suggestions are welcome.
This project powers the SpringForge ecosystem, enabling automated architecture-aware Spring Boot project generation and analysis.