# samashi47/3d-content-retrieval architecture

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

- Interactive diagram: https://gitdiagram.com/samashi47/3d-content-retrieval
- Repository: https://github.com/samashi47/3d-content-retrieval

## Overview

##### Main Components

A. Frontend Layer (Angular Application):
- Authentication Module (Login/Register components)
- 3D Search Module
- Home Module
- Core Services (Search, Image, Auth, Plotly services)

B. Backend Layer (Python API):
- Server Module (Flask/FastAPI)
- Descriptor Processing Module
- Fourier Descriptors
- Zernike Moments
- Object Loader Module
- Search Logic Module

C. Data Storage:
- MongoDB Database (indicated by the MONGO_URL requirement)
- File Storage for 3D Models and Thumbnails

D. External Assets:
- 3D Pottery Dataset
- 3D Models
- Thumbnails

##### Component Relationships and Data Flow

- Frontend → Backend: REST API calls for:
- Authentication (JWT-based)
- Model upload/download
- Search requests
- Descriptor computation
- Backend → MongoDB: Data persistence
- Backend → File Storage: 3D model and thumbnail management

##### Specific Implementation Details to Highlight

A. Security Layer:
- .ssh key pair location

B. Model Processing Pipeline:
- Flow from model upload → descriptor computation → search indexing

C. Search Flow:
- Similarity search process using computed descriptors

##### Technical Stack Indicators

- Frontend: Angular
- Backend: Python
- Database: MongoDB
- File Storage: Local filesystem
- Authentication: JWT
- 3D Processing: Custom descriptors (Fourier, Zernike)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend["Angular Frontend"]
        direction TB
        Auth["Authentication Module"]
        Search3D["3D Search Module"]
        Home["Home Module"]
        CoreServices["Core Services"]
        
        subgraph Services["Core Services Detail"]
            SearchSvc["Search Service"]
            ImageSvc["Image Search Service"]
            AuthSvc["Auth Service"]
            PlotlySvc["Plotly Service"]
        end
    end

    subgraph Backend["Python Backend API"]
        direction TB
        Server["Server Module"]
        
        subgraph Descriptors["Descriptor Processing"]
            Fourier["Fourier Descriptors"]
            Zernike["Zernike Moments"]
        end
        
        ObjLoader["Object Loader Module"]
        SearchLogic["Search Logic Module"]
    end

    subgraph Storage["Data Storage"]
        MongoDB[(MongoDB Database)]
        FileStore[("File Storage")]
    end

    subgraph Assets["External Assets"]
        Models["3D Models"]
        Thumbs["Thumbnails"]
    end

    subgraph Config["Configuration"]
        EnvFiles["Environment Files"]
        JWT["JWT Auth"]
    end

    %% Relationships
    Auth --> AuthSvc
    Search3D --> SearchSvc
    CoreServices --> Server
    Server --> Descriptors
    Server --> ObjLoader
    Server --> SearchLogic
    ObjLoader --> FileStore
    SearchLogic --> MongoDB
    Descriptors --> MongoDB
    Assets --> FileStore

    %% Styling
    classDef frontend fill:#a8d1f0
    classDef backend fill:#90EE90
    classDef storage fill:#FFE5B4
    classDef config fill:#DDA0DD
    classDef assets fill:#FFA07A

    class Auth,Search3D,Home,CoreServices,Services,SearchSvc,ImageSvc,AuthSvc,PlotlySvc frontend
    class Server,Descriptors,Fourier,Zernike,ObjLoader,SearchLogic backend
    class MongoDB,FileStore storage
    class EnvFiles,JWT config
    class Models,Thumbs assets

    %% Click Events
    click Auth "https://github.com/Samashi47/3D-content-retrieval/tree/main/apps/app/src/app/login/"
    click Search3D "https://github.com/Samashi47/3D-content-retrieval/tree/main/apps/app/src/app/3d-search/"
    click Home "https://github.com/Samashi47/3D-content-retrieval/tree/main/apps/app/src/app/home/"
    click SearchSvc "https://github.com/Samashi47/3D-content-retrieval/blob/main/apps/app/src/app/search.service.ts"
    click ImageSvc "https://github.com/Samashi47/3D-content-retrieval/blob/main/apps/app/src/app/image-search.service.ts"
    click AuthSvc "https://github.com/Samashi47/3D-content-retrieval/blob/main/apps/app/src/app/auth.service.ts"
    click PlotlySvc "https://github.com/Samashi47/3D-content-retrieval/blob/main/apps/app/src/app/plotly.service.ts"
    click Server "https://github.com/Samashi47/3D-content-retrieval/blob/main/apps/api/server.py"
    click Fourier "https://github.com/Samashi47/3D-content-retrieval/blob/main/apps/api/logic/descriptors/fourier.py"
    click Zernike "https://github.com/Samashi47/3D-content-retrieval/blob/main/apps/api/logic/descriptors/zernike.py"
    click ObjLoader "https://github.com/Samashi47/3D-content-retrieval/blob/main/apps/api/logic/objloader.py"
    click SearchLogic "https://github.com/Samashi47/3D-content-retrieval/blob/main/apps/api/logic/search.py"
    click EnvFiles "https://github.com/Samashi47/3D-content-retrieval/blob/main/apps/api/.env.example"
```
