# y-adepu/rfp_accelerator architecture

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

- Interactive diagram: https://gitdiagram.com/y-adepu/rfp_accelerator
- Repository: https://github.com/y-adepu/rfp_accelerator

## Overview

##### Project Type & Purpose
- The application is a full-stack system that accelerates the RFP/RFI process using Generative AI. It comprises multiple modules (Upload, Employee Matching, RFP Analyzer, Requirements Extraction, and Response Builder) to handle different parts of the proposal process.
- The use of AI (especially via Azure services such as Azure OpenAI, Document Intelligence, Cosmos DB, and Blob Storage) suggests that the system integrates state‐of‐the‐art external cloud services to process, analyze, and transform proposal-related documents.

##### Analyzing the File Structure
- There’s a clear separation into two main directories:
- “backend”: Contains Python modules (app.py, chat.py, chunking.py, etc.) that handle API endpoints, document processing (chunking, extraction), and supporting functions such as prompts and search functions.
- “front-end”: Contains a typical modern JavaScript project structure with React files (components, pages, styles, etc.) dedicated to different modules such as Employee Matching and RFP analysis interfaces.
- Additional files such as requirements.txt (for Python dependencies) and package.json (for JS dependencies) affirm the use of established technology stacks.
- Documentation material and scripts (like the resume-indexing.py) hint at additional operational support and supplementary processes.

##### Insights from the README
- The README calls out each module and lists the specific Azure services required, giving clear guidance on the external dependencies (Azure Blob Storage, Document Intelligence, OpenAI, Cosmos DB, and AI Search) for each module.

a. Main Components:
- Front-end Client:
- Represents the user interface built with React (components, pages, layout).
- Connects via HTTP/API calls to the backend.
- Back-end Server:
- Central API service (app.py) that routes various requests to specialized modules (chat, extraction, upload, search, etc.).
- Implements business logic and interacts with AI/analytics modules.
- External Azure Services:
- Azure Blob Storage & Document Intelligence for storage and document processing.
- Azure OpenAI for generating responses and performing analysis.
- Azure Cosmos DB for data persistence.
- Azure AI Search for searching and indexing capabilities.
- Supporting Services/Modules:
- Script components (e.g., resume-indexing.py) and helper modules that may operate as either microservices or scheduled jobs.

b. Relationships & Interactions:
- The Front-end consumes RESTful APIs exposed by the Back-end for functionalities such as Upload, Employee Matching, and RFP Analysis.
- The Back-end acts as a mediator between the UI and the Azure services:
- For example, when a user uploads a document, the backend will invoke document chunking (using chunking.py) and then interact with Azure Document Intelligence and Blob Storage.
- Similarly, for employee matching and requirements extraction, the backend routes the request to the appropriate module and then interacts with Azure Cosmos DB and OpenAI.

c. Architectural Patterns:
- Separation of Concerns: There is a clean modular division between UI and backend processing.
- Modularization: The backend is broken into functions where each module corresponds to a specific feature (e.g., extraction, search, prompts).

d. Relevant Technologies:
- Front-end: React, Tailwind CSS, JavaScript.
- Back-end: Python, Flask or similar (as indicated by the API application ‘app.py’).
- Azure Blob Storage, Document Intelligence, Cosmos DB, OpenAI, and AI Search.

##### Final Advice for the Principal Software Engineer
- Every integration with an Azure service is depicted, drawing attention to the dependencies listed in the README.
- The goal is to capture every essential architectural piece. Don’t hesitate to break the system into as many precisely labeled components as possible so that any stakeholder can understand the technical workflow.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Front-end Client
    subgraph "Front-end Client (React)"
        FE["Front-end (React UI)"]:::frontend
        EMP["Employee Matching UI"]:::frontend
        RFP["RFP Analyzer Page"]:::frontend
        REQ["Requirements Extraction Page"]:::frontend
        RESP_UI["Response Builder Page"]:::frontend
    end

    %% Back-end Server
    subgraph "Back-end Server (Python)"
        API["API Server (app.py)"]:::backend
        UPLOAD["Upload Module"]:::backend
        CHUNK["Document Chunking Module"]:::backend
        EXTRACT["Requirements Extraction Module"]:::backend
        RESPONSE["Response Builder Module"]:::backend
        CHAT["Chat/AI Interaction Module"]:::backend
        SEARCH["Search Functionality"]:::backend
    end

    %% External Azure Services
    subgraph "External Azure Services"
        AZ_BLOB["Azure Blob Storage"]:::external
        AZ_DOC["Azure Document Intelligence"]:::external
        AZ_COSMOS["Azure Cosmos DB"]:::external
        AZ_OPENAI["Azure OpenAI"]:::external
        AZ_SEARCH["Azure AI Search"]:::external
    end

    %% Support Services
    subgraph "Support Services"
        RESCRIPT["Resume Indexing Script"]:::support
    end

    %% Connections from Front-end to Back-end
    FE -->|"REST_API"| API
    EMP -->|"REST_call"| API
    RFP -->|"REST_call"| API
    REQ -->|"REST_call"| API
    RESP_UI -->|"REST_call"| API

    %% Back-end internal routing
    API -->|"upload"| UPLOAD
    API -->|"extraction"| EXTRACT
    API -->|"response"| RESPONSE
    API -->|"chat_request"| CHAT
    API -->|"search_query"| SEARCH

    %% Upload Workflow
    UPLOAD -->|"initiate_chunking"| CHUNK
    CHUNK -->|"store_document"| AZ_BLOB
    CHUNK -->|"analyze_document"| AZ_DOC

    %% Extraction Workflow
    EXTRACT -->|"store_results"| AZ_COSMOS

    %% Chat Workflow
    CHAT -->|"process_query"| AZ_OPENAI

    %% Search Workflow
    SEARCH -->|"query_index"| AZ_SEARCH
    SEARCH -->|"fetch_data"| AZ_COSMOS

    %% Support Script Interaction
    RESCRIPT -->|"update_index"| AZ_COSMOS

    %% Click Events
    click FE "https://github.com/y-adepu/rfp_accelerator/tree/main/front-end/"
    click API "https://github.com/y-adepu/rfp_accelerator/blob/main/backend/app.py"
    click UPLOAD "https://github.com/y-adepu/rfp_accelerator/blob/main/backend/upload.py"
    click CHUNK "https://github.com/y-adepu/rfp_accelerator/blob/main/backend/chunking.py"
    click EMP "https://github.com/y-adepu/rfp_accelerator/tree/main/front-end/src/components/EmployeeMatching"
    click RFP "https://github.com/y-adepu/rfp_accelerator/blob/main/front-end/src/pages/RFPAnalyzerPage.js"
    click EXTRACT "https://github.com/y-adepu/rfp_accelerator/blob/main/backend/extraction.py"
    click RESPONSE "https://github.com/y-adepu/rfp_accelerator/blob/main/backend/response.py"
    click CHAT "https://github.com/y-adepu/rfp_accelerator/blob/main/backend/chat.py"
    click SEARCH "https://github.com/y-adepu/rfp_accelerator/blob/main/backend/search.py"
    click RESCRIPT "https://github.com/y-adepu/rfp_accelerator/blob/main/scripts/resume-indexing.py"

    %% Styles
    classDef frontend fill:#AED6F1,stroke:#1F618D,stroke-width:2px;
    classDef backend fill:#A9DFBF,stroke:#196F3D,stroke-width:2px;
    classDef external fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef support fill:#F5B7B1,stroke:#C0392B,stroke-width:2px;
```
