# vaibhav-crux/resume-matcher-project architecture

> Architecture diagram of the GitHub repository vaibhav-crux/resume-matcher-project, 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/vaibhav-crux/resume-matcher-project
- Repository: https://github.com/vaibhav-crux/resume-matcher-project

## Overview

##### Project Type and Purpose
- This is a full-stack web application that provides job posting, resume upload/parsing, and AI-based resume matching features.
- The backend is built with Django, exposing a REST API, and the frontend is an interactive Streamlit application. The application is containerized using Docker/Docker Compose for an easy deployment workflow.

##### Analyzing the File Structure for Architectural Insights
- Django Project (resume_analyzer/): Contains separate Django “apps” for candidates_resume (resume uploads and parsing), job_posting (job management), and resume_matcher (matching logic) – this implies a modular design where each app is a distinct component within the backend.
- Streamlit Frontend (streamlit_app/): This contains the entry point for the interactive dashboard that interacts with the Django API.
- Auxiliary directories: “media” (for storing uploaded resumes), “logs” (for application logging), and a “common” folder (for shared settings/error handling) highlight practical design elements for file handling and error management.

##### Key Infrastructure Components
a. Django Backend Container:
- Components include the REST API endpoints, business logic for job posting, resume management, matching logic, and database interaction (SQLite for development).
- Multiple Django apps are clearly delineated:
- candidates_resume for handling resume uploads and parsing,
- job_posting for job listings,
- resume_matcher for calculating matching scores.
b. Streamlit Frontend Container:
- Provides the user interface for interacting with all backend services.
- Uses the API exposed by the Django backend.
c. Database:
- SQLite is used for simplicity, and it’s integrated within the Django container.
d. External AI Service:
- The system integrates with an external AI API (referenced by an AI_API_KEY) for scoring and matching resumes.
e. Docker Compose Orchestrator:
- Manages multiple containers including separate ones for Django and Streamlit.

##### Relationships and Interactions
- The Streamlit app communicates to the Django backend over RESTful API endpoints (e.g., job posting requests, resume uploads, matching processes).
- Django serves as the intermediary for processing requests, interacting with its models (in each app), and storing/updating data (including resume files in the media folder).
- The AI API, which is keyed via environment variables, is used within the Django backend (likely in the resume_matcher app) to compute matching scores.
- Log files and media storage folders indicate an operational flow for recording key activities and storing user-uploaded data.

##### Architectural Patterns & Principles
- Modular Design: The separation of concerns across Django apps (candidates_resume, job_posting, resume_matcher) illustrates use of a modular, MVC-based approach typical in Django projects.
- Containerization: Use of Docker and a docker-compose configuration shows an emphasis on environment consistency and scalability.
- RESTful API Design: Clear API endpoints for job posting, resume uploading, and matching, as detailed in the README.
- External Service Integration: The explicit configuration for an AI API in the .env shows that the system is designed to consume and rely on external — but integral — services.

##### Elements
- Use clear labels for:
- “Django Backend” with sub-modules: Candidates Resume, Job Posting, Resume Matcher.
- “Streamlit Frontend”.
- “SQLite Database”.
- “External AI API”.
- “Docker Compose Orchestrator”.
- API calls from the Streamlit Frontend to the Django Backend.
- Database interactions between Django and SQLite.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Top Level Orchestrator
    comp["Docker Compose Orchestrator"]:::docker
    click comp "https://github.com/vaibhav-crux/resume-matcher-project/blob/master/docker-compose.yml"

    %% Containers managed by Docker Compose
    comp --> st["Streamlit Frontend Container"]:::container
    comp --> djn["Django Backend Container"]:::container
    click st "https://github.com/vaibhav-crux/resume-matcher-project/blob/master/streamlit_app/app.py"
    click djn "https://github.com/vaibhav-crux/resume-matcher-project/tree/master/resume_analyzer/"

    %% Django Backend Components Subgraph
    subgraph "Django Backend Components"
        dcr["Candidates Resume App"]:::app
        click dcr "https://github.com/vaibhav-crux/resume-matcher-project/tree/master/resume_analyzer/candidates_resume/"
        djp["Job Posting App"]:::app
        click djp "https://github.com/vaibhav-crux/resume-matcher-project/tree/master/resume_analyzer/job_posting/"
        drm["Resume Matcher App"]:::app
        click drm "https://github.com/vaibhav-crux/resume-matcher-project/tree/master/resume_analyzer/resume_matcher/"
        
        subgraph "Shared/Common"
            ds["Django Settings"]:::app
            click ds "https://github.com/vaibhav-crux/resume-matcher-project/blob/master/resume_analyzer/resume_analyzer/settings.py"
            ce["Error Handling"]:::app
            click ce "https://github.com/vaibhav-crux/resume-matcher-project/tree/master/resume_analyzer/resume_analyzer/common/"
        end
    end

    %% Link Django container to its internal components
    djn --> dcr
    djn --> djp
    djn --> drm
    djn --> ds
    djn --> ce

    %% Media Storage for resume uploads
    dcr -->|"StoreResumes"| media["Media Storage"]:::media
    click media "https://github.com/vaibhav-crux/resume-matcher-project/tree/master/resume_analyzer/media/resumes/"

    %% Database interaction
    djn -->|"CRUD"| db["SQLite Database"]:::database

    %% External AI API integration from Resume Matcher
    drm -->|"CalculateMatch"| api["External AI API"]:::external

    %% Frontend API call to Django Backend
    st -->|"REST_API"| djn

    %% Container Configuration Subgraph
    subgraph "Container Configurations"
        dd["Django Docker Config"]:::config
        click dd "https://github.com/vaibhav-crux/resume-matcher-project/blob/master/Dockerfile.django"
        sd["Streamlit Docker Config"]:::config
        click sd "https://github.com/vaibhav-crux/resume-matcher-project/blob/master/Dockerfile.streamlit"
        env["Environment Config (.env)"]:::config
        click env "https://github.com/vaibhav-crux/resume-matcher-project/blob/master/.env.example"
    end

    %% Link Docker Compose to Container Configurations
    comp --- dd
    comp --- sd
    comp --- env

    %% Styles
    classDef docker fill:#f9dcdc,stroke:#b04f4f,stroke-width:2px;
    classDef container fill:#dcedc1,stroke:#689f38,stroke-width:2px;
    classDef app fill:#bbdefb,stroke:#0d47a1,stroke-width:2px;
    classDef database fill:#ffe082,stroke:#f57f17,stroke-width:2px;
    classDef external fill:#c5e1a5,stroke:#558b2f,stroke-width:2px;
    classDef media fill:#d1c4e9,stroke:#311b92,stroke-width:2px;
    classDef config fill:#f8bbd0,stroke:#ad1457,stroke-width:2px;
```
