# parryqiu/gugujiankong architecture

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

- Interactive diagram: https://gitdiagram.com/parryqiu/gugujiankong
- Repository: https://github.com/parryqiu/gugujiankong

## Overview

##### Main Components Overview

a) Client-Side (Mobile App)
- Ionic/Angular Frontend (www/js folder structure)
- Platform-specific implementations (iOS and Android)
- Cordova Plugins Layer

b) Core Services
- Authentication Service
- Website Monitoring Service
- Speed Testing Service
- SEO Monitoring Service
- Push Notification Service (JPush integration)

c) External Integrations
- SMS Gateway
- Voice Call Service
- Search Engine APIs

##### Architecture Layers

**┌─────────────────────────────────────────────┐**
- Presentation Layer           │
- ┤
- Templates (www/templates/*.html)            │
- Controllers (www/js/controllers.js)         │
- Services (www/js/services.js)              │
- ┘
- ↕
**┌─────────────────────────────────────────────┐**
- Cordova Plugin Layer           │
- ┤
- InAppBrowser                             │
- Network Information                      │
- Device                                   │
- Push Notifications (JPush)               │
- ┘
- ↕
**┌─────────────────────────────────────────────┐**
- Native Platform Layer             │
- ┤
- iOS Implementation | Android Implementation │
- ┘

##### Data Flow Representation

- User authentication flow
- Website monitoring data flow
- Push notification flow
- SEO data collection and reporting flow

##### Component Details

For each major component, include:
- Component name
- Key responsibilities
- Dependencies
- Communication protocols

##### Integration Points

Integration points for:
- JPush notification service
- SMS/Voice call services
- Search engine monitoring
- Speed testing nodes

##### Security Layer

A security layer showing:
- Authentication flow
- Data encryption
- API security
- Platform-specific security features

##### Monitoring Components

Detail the monitoring architecture:
- Multiple node testing
- Response time monitoring
- SEO tracking
- Alert system

**[Mobile Clients] → [Ionic Framework Layer] → [Cordova Plugins]**
- ↓                    ↓                     ↓
**[Authentication] → [Core Services] → [External Services]**
- ↓                    ↓                     ↓
**[Data Storage] ←→ [Monitoring Engine] ←→ [Alert System]**

Key considerations:
##### Security implementations across layers

This architecture should reflect the hybrid nature of the application while showing how it achieves its core monitoring and alerting functionality across multiple platforms.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Presentation Layer"
        UI["User Interface Templates"]:::ui
        Controllers["Frontend Controllers"]:::frontend
        Services["Core Services"]:::frontend
    end

    subgraph "Cordova Plugin Layer"
        InAppBrowser["In-App Browser Service"]:::plugin
        NetworkInfo["Network Information Service"]:::plugin
        JPush["Push Notification Service"]:::plugin
        Device["Device Plugin"]:::plugin
    end

    subgraph "Native Platform Layer"
        iOS["iOS Implementation"]:::platform
        Android["Android Implementation"]:::platform
    end

    subgraph "Core Services Layer"
        Auth["Authentication Service"]:::service
        WebMon["Website Monitoring Service"]:::service
        SpeedTest["Speed Testing Service"]:::service
        SEOMon["SEO Monitoring Service"]:::service
    end

    subgraph "External Integrations"
        SMS["SMS Gateway"]:::external
        Voice["Voice Call Service"]:::external
        SearchAPI["Search Engine APIs"]:::external
    end

    subgraph "Monitoring Components"
        MonEngine["Monitoring Engine"]:::monitoring
        AlertSys["Alert System"]:::monitoring
        DataStore["Data Storage"]:::monitoring
    end

    UI --> Controllers
    Controllers --> Services
    Services --> |Authentication| Auth
    Services --> |Monitoring| WebMon
    Services --> |Testing| SpeedTest
    Services --> |SEO| SEOMon

    Auth --> DataStore
    WebMon --> MonEngine
    SpeedTest --> MonEngine
    SEOMon --> MonEngine
    MonEngine --> AlertSys
    AlertSys --> JPush
    MonEngine --> DataStore

    JPush --> iOS
    JPush --> Android
    InAppBrowser --> iOS
    InAppBrowser --> Android
    NetworkInfo --> iOS
    NetworkInfo --> Android
    Device --> iOS
    Device --> Android

    AlertSys --> SMS
    AlertSys --> Voice
    SEOMon --> SearchAPI

    %% Styles
    classDef ui fill:#e1f5fe,stroke:#01579b
    classDef frontend fill:#e8f5e9,stroke:#2e7d32
    classDef plugin fill:#fff3e0,stroke:#ff6f00
    classDef platform fill:#f3e5f5,stroke:#7b1fa2
    classDef service fill:#e8eaf6,stroke:#3f51b5
    classDef external fill:#fbe9e7,stroke:#d84315
    classDef monitoring fill:#f1f8e9,stroke:#558b2f

    %% Click Events
    click UI "https://github.com/ParryQiu/GuGuJianKong/tree/master/www/templates/*"
    click Controllers "https://github.com/ParryQiu/GuGuJianKong/blob/master/www/js/controllers.js"
    click Services "https://github.com/ParryQiu/GuGuJianKong/blob/master/www/js/services.js"
    click JPush "https://github.com/ParryQiu/GuGuJianKong/blob/master/plugins/cn.jpush.phonegap.JPushPlugin"
    click InAppBrowser "https://github.com/ParryQiu/GuGuJianKong/tree/master/plugins/cordova-plugin-inappbrowser"
    click NetworkInfo "https://github.com/ParryQiu/GuGuJianKong/tree/master/plugins/cordova-plugin-network-information"
    click iOS "https://github.com/ParryQiu/GuGuJianKong/tree/master/platforms/ios/GuGuJianKong"
    click Android "https://github.com/ParryQiu/GuGuJianKong/tree/master/platforms/android/src/com/gugujiankong/iosapp"
```
