# hibatillah/deep-learning architecture

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

- Interactive diagram: https://gitdiagram.com/hibatillah/deep-learning
- Repository: https://github.com/hibatillah/deep-learning

## Overview

##### Main Components

A. Frontend Layer (Next.js):
- Client-side Components (/web/app/_components/)
- Audio Classification Component
- Image Classification Component
- Text Sentiment Component
- UI Components Layer (/web/components/ui/)
- Theme Management (/web/components/theme/)
- Custom Components (/web/components/custom/)

B. Backend Layer (Flask):
- Flask API Server (app.py)
- Deep Learning Models:
- Gun Audio Model
- IMDB Sentiment Model
- Landscape Images Model

- [Client Tier] → [API Tier] → [Model Tier]

##### Specific Elements

Frontend Section:
- Three main classification components
- UI component library section
- Theme management system

API Layer:
- Flask server
- API endpoints for each prediction type
- Request/response flow

Model Layer:
- Model file locations
- Model input/output types

##### Connection Types

- HTTP requests between frontend and API
- Model inference calls
- Data flow directions
- Component dependencies

##### Additional Details

Technical specifications:
- Next.js v14.2.17
- Flask v3.1.0
- Model file formats (.h5)
- Port numbers (3000 for web, 8000 for API)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        MainLayout["Main Layout"]
        MainPage["Main Page"]
        
        subgraph Components
            AudioClass["Audio Classification"]
            ImageClass["Image Classification"]
            TextClass["Text Sentiment"]
        end
        
        subgraph UI
            ThemeProvider["Theme Provider"]
            ThemeToggle["Theme Toggle"]
            UIComponents["UI Components"]
            CustomComponents["Custom Components"]
        end
        
        Utils["Utility Functions"]
    end
    
    subgraph "API Layer"
        Flask["Flask API Server"]
        
        AudioEndpoint["/predict/audio"]
        ImageEndpoint["/predict/image"]
        TextEndpoint["/predict/sentiment"]
    end
    
    subgraph "Model Layer"
        GunModel["Gun Audio Model"]
        SentimentModel["IMDB Sentiment Model"]
        LandscapeModel["Landscape Images Model"]
    end
    
    %% Frontend Connections
    MainLayout --> MainPage
    MainPage --> Components
    MainPage --> UI
    
    %% Component to API Connections
    AudioClass --> AudioEndpoint
    ImageClass --> ImageEndpoint
    TextClass --> TextEndpoint
    
    %% API to Model Connections
    AudioEndpoint --> GunModel
    ImageEndpoint --> LandscapeModel
    TextEndpoint --> SentimentModel
    
    %% API Server Connections
    Flask --> AudioEndpoint
    Flask --> ImageEndpoint
    Flask --> TextEndpoint
    
    %% Click Events
    click AudioClass "https://github.com/hibatillah/deep-learning/blob/master/web/app/_components/audio-classification.tsx"
    click ImageClass "https://github.com/hibatillah/deep-learning/blob/master/web/app/_components/image-classification.tsx"
    click TextClass "https://github.com/hibatillah/deep-learning/blob/master/web/app/_components/text-sentiment.tsx"
    click UIComponents "https://github.com/hibatillah/deep-learning/tree/master/web/components/ui/"
    click ThemeProvider "https://github.com/hibatillah/deep-learning/blob/master/web/components/theme/theme-provider.tsx"
    click ThemeToggle "https://github.com/hibatillah/deep-learning/blob/master/web/components/theme/theme-toggle.tsx"
    click CustomComponents "https://github.com/hibatillah/deep-learning/tree/master/web/components/custom/"
    click Flask "https://github.com/hibatillah/deep-learning/blob/master/deep_learning/app.py"
    click GunModel "https://github.com/hibatillah/deep-learning/blob/master/deep_learning/model/gun_audio_model.h5"
    click SentimentModel "https://github.com/hibatillah/deep-learning/blob/master/deep_learning/model/imdb_sentiment_model.h5"
    click LandscapeModel "https://github.com/hibatillah/deep-learning/blob/master/deep_learning/model/landscape_images_model.h5"
    click MainLayout "https://github.com/hibatillah/deep-learning/blob/master/web/app/layout.tsx"
    click MainPage "https://github.com/hibatillah/deep-learning/blob/master/web/app/page.tsx"
    click Utils "https://github.com/hibatillah/deep-learning/blob/master/web/lib/utils.ts"
    
    %% Styling
    classDef frontend fill:#a8d1ff,stroke:#333,stroke-width:2px
    classDef api fill:#90EE90,stroke:#333,stroke-width:2px
    classDef model fill:#DDA0DD,stroke:#333,stroke-width:2px
    
    class MainLayout,MainPage,AudioClass,ImageClass,TextClass,ThemeProvider,ThemeToggle,UIComponents,CustomComponents,Utils frontend
    class Flask,AudioEndpoint,ImageEndpoint,TextEndpoint api
    class GunModel,SentimentModel,LandscapeModel model
```
