# hugues-dtankouo/fax architecture

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

- Interactive diagram: https://gitdiagram.com/hugues-dtankouo/fax
- Repository: https://github.com/hugues-dtankouo/fax

## Overview

##### Main Components

a) Core Components:
- Document Management Engine (fax module)
- API Layer (api & web_api modules)
- Desktop Interface
- Mobile Interface (Android/iOS)
- External Storage Integration (Google Drive)

b) Cross-cutting Components:
- Authentication & Authorization System
- User Activity Tracking
- File System Operations
- Permission Management

##### Architecture Style
The system should be represented as a modular, multi-tiered architecture with these layers:

**[Client Layer]**
- Desktop GUI
- Mobile Apps
- CLI Interface

**[API Layer]**
- Web API
- Core API

**[Service Layer]**
- Document Management Services
- Authentication Services
- Storage Services

**[Integration Layer]**
- Google Drive Connector
- Local File System Connector

##### Key Relationships to Highlight

- How the desktop, mobile, and web interfaces connect to the core API
- Authentication flow across components
- Demonstrate file operation paths from user interfaces to storage
- Integration points with Google Drive
- User activity tracking flow

##### Technical Details

- Python-based backend (as evidenced by poetry.toml files)
- Type checking support (py.typed files present)
- Testing infrastructure
- Build and deployment configurations

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Layer
    subgraph Clients
        Desktop["Desktop Interface"]
        Mobile["Mobile Interface"]
        CLI["CLI Interface"]
    end

    %% API Layer
    subgraph APIs
        WebAPI["Web API"]:::api
        CoreAPI["Core API"]:::api
    end

    %% Service Layer
    subgraph Services
        DocMgmt["Document Management Engine"]:::core
        AuthService["Authentication Services"]:::security
        StorageService["Storage Services"]:::core
        ActivityTracker["User Activity Tracking"]:::core
        PermissionMgmt["Permission Management"]:::security
    end

    %% Integration Layer
    subgraph Storage
        GDrive["Google Drive"]:::external
        LocalFS["Local File System"]:::storage
    end

    %% Testing & Build
    subgraph Infrastructure
        Testing["Testing Infrastructure"]:::infra
        BuildConfig["Build Configuration"]:::infra
        DevTools["Development Tools"]:::infra
    end

    %% Relationships
    Desktop --> WebAPI
    Mobile --> WebAPI
    CLI --> CoreAPI
    WebAPI --> CoreAPI
    CoreAPI --> DocMgmt
    CoreAPI --> AuthService
    DocMgmt --> StorageService
    StorageService --> GDrive
    StorageService --> LocalFS
    DocMgmt --> ActivityTracker
    DocMgmt --> PermissionMgmt

    %% Click Events
    click Desktop "https://github.com/Hugues-DTANKOUO/fax/tree/main/desktop/src/desktop"
    click Mobile "https://github.com/Hugues-DTANKOUO/fax/tree/main/mobile/src/mobile"
    click WebAPI "https://github.com/Hugues-DTANKOUO/fax/tree/main/web_api/src/web_api"
    click CoreAPI "https://github.com/Hugues-DTANKOUO/fax/tree/main/api/src/api"
    click DocMgmt "https://github.com/Hugues-DTANKOUO/fax/blob/main/fax/src/fax/application.py"
    click Testing "https://github.com/Hugues-DTANKOUO/fax/tree/main/fax/tests"
    click BuildConfig "https://github.com/Hugues-DTANKOUO/fax/blob/main/fax/pyproject.toml"
    click DevTools "https://github.com/Hugues-DTANKOUO/fax/tree/main/fax/src/fax/scripts"

    %% Styling
    classDef core fill:#2374ab
    classDef api fill:#ffd700
    classDef security fill:#ff6b6b
    classDef external fill:#808080
    classDef storage fill:#4a90e2
    classDef infra fill:#95a5a6

    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["API Services"]:::api
        L3["Security Services"]:::security
        L4["External Services"]:::external
        L5["Storage Systems"]:::storage
        L6["Infrastructure"]:::infra
    end
```
