# 9hakboiii/3rd_project_django architecture

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

- Interactive diagram: https://gitdiagram.com/9hakboiii/3rd_project_django
- Repository: https://github.com/9hakboiii/3rd_project_django

## Overview

##### Project type and purpose
- This is a Django-based full-stack web application (see manage.py, config/asgi.py, wsgi.py, settings.py).
- Purpose: a “YouTube thumbnail font trend analysis” service that extracts text from thumbnail images, analyzes the font usage, and visualizes typography trends for creators.

##### File structure
- Top level:
- manage.py – entry point to run the Django app
- requirements.txt – pinned Python dependencies (likely includes Django, an OCR library like Tesseract or a cloud OCR SDK, and data-viz libraries)
- config/ – Django project folder containing settings, URL routes, ASGI/WGSI configuration
- 기타 markdowns – documentation and basic setup scripts
- thumbnail ingestion & storage
- OCR & font-analysis pipeline
- results visualization & API

##### README for additional insights
- Target users: YouTube creators seeking typography insights
- Implied features: thumbnail ingestion (manual upload or YouTube API fetch), OCR, font-matching logic, trend dashboards

##### Main components
a. Client (browser or mobile app)
- UI layer built with HTML/CSS/JS (could use a front-end framework like React/Vue if present)
b. Web server / API layer
- Django views (ASGI/WGSI)
- URL router directs requests to controllers
c. Business logic / Processing pipeline
- Thumbnail fetcher (YouTube Data API module)
- OCR engine (e.g., Tesseract or cloud OCR service)
- Font-analysis service (custom Python module or ML model to detect font families/style)
- Trend aggregator (collects and stores metrics over time)
d. Data storage
- Relational database (PostgreSQL, MySQL) for user, thumbnail metadata, analysis results
- Object storage (local media folder or cloud bucket) for raw thumbnail images
e. Visualization
- Charting library integrated into Django templates or served via a separate front-end bundle
f. External services
- YouTube Data API
g. Deployment & infrastructure
- Web server (Gunicorn/Uvicorn) behind Nginx
- Docker or other container orchestrator (if used)
- CI/CD pipeline (GitHub Actions, Jenkins)

##### Relationships & interactions
- The client sends HTTP requests to Django’s routing layer → routed to view functions
- Views interact with the database via Django ORM and/or queue tasks for OCR/font analysis
- Background worker pulls tasks from the queue, runs OCR → font analyzer → writes results back to DB
- Visualization endpoint queries aggregated results, returns data (JSON) to the client for chart rendering
- Static assets (CSS/JS) served either by Django’s staticfiles or a CDN

##### Architectural patterns & design principles
- MVC (Model-View-Controller) via Django’s MTV (Model-Template-View)
- Separation of concerns:
- Web/API layer vs. background processing pipeline
- Data storage vs. object storage
- (Optional) Asynchronous task queue (e.g., Celery + Redis) for heavy OCR/ML workloads
- Use of 12-factor app principles for configuration via config/settings.py and environment variables

1. Client on the left.
- Client → Web Server → Task Queue → Worker → OCR → Font Analyzer → Database
- Web Server → External API
- Web Server → Client (serve dashboards)

##### Detail & clarity
- Distinguish synchronous (HTTP/REST) vs asynchronous (AMQP) flows.
- Essential modules: ingestion, processing, storage, visualization, external integrations.
- Avoid clutter: group related services into layers, but break out any specialized modules (OCR, font analysis).

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Layer
    Client["Client Browser"]:::client

    %% Entry Point
    Entry["manage.py"]:::code
    click Entry "https://github.com/9hakboiii/3rd_project_django/blob/main/manage.py"

    %% Web/API Layer
    subgraph "Web/API Layer"
        direction TB
        ConfigDir["config/"]:::code
        click ConfigDir "https://github.com/9hakboiii/3rd_project_django/tree/main/config/"
        URLRouter["URL Router"]:::web
        click URLRouter "https://github.com/9hakboiii/3rd_project_django/blob/main/config/urls.py"
        Settings["Settings & Env Config"]:::web
        click Settings "https://github.com/9hakboiii/3rd_project_django/blob/main/config/settings.py"
        ASGI["ASGI Server (Uvicorn/Daphne)"]:::web
        click ASGI "https://github.com/9hakboiii/3rd_project_django/blob/main/config/asgi.py"
        WSGI["WSGI Server (Gunicorn/mod_wsgi)"]:::web
        click WSGI "https://github.com/9hakboiii/3rd_project_django/blob/main/config/wsgi.py"
    end

    %% Dependencies & Docs
    Requirements["requirements.txt"]:::code
    click Requirements "https://github.com/9hakboiii/3rd_project_django/blob/main/requirements.txt"
    README["README.md"]:::code
    click README "https://github.com/9hakboiii/3rd_project_django/blob/main/README.md"
    Doc1["기본명령어_모음.md"]:::code
    click Doc1 "https://github.com/9hakboiii/3rd_project_django/blob/main/기본명령어_모음.md"
    Doc2["기본환경설정_설명.md"]:::code
    click Doc2 "https://github.com/9hakboiii/3rd_project_django/blob/main/기본환경설정_설명.md"

    %% Processing Pipeline
    subgraph "Processing Pipeline"
        direction TB
        TaskQueue["Task Queue (Celery/Redis)"]:::pipeline
        Worker["Background Worker"]:::pipeline
        OCR["OCR Engine"]:::pipeline
        FontAnalyzer["Font Analyzer"]:::pipeline
    end

    %% Data Storage
    subgraph "Data Storage"
        direction TB
        DB["SQL Database"]:::storage
        ObjStore["Object Storage"]:::storage
    end

    %% External Services
    YouTubeAPI["YouTube Data API"]:::external

    %% Connections
    Client -->|HTTP/REST| Entry
    Entry -->|invoke| URLRouter
    URLRouter -->|routes to| Settings
    URLRouter -->|routes to| ASGI
    URLRouter -->|routes to| WSGI
    URLRouter -->|calls| TaskQueue
    URLRouter -->|queries| DB
    URLRouter -->|HTTP/REST| YouTubeAPI
    URLRouter -->|renders| Client

    TaskQueue -->|AMQP| Worker
    Worker -->|process job| OCR
    OCR -->|text data| FontAnalyzer
    FontAnalyzer -->|analysis results| DB
    Worker -->|store images| ObjStore

    %% Styles
    classDef client fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef web fill:#90EE90,stroke:#333,stroke-width:1px
    classDef pipeline fill:#FFA500,stroke:#333,stroke-width:1px
    classDef storage fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef external fill:#D8BFD8,stroke:#333,stroke-width:1px
    classDef code fill:#f2f2f2,stroke:#333,stroke-width:1px
```
