# kira0987/due_diligence_crypto_pga_4ds6_project architecture

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

- Interactive diagram: https://gitdiagram.com/kira0987/due_diligence_crypto_pga_4ds6_project
- Repository: https://github.com/kira0987/due_diligence_crypto_pga_4ds6_project

## Overview

##### Project type and purpose
- This is a full-stack Python project focused on “crypto due diligence” for risk prevention and advisory. It ingests PDF documents, extracts and vectorizes their contents, applies ML models for risk analysis, generates reports (PowerPoint), and exposes a Django-based web UI with an integrated chatbot.

##### File structure
- Top level:
- README.md (project overview)
- crypto_due_diligence/ (code folder)
- Inside crypto_due_diligence/:
- app.py and main.py – entry points for the web server or CLI
- modules/ – reusable components:
– pdf_text_extractor.py (raw text)
– pdf_feature_extractor.py (features for ML)
– text_cleaning.py and text_chunker.py (preprocessing pipeline)
– vector_database.py (indexing embeddings)
- test_pdfs/ and uploaded_pdfs/ – sample inputs and extracted outputs (text, chunks, embeddings, analysis JSON)
- requirements.txt – runtime dependencies
- pdf_processor.log – logging of ingestion pipeline
- No explicit Django project folder is shown here; assume that app.py or main.py starts the Django server or API layer.

##### README for additional insights
- Describes ML and generative AI models for risk analysis
- Mentions a Django‐based web platform + chatbot for user interaction
- Highlights PPT generation and a crypto portfolio database component

##### Elements
- Web/UI components (e.g., blue rectangles)
- Processing pipeline modules (e.g., green)

##### Detail is key
- Don’t hesitate to break out sub-components (e.g., separate chunker from cleaner).

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Presentation Layer"
        UI["Django Web UI & Chatbot"]:::frontend
    end

    subgraph "API Layer"
        API["API / Web Server"]:::api
        CLI["CLI / Alternative Entry Point"]:::api
    end

    subgraph "Processing Pipeline"
        QUEUE["Task Queue / Worker"]:::queue
        storage["Uploaded PDF Storage"]:::storage
        EX["PDF Text Extraction"]:::processing
        CLEAN["Text Cleaning"]:::processing
        CHUNK["Text Chunking"]:::processing
        FEAT["Feature Extraction"]:::processing
        EMB["Embedding & Vector DB"]:::processing
        ML["Risk Analysis Models"]:::processing
        REPORT["Report Generator (PPT)"]:::processing
    end

    subgraph "Data Storage"
        VDB["Vector Database"]:::db
        RDB["Relational DB (User & Portfolio)"]:::db
        LOG["Ingestion Pipeline Log"]:::db
    end

    subgraph "External Services"
        AUTH["Auth Provider"]:::external
        BLOCK["Blockchain Data API"]:::external
    end

    UI -->|"HTTP Requests"| API
    UI -->|"Chat Queries"| ML
    API -->|"Authenticate"| AUTH
    API -->|"Enqueue PDF Processing"| QUEUE
    API -->|"User Data Access"| RDB
    CLI -->|"Direct Ingestion"| storage
    QUEUE --> storage
    storage -->|"raw PDF"| EX
    EX -->|"raw text"| CLEAN
    CLEAN -->|"clean text"| CHUNK
    CHUNK -->|"text chunks"| FEAT
    FEAT -->|"features"| EMB
    EMB -->|"embeddings"| VDB
    EMB -->|"log entries"| LOG
    FEAT -->|"features"| ML
    VDB -->|"vector queries"| ML
    BLOCK -->|"live data"| ML
    ML -->|"risk scores"| REPORT
    REPORT -->|"PowerPoint Output"| UI

    click API "https://github.com/kira0987/due_diligence_crypto_pga_4ds6_project/blob/main/crypto_due_diligence/app.py"
    click CLI "https://github.com/kira0987/due_diligence_crypto_pga_4ds6_project/blob/main/crypto_due_diligence/main.py"
    click EX "https://github.com/kira0987/due_diligence_crypto_pga_4ds6_project/blob/main/crypto_due_diligence/modules/pdf_text_extractor.py"
    click CLEAN "https://github.com/kira0987/due_diligence_crypto_pga_4ds6_project/blob/main/crypto_due_diligence/modules/text_cleaning.py"
    click CHUNK "https://github.com/kira0987/due_diligence_crypto_pga_4ds6_project/blob/main/crypto_due_diligence/modules/text_chunker.py"
    click FEAT "https://github.com/kira0987/due_diligence_crypto_pga_4ds6_project/blob/main/crypto_due_diligence/modules/pdf_feature_extractor.py"
    click EMB "https://github.com/kira0987/due_diligence_crypto_pga_4ds6_project/blob/main/crypto_due_diligence/modules/vector_database.py"
    click storage "https://github.com/kira0987/due_diligence_crypto_pga_4ds6_project/tree/main/crypto_due_diligence/uploaded_pdfs/"
    click RDB "https://github.com/kira0987/due_diligence_crypto_pga_4ds6_project/tree/main/crypto_due_diligence/test_pdfs/"
    click LOG "https://github.com/kira0987/due_diligence_crypto_pga_4ds6_project/blob/main/crypto_due_diligence/pdf_processor.log"

    classDef frontend fill:lightblue,stroke:#333,stroke-width:1px
    classDef api fill:#cdebf9,stroke:#333,stroke-width:1px
    classDef processing fill:lightgreen,stroke:#333,stroke-width:1px
    classDef db fill:orange,stroke:#333,stroke-width:1px
    classDef storage fill:#ffd27f,stroke:#333,stroke-width:1px
    classDef queue fill:#d5a6bd,stroke:#333,stroke-width:1px
    classDef external stroke:#666,stroke-dasharray:5 5,fill:none
```
