# emi420/chatmap architecture

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

- Interactive diagram: https://gitdiagram.com/emi420/chatmap
- Repository: https://github.com/emi420/chatmap

## Overview

##### Main Components Identification

The system architecture should be represented as a single-page application (SPA) with these main components:

a) Frontend Layer (React-based):
- User Interface Components
- Data Processing Layer
- Visualization Layer

##### Key Architectural Elements

A. Core Components (Top Level):
- User Interface Layer
- Navigation Components
- File Management
- Map Visualization
- Data Processing Layer
- Chat Parsers
- Content Merger
- State Management Layer
- Settings & Configuration

##### Component Relationships to Highlight

- File Upload → Parser → Content Merger → Map Visualization
- Settings → Map Configuration
- Language Selection → UI Updates

##### Specific Implementation Details

a) Input Processing:
- File upload component
- WhatsApp parser implementation
- Content merger hook

b) Visualization Layer:
- Component with custom styling
- Location popup handling
- Source management

c) Support Systems:
- Internationalization (i18n) with multiple language support
- Settings management
- Download functionality

**┌─────────────────────────────────────────┐**
- User Interface             │
- ┬─────────────┬────────────┤
- NavBar     │FileUpload   │ Settings   │
- ┴─────────────┴────────────┘
- ↓             ↓            ↓
**┌─────────────────────────────────────────┐**
- Data Processing               │
- ┌─────────────┐    ┌─────────────┐    │
- Parser    │ → │ContentMerger │    │
- ┘    └─────────────┘    │
- ┘
- ↓
**┌─────────────────────────────────────────┐**
- Map Visualization            │
- ┌─────────────┐    ┌─────────────┐    │
- Map      │ ← │   Popup     │    │
- ┘    └─────────────┘    │
- ┘

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph UI["User Interface Layer"]
        direction TB
        NAV["Navigation Components"]:::ui
        FMAN["File Management"]:::ui
        SET["Settings UI"]:::ui
        NMOD["Navigation Modal"]:::ui
        DWN["Download Button"]:::ui
    end

    subgraph DPL["Data Processing Layer"]
        direction TB
        PARS["Chat Parser"]:::processing
        CMER["Content Merger"]:::processing
        FMGR["File Manager"]:::processing
    end

    subgraph MAP["Map Visualization Layer"]
        direction TB
        MCOMP["Map Component"]:::map
        POP["Map Popup"]:::map
        SRC["Map Source"]:::map
    end

    subgraph STATE["State Management Layer"]
        direction TB
        SETT["Settings Manager"]:::state
        I18N["Internationalization"]:::state
    end

    %% Data Flow Relationships
    FMAN --> FMGR
    FMGR --> PARS
    PARS --> CMER
    CMER --> MCOMP
    MCOMP --> POP
    MCOMP --> SRC
    SET --> SETT
    SETT --> MCOMP
    I18N --> UI
    NAV --> NMOD
    
    %% Click Events
    click NAV "https://github.com/emi420/chatmap/blob/master/src/components/NavBar/index.jsx"
    click FMAN "https://github.com/emi420/chatmap/blob/master/src/components/FileUpload/index.jsx"
    click MCOMP "https://github.com/emi420/chatmap/blob/master/src/components/Map/index.jsx"
    click POP "https://github.com/emi420/chatmap/blob/master/src/components/Map/popup.jsx"
    click SRC "https://github.com/emi420/chatmap/blob/master/src/components/Map/source.js"
    click SET "https://github.com/emi420/chatmap/blob/master/src/components/Settings/index.jsx"
    click PARS "https://github.com/emi420/chatmap/blob/master/src/parsers/whatsapp.js"
    click CMER "https://github.com/emi420/chatmap/blob/master/src/hooks/useContentMerger.js"
    click FMGR "https://github.com/emi420/chatmap/blob/master/src/hooks/useFileManager.js"
    click SETT "https://github.com/emi420/chatmap/blob/master/src/hooks/useSettings.js"
    click I18N "https://github.com/emi420/chatmap/tree/master/src/int"
    click DWN "https://github.com/emi420/chatmap/blob/master/src/components/DownloadButton/index.jsx"
    click NMOD "https://github.com/emi420/chatmap/blob/master/src/components/NavModal/index.jsx"

    %% Styling
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef processing fill:#2ecc71,stroke:#27ae60,color:white
    classDef map fill:#e74c3c,stroke:#c0392b,color:white
    classDef state fill:#f1c40f,stroke:#f39c12,color:black

    %% Legend
    subgraph Legend
        UI_LEG["UI Component"]:::ui
        PROC_LEG["Processing Component"]:::processing
        MAP_LEG["Map Component"]:::map
        STATE_LEG["State Component"]:::state
    end
```
