# aryabandi/insta-downloader architecture

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

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

## Overview

This small Flask app presents a page where a user can submit an Instagram post URL, then retrieves the post and downloads its media through Instaloader before returning a file attachment. The download route also scans the downloads directory for a matching media file. The template and downloaded files are shown as distinct parts of the workflow; only app.py was excerpted, so no template internals are inferred.

Main entry points: [`app.py`](https://github.com/aryabandi/insta-downloader/blob/main/app.py) (Flask app), [`downloads`](https://github.com/aryabandi/insta-downloader/tree/main/downloads) (Downloaded media), [`templates/index.html`](https://github.com/aryabandi/insta-downloader/blob/main/templates/index.html) (Home page)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_web_app["Flask app<br/>[app.py]"]
node_home_page["Home page<br/>[index.html]"]
node_instagram["Instagram"]
node_downloads["Downloaded media"]

node_user -->|"requests page"| node_web_app
node_web_app -->|"renders"| node_home_page
node_user -->|"submits URL"| node_web_app
node_web_app -->|"fetches post"| node_instagram
node_web_app -->|"downloads media"| node_instagram
node_instagram -->|"writes media"| node_downloads
node_web_app -->|"scans files"| node_downloads
node_web_app -->|"sends attachment"| node_user

click node_web_app "https://github.com/aryabandi/insta-downloader/blob/main/app.py"
click node_home_page "https://github.com/aryabandi/insta-downloader/blob/main/templates/index.html"
click node_downloads "https://github.com/aryabandi/insta-downloader/tree/main/downloads"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_user toneBlue
class node_web_app,node_home_page,node_downloads toneTeal
class node_instagram toneIndigo
```

## Components

### Other components

- **User**
- [Flask app](https://github.com/aryabandi/insta-downloader/blob/main/app.py): `app.py`
- [Home page](https://github.com/aryabandi/insta-downloader/blob/main/templates/index.html): `templates/index.html`
- **Instagram**
- [Downloaded media](https://github.com/aryabandi/insta-downloader/tree/main/downloads): `downloads`

## Connections

- User → Flask app: requests page (evidence: `app.py`)
- Flask app → Home page: renders (evidence: `app.py`)
- User → Flask app: submits URL (evidence: `app.py`)
- Flask app → Instagram: fetches post (evidence: `app.py`)
- Flask app → Instagram: downloads media (evidence: `app.py`)
- Instagram → Downloaded media: writes media
- Flask app → Downloaded media: scans files (evidence: `app.py`)
- Flask app → User: sends attachment (evidence: `app.py`)
