# ashiqursuperfly/searchable-image-repository-rest-api architecture

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

- Interactive diagram: https://gitdiagram.com/ashiqursuperfly/searchable-image-repository-rest-api
- Repository: https://github.com/ashiqursuperfly/searchable-image-repository-rest-api

## Overview

This is a Django REST API for authenticated image upload, searchable image metadata, and visual similarity search. Clients register, upload single or bulk images, poll asynchronous tasks, and search by text or image; users can also list and delete their own images. Upload workers store images and ORB descriptors, while search combines PostgreSQL full-text ranking with descriptor matching. The README also documents CDN delivery and URL-based image manipulation through AWS Lambda. Unsampled routing and infrastructure details are shown only where documented; implementation links are limited to visible references.

Main entry points: [`src/core/tasks.py`](https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/core/tasks.py) (Image tasks), [`src/core/utils.py`](https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/core/utils.py) (Image and search utilities), [`src/core/views/post_single_image_async.py`](https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/core/views/post_single_image_async.py) (Single upload), [`src/core/views/get_images.py`](https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/core/views/get_images.py) (Image search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API workflows"]
  node_registration["User signup<br/>[signup.py]"]
  node_image_api["Image endpoints"]
  node_single_upload["Single upload"]
  node_bulk_upload["Bulk upload"]
  node_task_status["Task results"]
  node_my_images["Owned images<br/>[mine_images.py]"]
  node_catalog["Categories and countries"]
end

subgraph group_search["Search and discovery"]
  node_fulltext["Full-text search<br/>[get_images.py]"]
  node_image_search["Image search<br/>[get_images.py]"]
  node_query_model["Search query model<br/>[search_models.py]"]
end

subgraph group_worker["Async processing"]
  node_worker_tasks["Image tasks<br/>[tasks.py]"]
  node_celery["Celery app<br/>[celery.py]"]
end

subgraph group_data["Image data and storage"]
  node_serializer["Request and response serializers<br/>[serializers.py]"]
  node_image_utils["Image and search utilities<br/>[utils.py]"]
  node_image_records["Image records<br/>[models.py]"]
end

subgraph group_platform["External platform"]
  node_postgres[("PostgreSQL")]
  node_s3[("AWS S3")]
  node_cdn["CloudFront CDN"]
  node_rabbitmq["RabbitMQ broker"]
  node_lambda["AWS Lambda manipulation"]
end

node_client(("API client"))

node_client -->|"registers"| node_registration
node_client -->|"uploads image"| node_single_upload
node_client -->|"uploads batch"| node_bulk_upload
node_client -->|"searches text"| node_fulltext
node_client -->|"searches image"| node_image_search
node_client -->|"polls task"| node_task_status
node_client -->|"manages own images"| node_my_images
node_client -->|"requests options"| node_catalog
node_single_upload -->|"dispatches upload"| node_worker_tasks
node_bulk_upload -->|"dispatches uploads"| node_worker_tasks
node_image_search -->|"dispatches search"| node_worker_tasks
node_worker_tasks -->|"registered by"| node_celery
node_worker_tasks -->|"calls"| node_image_utils
node_worker_tasks -->|"creates and queries"| node_image_records
node_image_utils -->|"queries"| node_image_records
node_image_utils -->|"uploads files"| node_s3
node_worker_tasks -->|"stores uploaded image"| node_s3
node_fulltext -->|"runs search"| node_image_utils
node_image_search -->|"accepts search fields"| node_query_model
node_query_model -->|"builds text query"| node_postgres
node_image_utils -->|"ranks metadata"| node_postgres
node_image_utils -->|"serves image URLs"| node_cdn
node_registration -->|"returns user data"| node_serializer
node_single_upload -->|"names stored image"| node_image_records
node_task_status -->|"returns task result"| node_client
node_client -->|"requests URL manipulation"| node_lambda
node_celery -.->|"uses broker"| node_rabbitmq

click node_registration "https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/core/views/signup.py"
click node_image_api "https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/tree/main/src/core/views"
click node_single_upload "https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/core/views/post_single_image_async.py"
click node_bulk_upload "https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/core/views/post_bulk_images.py"
click node_task_status "https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/core/views/celery_task_results.py"
click node_my_images "https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/core/views/mine_images.py"
click node_catalog "https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/tree/main/src/core/views"
click node_fulltext "https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/core/views/get_images.py"
click node_image_search "https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/core/views/get_images.py"
click node_query_model "https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/core/search_models.py"
click node_serializer "https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/core/serializers.py"
click node_worker_tasks "https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/core/tasks.py"
click node_celery "https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/iidb/celery.py"
click node_image_utils "https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/core/utils.py"
click node_image_records "https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/core/models.py"

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_registration,node_image_api,node_single_upload,node_bulk_upload,node_task_status,node_my_images,node_catalog,node_client toneBlue
class node_fulltext,node_image_search,node_query_model toneAmber
class node_worker_tasks,node_celery toneMint
class node_serializer,node_image_utils,node_image_records toneRose
class node_postgres,node_s3,node_cdn,node_rabbitmq,node_lambda toneIndigo
```

## Components

### API workflows

- [User signup](https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/core/views/signup.py): `src/core/views/signup.py`
- [Image endpoints](https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/tree/main/src/core/views): `src/core/views`
- [Single upload](https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/core/views/post_single_image_async.py): `src/core/views/post_single_image_async.py`
- [Bulk upload](https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/core/views/post_bulk_images.py): `src/core/views/post_bulk_images.py`
- [Task results](https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/core/views/celery_task_results.py): `src/core/views/celery_task_results.py`
- [Owned images](https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/core/views/mine_images.py): `src/core/views/mine_images.py`
- [Categories and countries](https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/tree/main/src/core/views): `src/core/views`

### Search and discovery

- [Full-text search](https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/core/views/get_images.py): `src/core/views/get_images.py`
- [Image search](https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/core/views/get_images.py): `src/core/views/get_images.py`
- [Search query model](https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/core/search_models.py): `src/core/search_models.py`

### Async processing

- [Image tasks](https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/core/tasks.py): `src/core/tasks.py`
- [Celery app](https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/iidb/celery.py): `src/iidb/celery.py`

### Image data and storage

- [Request and response serializers](https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/core/serializers.py): `src/core/serializers.py`
- [Image and search utilities](https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/core/utils.py): `src/core/utils.py`
- [Image records](https://github.com/ashiqursuperfly/searchable-image-repository-rest-api/blob/main/src/core/models.py): `src/core/models.py`

### External platform

- **PostgreSQL**
- **AWS S3**
- **CloudFront CDN**
- **RabbitMQ broker**
- **AWS Lambda manipulation**

### Other components

- **API client**

## Connections

- API client → User signup: registers (evidence: `README.md`)
- API client → Single upload: uploads image (evidence: `README.md`)
- API client → Bulk upload: uploads batch (evidence: `README.md`)
- API client → Full-text search: searches text (evidence: `README.md`)
- API client → Image search: searches image (evidence: `README.md`)
- API client → Task results: polls task (evidence: `README.md`)
- API client → Owned images: manages own images (evidence: `README.md`)
- API client → Categories and countries: requests options (evidence: `README.md`)
- Single upload → Image tasks: dispatches upload (evidence: `src/core/views/post_single_image_async.py`)
- Bulk upload → Image tasks: dispatches uploads (evidence: `src/core/views/post_bulk_images.py`)
- Image search → Image tasks: dispatches search (evidence: `src/core/views/get_images.py`)
- Image tasks → Celery app: registered by (evidence: `src/core/tasks.py`)
- Image tasks → Image and search utilities: calls (evidence: `src/core/tasks.py`)
- Image tasks → Image records: creates and queries (evidence: `src/core/tasks.py`)
- Image and search utilities → Image records: queries (evidence: `src/core/utils.py`)
- Image and search utilities → AWS S3: uploads files (evidence: `src/core/utils.py`)
- Image tasks → AWS S3: stores uploaded image (evidence: `README.md`)
- Full-text search → Image and search utilities: runs search (evidence: `src/core/views/get_images.py`)
- Image search → Search query model: accepts search fields
- Search query model → PostgreSQL: builds text query (evidence: `src/core/search_models.py`)
- Image and search utilities → PostgreSQL: ranks metadata (evidence: `README.md`)
- Image and search utilities → CloudFront CDN: serves image URLs (evidence: `README.md`)
- User signup → Request and response serializers: returns user data (evidence: `src/core/views/signup.py`)
- Single upload → Image records: names stored image (evidence: `README.md`)
- Task results → API client: returns task result (evidence: `README.md`)
- API client → AWS Lambda manipulation: requests URL manipulation (evidence: `README.md`)
- Celery app → RabbitMQ broker: uses broker (evidence: `README.md`)
