# gideonn/insta-gallery-downloader architecture

> Architecture diagram of the GitHub repository gideonn/insta-gallery-downloader, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gideonn/insta-gallery-downloader
- Repository: https://github.com/gideonn/insta-gallery-downloader

## Overview

##### Main Components

a. User Interface Layer:
- Simple executable interface (instaScrape_Sandbox.exe)
- Configuration file (config.txt)

b. Authentication Layer:
- Instagram OAuth Flow
- Access Token Management

c. Core Processing Layer:
- Instagram API Client
- Image Download Manager
- File System Handler

d. External Services:
- Instagram API
- Local File System

##### Flow Representation

1. Initial Setup Flow:
- User → Instagram Developer Portal
- OAuth Authorization → Access Token
- Access Token → Configuration File

2. Main Operation Flow:
- User → Executable
- Executable → Config Reader
- Config Reader → Instagram API Client
- API Client → Image Downloader
- Image Downloader → Local Gallery Folder

##### Important Elements to Highlight

a. Authentication Components:
- OAuth 2.0 Implicit Flow
- Access Token Storage

b. API Integration:
- Instagram Basic API
- Scope permissions (basic, likes, comments, relationships)

c. Storage:
- Local file system integration
- Gallery folder structure

##### Technical Details

Annotations for:
- Python-based implementation
- Instagram API endpoints used
- File system operations
- Configuration requirements

Use standard symbols:
- Rectangles: Processing components
- Clouds: External services

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and classes
    classDef ui fill:#a8d1f0,stroke:#333,stroke-width:2px
    classDef auth fill:#90EE90,stroke:#333,stroke-width:2px
    classDef process fill:#FFE5B4,stroke:#333,stroke-width:2px
    classDef external fill:#E0E0E0,stroke:#333,stroke-width:2px
    
    %% User Interface Layer
    subgraph UI[User Interface Layer]
        EXE[instaScrape_Sandbox.exe]
        CONFIG[config.txt]
    end
    
    %% Authentication Layer
    subgraph AUTH[Authentication Layer]
        OAUTH[OAuth 2.0 Flow]
        TOKEN[Access Token Management]
    end
    
    %% Core Processing Layer
    subgraph CORE[Core Processing Layer]
        API_CLIENT[Instagram API Client]
        DOWNLOADER[Image Download Manager]
        FS_HANDLER[File System Handler]
    end
    
    %% External Services
    subgraph EXT[External Services]
        INSTA_API[Instagram API]
        FS[Local File System]
    end
    
    %% Connections
    USER((User)) --> EXE
    USER --> DEV_PORTAL[Instagram Developer Portal]
    DEV_PORTAL --> OAUTH
    OAUTH --> TOKEN
    TOKEN --> CONFIG
    EXE --> CONFIG
    CONFIG --> API_CLIENT
    API_CLIENT --> INSTA_API
    INSTA_API --> DOWNLOADER
    DOWNLOADER --> FS_HANDLER
    FS_HANDLER --> FS
    
    %% Click events
    click EXE "https://github.com/gideonn/Insta-Gallery-Downloader/blob/master/instaScrape_Sandbox.exe"
    click API_CLIENT "https://github.com/gideonn/Insta-Gallery-Downloader/blob/master/instaScrape_Sandbox.py"
    
    %% Styling
    class EXE,CONFIG ui
    class OAUTH,TOKEN auth
    class API_CLIENT,DOWNLOADER,FS_HANDLER process
    class INSTA_API,FS,DEV_PORTAL external
    
    %% Legend
    subgraph Legend
        UI_LEG[User Interface]:::ui
        AUTH_LEG[Authentication]:::auth
        PROC_LEG[Processing]:::process
        EXT_LEG[External Services]:::external
    end
```
