# sohampati/alpfa-team2 architecture

> Architecture diagram of the GitHub repository sohampati/alpfa-team2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sohampati/alpfa-team2
- Repository: https://github.com/sohampati/alpfa-team2

## Overview

##### Project Type & Overview
- JobBuddy is a full-stack application that connects candidates with job opportunities using machine learning techniques. Its core functionality is to process resumes and job descriptions (via BERT embeddings and cosine similarity) and then match candidates with relevant job postings.
- The system is divided into three main parts: a Java Spring backend (located in the ms/ folder with Firebase integration), a modern frontend (in the alpfa-team2/ folder using React/Vue and built with Vite), and a Python-based text processing module (in the BertTokenizor folder using BERT tokenizer techniques).

a. Frontend Component:
- UI layer, which serves both candidate and employer functions.

b. Backend Component:
- Java Spring backend (ms/ folder) that hosts the core business logic and RESTful APIs.
- Sub-components such as Controllers (JobController, ResumeController, UserController), Services (JobService, ResumeService, UserService, MatchingService), and DTOs (JobDTO, ResumeDTO, UserDTO, etc.), which handle data transfer.
- Integration with Firebase as configured in FirebaseConfig.java and handled via ms/src/main/java/com/ms/jobBuddy/config/FirebaseConfig.java.

c. Text Processing / Machine Learning Component:
- Python-based BERT Tokenizer module (BertTokenizor folder) that is used to generate text embeddings and compute cosine similarity.
- Elements such as Jupyter Notebooks (e.g., for dataset analysis and Flask-Firebase interaction) that process input resumes and job descriptions.

##### Depicting Relationships & Interactions
- The Frontend interacts with the Backend by sending REST API calls (e.g., for authentication, resume upload, job posting creation, and job matching queries).
- The Backend, in turn, communicates with Firebase for data storage and user permission management.
- There is also an interaction (or integration point) between the Backend and the text processing module whereby resume/job description data is sent to the Python service to calculate similarity scores. (This could be a direct service call or an asynchronous process that feeds back into the backend matching algorithms.)
- Data flow labels such as “API calls,” “Data Processing,” “Firebase Storage,” and “ML Processing.”

##### Architectural Patterns & Design Principles
- The structure reflects an MVC (Model-View-Controller) pattern on the backend with clear separation of controllers, DTOs, and services.
- The frontend follows a component-driven design using frameworks like React and Vue (with Vite for build configuration).
- The system also encapsulates a microservice-like component for text processing, making the system modular and scalable.
- Use of industry-standard technologies: Java Spring for backend, React/Vue for frontend, and Python (BERT tokenizer) for ML processing, each with clearly defined responsibilities.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Subgraph
    subgraph "JobBuddy Frontend – React/Vue (alpfa-team2)"
        FE_Components["Components (src/components)"]:::frontend
        FE_Firebase["Firebase Integration (src/firebase)"]:::frontend
        FE_Main["Main & Config (main.jsx, vite.config.js, tailwind.config.js)"]:::frontend
    end

    %% Backend Subgraph
    subgraph "JobBuddy Backend – Java Spring with Firebase Integration (ms)"
        BE_App["Application Main (JobBuddyApplication.java)"]:::backend
        BE_Controller["Controllers (JobController, ResumeController, UserController)"]:::backend
        BE_Service["Services (JobService, MatchingService, ResumeService, UserService)"]:::backend
        BE_DTO["DTOs (JobDTO, ResumeDTO, UserDTO, Certifications, Education, Experience)"]:::backend
        BE_Config["FirebaseConfig (Firebase Integration)"]:::backend
    end

    %% Text Processing Subgraph
    subgraph "Text Processing – BERT Tokenizer (Python) (BertTokenizor)"
        ML_Dataset["Dataset Analysis (CV_JD_Kaggle_Dataset.ipynb)"]:::ml
        ML_Flask["ML Processing (Flask-Firebase.ipynb)"]:::ml
        ML_Readme["Documentation (Readme.md)"]:::ml
    end

    %% External Services
    Firebase["Firebase"]:::external

    %% Connections
    FE_Main -->|"API_calls"| BE_Controller
    BE_Controller -->|"DataProcessing"| BE_Service
    BE_Service -->|"MLProcessing"| ML_Flask
    ML_Flask -->|"SimilarityScores"| BE_Service
    BE_Config -->|"FirebaseStorage"| Firebase

    %% Click Events for Frontend
    click FE_Components "https://github.com/sohampati/alpfa-team2/tree/main/alpfa-team2/src/components"
    click FE_Firebase "https://github.com/sohampati/alpfa-team2/tree/main/alpfa-team2/src/firebase"
    click FE_Main "https://github.com/sohampati/alpfa-team2/blob/main/alpfa-team2/main.jsx"

    %% Click Events for Backend
    click BE_App "https://github.com/sohampati/alpfa-team2/blob/main/ms/src/main/java/com/ms/jobBuddy/JobBuddyApplication.java"
    click BE_Controller "https://github.com/sohampati/alpfa-team2/tree/main/ms/src/main/java/com/ms/jobBuddy/controller"
    click BE_DTO "https://github.com/sohampati/alpfa-team2/tree/main/ms/src/main/java/com/ms/jobBuddy/dto"
    click BE_Service "https://github.com/sohampati/alpfa-team2/tree/main/ms/src/main/java/com/ms/jobBuddy/service"
    click BE_Config "https://github.com/sohampati/alpfa-team2/blob/main/ms/src/main/java/com/ms/jobBuddy/config/FirebaseConfig.java"

    %% Click Events for Text Processing Module
    click ML_Dataset "https://github.com/sohampati/alpfa-team2/blob/main/BertTokenizor/CV_JD_Kaggle_Dataset.ipynb"
    click ML_Flask "https://github.com/sohampati/alpfa-team2/blob/main/BertTokenizor/Flask-Firebase.ipynb"
    click ML_Readme "https://github.com/sohampati/alpfa-team2/blob/main/BertTokenizor/Readme.md"

    %% Styles
    classDef frontend fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef backend fill:#AED6F1,stroke:#2471A3,stroke-width:2px;
    classDef ml fill:#D2B4DE,stroke:#8E44AD,stroke-width:2px;
    classDef external fill:#A9DFBF,stroke:#28B463,stroke-width:2px;
```
