# nabishirinov/greentech-globalthon architecture

> Architecture diagram of the GitHub repository nabishirinov/greentech-globalthon, 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/nabishirinov/greentech-globalthon
- Repository: https://github.com/nabishirinov/greentech-globalthon

## Overview

##### Main Application Components (Top Level)

a. Mobile Application Layer
- React Native cross-platform architecture (iOS & Android)
- Metro bundler as the build/packaging system
- Native bridges for both platforms

b. Frontend Architecture (Core Components)
- Screens Layer (Entry points)
- Components Layer (Reusable UI elements)
- Contexts Layer (State management)
- Routes Layer (Navigation system)
- Layouts Layer (Structural components)

c. Backend Integration
- API Layer (shown in /api directory)
- Hardware Manager System (from /components/HardwareManager)
- Data flow controllers

##### Key Functional Modules (Second Level)

- Authentication System (Login/Signup screens)
- Field Management System
- Garden Monitoring
- Weather Integration
- Hardware Control System
- Status Monitoring
- Camera Integration

##### Data Flow and State Management

- Context providers (ThemeContext, NotificationContext, HardwareDatas)
- API communication paths
- Hardware data flow
- State updates and component communication

##### Specific technical details

- React Native as the core framework
- Native modules for iOS (Swift/Objective-C) and Android (Kotlin)
- Metro bundler for JavaScript bundling
- Hardware integration protocols
- API endpoints structure

##### Top Section
- React Native bridge
- Metro bundler

##### Middle Section
- Core application architecture
- Main feature modules
- State management system

##### Bottom Section
- API integration
- Hardware communication
- External services

Important Elements to Include:

##### Component Hierarchy
- App.jsx
- Initial Routes
- Login Screen
- Signup Screen
- Main Routes
- Home Screen
- Field Management
- Control Screen
- Settings

##### Integration Points
- Hardware interfaces
- API endpoints
- Native module bridges

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Mobile Application Layer"
        iOS["iOS Native"]
        Android["Android Native"]
        RNCore["React Native Core"]
        Metro["Metro Bundler"]
        App["Application Root"]
    end

    subgraph "Frontend Architecture"
        Screens["Screens Layer"]
        Components["Components Layer"]
        Contexts["Contexts Layer"]
        Routes["Routes Layer"]
        Layouts["Layouts Layer"]
    end

    subgraph "Authentication"
        Login["Login Screen"]:::auth
        Signup["Signup Screen"]:::auth
        InitRoutes["Initial Routes"]:::routes
    end

    subgraph "Main Features"
        FieldMgmt["Field Management"]:::field
        FieldDetail["Field Detail"]:::field
        FieldControl["Field Control"]:::field
        Garden["Garden Monitoring"]:::monitoring
        Weather["Weather Integration"]:::monitoring
        Status["Status Monitoring"]:::monitoring
        Camera["Camera System"]:::monitoring
    end

    subgraph "State Management"
        ThemeCtx["Theme Context"]:::state
        NotifCtx["Notification Context"]:::state
        HWDataCtx["Hardware Data Context"]:::state
    end

    subgraph "UI Components"
        Cards["Cards"]:::ui
        Charts["Charts"]:::ui
        Search["Search"]:::ui
    end

    subgraph "Backend Integration"
        API["API Layer"]:::backend
        HWManager["Hardware Manager"]:::backend
        MainRoutes["Main Routes"]:::routes
    end

    %% Connections
    iOS --> RNCore
    Android --> RNCore
    RNCore --> Metro
    Metro --> App
    App --> InitRoutes
    App --> MainRoutes

    InitRoutes --> Login
    InitRoutes --> Signup

    MainRoutes --> FieldMgmt
    FieldMgmt --> FieldDetail
    FieldMgmt --> FieldControl
    MainRoutes --> Garden
    MainRoutes --> Weather
    MainRoutes --> Status
    MainRoutes --> Camera

    Components --> Cards
    Components --> Charts
    Components --> Search

    Contexts --> ThemeCtx
    Contexts --> NotifCtx
    Contexts --> HWDataCtx

    HWManager -.-> API
    API -.-> MainRoutes

    %% Styling
    classDef auth fill:#ff6b6b
    classDef field fill:#51cf66
    classDef monitoring fill:#339af0
    classDef state fill:#845ef7
    classDef ui fill:#868e96
    classDef backend fill:#ff922b
    classDef routes fill:#20c997

    %% Click events
    click iOS "https://github.com/NabiShirinov/greentech-globalthon/tree/main/ios"
    click Android "https://github.com/NabiShirinov/greentech-globalthon/tree/main/android"
    click App "https://github.com/NabiShirinov/greentech-globalthon/blob/main/App.jsx"
    click Screens "https://github.com/NabiShirinov/greentech-globalthon/tree/main/src/screens"
    click Components "https://github.com/NabiShirinov/greentech-globalthon/tree/main/src/components"
    click Contexts "https://github.com/NabiShirinov/greentech-globalthon/tree/main/src/contexts"
    click Routes "https://github.com/NabiShirinov/greentech-globalthon/tree/main/src/routes"
    click Layouts "https://github.com/NabiShirinov/greentech-globalthon/tree/main/src/layouts"
    click API "https://github.com/NabiShirinov/greentech-globalthon/tree/main/api"
    click HWManager "https://github.com/NabiShirinov/greentech-globalthon/blob/main/src/components/HardwareManager/ApiFetch.js"
    click Login "https://github.com/NabiShirinov/greentech-globalthon/tree/main/src/screens/Initial_Screens/Login_Screen"
    click Signup "https://github.com/NabiShirinov/greentech-globalthon/tree/main/src/screens/Initial_Screens/Signup_Screen"
    click FieldMgmt "https://github.com/NabiShirinov/greentech-globalthon/tree/main/src/components/Fields"
    click FieldDetail "https://github.com/NabiShirinov/greentech-globalthon/tree/main/src/components/Fields/FieldDetail"
    click FieldControl "https://github.com/NabiShirinov/greentech-globalthon/tree/main/src/components/Fields/FieldControl"
    click Garden "https://github.com/NabiShirinov/greentech-globalthon/blob/main/src/components/Garden/Garden.jsx"
    click Weather "https://github.com/NabiShirinov/greentech-globalthon/blob/main/src/components/Weather/Weather.jsx"
    click Status "https://github.com/NabiShirinov/greentech-globalthon/blob/main/src/components/StatusDetail/StatusDetail.jsx"
    click ThemeCtx "https://github.com/NabiShirinov/greentech-globalthon/blob/main/src/contexts/ThemeContext.jsx"
    click NotifCtx "https://github.com/NabiShirinov/greentech-globalthon/blob/main/src/contexts/NotificationContext.jsx"
    click HWDataCtx "https://github.com/NabiShirinov/greentech-globalthon/blob/main/src/contexts/HardwareDatas.js"
    click InitRoutes "https://github.com/NabiShirinov/greentech-globalthon/blob/main/src/routes/Init_Routes.jsx"
    click MainRoutes "https://github.com/NabiShirinov/greentech-globalthon/blob/main/src/routes/Main_Routes.jsx"
    click Camera "https://github.com/NabiShirinov/greentech-globalthon/blob/main/src/screens/Main_Screens/Camera_Screen/Camera_Screen.jsx"
    click Cards "https://github.com/NabiShirinov/greentech-globalthon/tree/main/src/components/Cards"
    click Charts "https://github.com/NabiShirinov/greentech-globalthon/tree/main/src/components/Charts"
    click Search "https://github.com/NabiShirinov/greentech-globalthon/blob/main/src/components/Search/Search.jsx"
```
