# rakshitkhajuria/job-recomendation architecture

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

- Interactive diagram: https://gitdiagram.com/rakshitkhajuria/job-recomendation
- Repository: https://github.com/rakshitkhajuria/job-recomendation

## Overview

##### Project Type & Purpose
- The project is a full-stack, data-driven job recommendation system. Its core purpose is to bridge the gap between job seekers and recruiters by using advanced technologies like Optical Character Recognition (OCR) and Natural Language Processing (NLP) to process resumes and job postings.
- The README and file tree indicate that the application is built using Python with a Streamlit front-end, integrating modules for data collection, preprocessing, recommendation logic, and additional features like resume analysis.

##### File Structure
- Key directories/components:
- Top-level modules:
- JobRecommendation folder: Contains all the core backend modules (e.g., animation, config, courses, NLP preprocessing via text_preprocessing, utilities, and sidebar management) which encapsulate business logic.
- MongoDB_function subdirectory: Houses utility functions for interactions with MongoDB and managing database operations.
- Data Directory:
- Contains CSV files of preprocessed, concatenated, and KNN-based structured data, indicating that the project uses file-based persistence along with MongoDB.
- Notebook Directory:
- Contains Jupyter notebooks related to data concatenation, experimentation, OCR, and even an OCR demo—useful for prototyping and analysis.
- Pages Directory:
- Contains Streamlit pages (e.g., Candidate, Recruiter, Resume Analyzer), demonstrating the multi-page front-end structure for different user roles.
- Documentation Directory:
- Contains high-level, low-level architecture design documents and wireframes that might provide more insights for in-depth diagramming.
- Configuration Files:
- Dockerfile, .gitignore, requirements.txt, and setup.py indicate deployment and dependency management.

##### Main Components and Their Relationships
- Frontend/UI Layer (Streamlit):
- Components include the HOME.py and multiple page scripts (e.g., for candidates, recruiters, resume analyzer).
- These pages interact with the backend to display recommendations, analytics, resume details, and visual components (using sidebar, animations, lottie, etc.).

- Backend/Processing Layer:
- Core business logic is encapsulated in the JobRecommendation module:
- OCR Module: Processes uploaded resumes into text (as evident from OCR notebooks and README explanation).
- NLP and Preprocessing: Modules like text_preprocessing convert text inputs into tokens, remove stop words, lemmatize, and possibly extract bigrams.
- Recommendation Engine: Utilizing processed resume data (computed similarity against preprocessed job postings) to recommend jobs and candidates.
- Utility Modules: For supporting tasks like distance_calculation and course recommendations.
- Animation and UI components: Modules like animation.py, sidebar.py, and side_logo.py provide enhanced UI elements.

- Data Layer:
- Database: MongoDB (along with separate collections as mentioned: Resume_Data, all_locations_Data, preprocessed_jobs_Data, Resume_from_CANDIDATE, and Resume_from_RESUME_ANALYZER).
- Data Files: CSV files stored within data/concatenated_data and scrapped_data directories. Indicate interaction between preprocessing modules and file-based data stores.

- External Services & Integration:
- Cloud build/deployment: Docker and Streamlit configurations indicate container/pipeline layers.
- Possibly represent external libraries like OCR and NLP libraries (e.g., if using Tesseract or similar) that support these processing steps.

##### Architectural Patterns & Design Principles
- Separation of concerns is applied between UI (front-end), processing (business logic with OCR, NLP, and recommendation), and data storage (MongoDB and CSV files).
- Modular design as indicated by the clear split into different directories for utilities, configuration, and functionalities.
- Pipeline flow from resume upload → OCR conversion → NLP processing → recommendation generation.

- Clearly labeled nodes for each module/component.
- Frontend (Streamlit) → Backend modules (OCR, NLP, Recommendation Engine).
- Backend modules ↔ Data Layer (MongoDB and CSV files).
- External Service Integration (Apify for data scraping).
- Annotations or notes that detail architectural patterns like modular separation, the use of pipelines (OCR → NLP → ML Recommendation), and integration with external APIs.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Frontend (Streamlit Pages)
    subgraph "Frontend (Streamlit Pages)"
        Home("Home (Streamlit)"):::frontend
        Candidate("Candidate Page"):::frontend
        Resume("Resume Analyzer"):::frontend
        Recruiter("Recruiter Page"):::frontend
    end

    %% Backend / Processing
    subgraph "Backend / Processing"
        OCR("OCR Module"):::backend
        NLP("NLP & Preprocessing"):::backend
        Rec("Recommendation Engine"):::backend
        UIAnim("UI Enhancement Modules"):::backend
    end

    %% UI Enhancement Components
    subgraph "UI Enhancement Components"
        Animation("Animation"):::backend
        Lottie("Lottie Animation"):::backend
        SideLogo("Side Logo"):::backend
        Sidebar("Sidebar"):::backend
    end

    %% Data Storage
    subgraph "Data Storage"
        CSV1("Concatenated CSV Files"):::storage
        CSV2("Scrapped CSV Files"):::storage
        Mongo("MongoDB Database"):::storage
    end

    %% External Services
    subgraph "External Services"
        Apify("Apify Data Scraping"):::external
    end

    %% Prototyping & Documentation
    subgraph "Prototyping & Documentation"
        Notebooks("Experimentation Notebooks"):::prototype
        Docs("Design & Documentation"):::prototype
    end

    %% UI Flow Connections
    Home -->|"loads"| OCR
    Candidate -->|"uploadsResume"| OCR
    Resume -->|"analyzesResume"| OCR
    Recruiter -->|"requestsRec"| Rec

    %% Backend Processing Flow
    OCR -->|"OCRoutput"| NLP
    NLP -->|"processedText"| Rec
    Rec -->|"recResults"| Home
    Rec -->|"recResults"| Candidate
    Rec -->|"recResults"| Recruiter

    %% UI Enhancement Integration
    UIAnim --> Home
    UIAnim --> Candidate
    UIAnim --> Resume
    UIAnim --> Recruiter
    Animation --> UIAnim
    Lottie --> UIAnim
    SideLogo --> UIAnim
    Sidebar --> UIAnim

    %% Data Layer Interactions
    NLP -->|"readsCSV"| CSV1
    Rec -->|"writesCSV"| CSV1
    Rec -->|"writesCSV"| CSV2
    Rec -->|"dbQueries"| Mongo

    %% External Services Data Injection
    Apify -->|"feedsData"| CSV1
    Apify -->|"feedsData"| CSV2
    Apify -->|"feedsData"| Mongo

    %% Prototyping & Documentation Influence
    Notebooks -->|"prototype"| OCR
    Notebooks -->|"prototype"| NLP
    Notebooks -->|"prototype"| Rec
    Docs -->|"guidance"| Rec
    Docs -->|"guidance"| UIAnim

    %% Click Events for Frontend
    click Home "https://github.com/rakshitkhajuria/job-recomendation/blob/main/HOME.py"
    click Candidate "https://github.com/rakshitkhajuria/job-recomendation/blob/main/pages/👨‍🎓 I AM A CANDIDATE.py"
    click Resume "https://github.com/rakshitkhajuria/job-recomendation/blob/main/pages/📝 RESUME ANALYZER.py"
    click Recruiter "https://github.com/rakshitkhajuria/job-recomendation/blob/main/pages/🧑🏻‍🏫 I AM A RECRUITER.py"

    %% Click Events for OCR Module (multiple references)
    click OCR "https://github.com/rakshitkhajuria/job-recomendation/blob/main/notebook/ocr.py"
    click OCR "https://github.com/rakshitkhajuria/job-recomendation/blob/main/notebook/ocr+base64_for_cv.ipynb"
    click OCR "https://github.com/rakshitkhajuria/job-recomendation/blob/main/notebook/ocr_demo.ipynb"

    %% Click Event for NLP & Preprocessing Module
    click NLP "https://github.com/rakshitkhajuria/job-recomendation/blob/main/JobRecommendation/text_preprocessing.py"

    %% Click Event for Recommendation Engine & Business Logic
    click Rec "https://github.com/rakshitkhajuria/job-recomendation/tree/main/JobRecommendation/"

    %% Click Events for UI Enhancement Components
    click Animation "https://github.com/rakshitkhajuria/job-recomendation/blob/main/JobRecommendation/animation.py"
    click Lottie "https://github.com/rakshitkhajuria/job-recomendation/blob/main/JobRecommendation/lottie_animation.py"
    click SideLogo "https://github.com/rakshitkhajuria/job-recomendation/blob/main/JobRecommendation/side_logo.py"
    click Sidebar "https://github.com/rakshitkhajuria/job-recomendation/blob/main/JobRecommendation/sidebar.py"

    %% Click Event for MongoDB Integration
    click Mongo "https://github.com/rakshitkhajuria/job-recomendation/tree/main/JobRecommendation/MongoDB_function/"

    %% Click Events for File-based Data Storage
    click CSV1 "https://github.com/rakshitkhajuria/job-recomendation/tree/main/data/concatenated_data/"
    click CSV2 "https://github.com/rakshitkhajuria/job-recomendation/tree/main/data/scrapped_data/"

    %% Click Events for Experimentation & Documentation
    click Notebooks "https://github.com/rakshitkhajuria/job-recomendation/tree/main/notebook/"
    click Docs "https://github.com/rakshitkhajuria/job-recomendation/tree/main/documents/"

%% Styles
classDef frontend fill:#f8b400,stroke:#000,stroke-width:2px;
classDef backend fill:#85bb65,stroke:#000,stroke-width:2px,stroke-dasharray: 5 5;
classDef storage fill:#1f77b4,stroke:#000,stroke-width:2px;
classDef external fill:#ff7f0e,stroke:#000,stroke-width:2px;
classDef prototype fill:#d62728,stroke:#000,stroke-width:2px;
```
