# smitray/investkarr architecture

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

- Interactive diagram: https://gitdiagram.com/smitray/investkarr
- Repository: https://github.com/smitray/investkarr

## Overview

##### Main System Components

A. Presentation Layer
- Auth Module structure
- Shared Components system

B. State Management Layer
- Store implementation
- State flow patterns

C. Theme and Styling Layer
- Demonstrate the theming system
- Style utilities

##### Component Relationships

**┌─ Application Core ─────────────────────────────────┐**

- ┌─ Auth Module ──────────┐                       │
- Login                │                       │
- Signup              ─┼──┐                    │
- Recovery            │  │                     │
- Onboarding          │  │                     │
- ┘  │                    │

- ┌─ Shared ────────────────┐ │                    │

- ┌─ UI Components ─────┐ │ │                    │
- Buttons          │ │ │                     │
- Inputs           │ │ │                     │
- Layout          │ │ │                     │
- Headers         │ │ │                     │
- ┘ │ │                     │

- ┌─ Store ───────────┐ │ │                     │

- Signup Store ────┼─┘ │                     │
- ┘   │                     │

- ┌─ Theme ───────────┐   │                     │
- Styles         │   │                     │
- Theme Config   │   │                     │
- ┘   │                     │
- ┘                     │

- ┘

##### Flow Indicators

- → Data flow between components
- ⇢ Component dependencies
- ⇄ Two-way binding for state management

##### Technical Stack Indicators

Technologies:
- React Native/Expo
- TypeScript
- Custom UI Components
- State Management Solution

##### Validation and Process Flows

- OTP validation flow
- Password validation
- PIN verification
- Date of birth validation

Remember to:
- Document component relationships clearly
- Modular structure of the auth system

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph App["Application Core"]
        subgraph AuthModule["Auth Module"]
            Login["Login"]:::auth
            Signup["Signup"]:::auth
            Recovery["Recovery"]:::auth
            Onboarding["Onboarding"]:::auth
            
            subgraph AuthShared["Auth Shared"]
                VerifyOTP["OTP Verification"]:::authShared
                Password["Password"]:::authShared
                Phone["Phone"]:::authShared
                PIN["PIN"]:::authShared
                DOB["Date of Birth"]:::authShared
            end
        end

        subgraph Shared["Shared Components"]
            subgraph UI["UI Components"]
                Button["Button"]:::ui
                TextInput["Text Input"]:::ui
                Layout["Layout"]:::ui
                Headers["Headers"]:::ui
                AuthLayout["Auth Layout"]:::ui
            end

            subgraph Store["State Management"]
                SignupStore["Signup Store"]:::store
            end

            subgraph Theme["Theme System"]
                ThemeConfig["Theme Configuration"]:::theme
                Styles["Styles"]:::theme
            end

            subgraph Validation["Validation Hooks"]
                OTPValidation["OTP Validation"]:::validation
                PasswordValidation["Password Validation"]:::validation
                PINValidation["PIN Validation"]:::validation
                DOBValidation["DOB Validation"]:::validation
            end

            subgraph Screens["Screen Components"]
                OTPScreen["OTP Screen"]:::screen
                PINScreen["PIN Screen"]:::screen
            end
        end
    end

    %% Relationships
    Login --> AuthShared
    Signup --> AuthShared
    Recovery --> AuthShared
    Onboarding --> AuthShared

    AuthShared --> UI
    AuthShared --> Validation
    AuthShared --> Screens

    Screens --> UI
    Screens --> Store

    %% Click Events
    click Login "https://github.com/smitray/investkarr/tree/main/src/modules/auth/login/"
    click Signup "https://github.com/smitray/investkarr/tree/main/src/modules/auth/signup/"
    click Recovery "https://github.com/smitray/investkarr/tree/main/src/modules/auth/recovery/"
    click Onboarding "https://github.com/smitray/investkarr/tree/main/src/modules/auth/onboarding/"
    click Button "https://github.com/smitray/investkarr/blob/main/src/shared/ui/button.tsx"
    click TextInput "https://github.com/smitray/investkarr/blob/main/src/shared/ui/text-input.tsx"
    click Layout "https://github.com/smitray/investkarr/blob/main/src/shared/ui/layout.tsx"
    click Headers "https://github.com/smitray/investkarr/tree/main/src/shared/ui/header/"
    click AuthLayout "https://github.com/smitray/investkarr/blob/main/src/shared/components/auth-layout.tsx"
    click SignupStore "https://github.com/smitray/investkarr/blob/main/src/shared/store/signup-store.ts"
    click ThemeConfig "https://github.com/smitray/investkarr/blob/main/src/shared/theme/theme.ts"
    click Styles "https://github.com/smitray/investkarr/blob/main/src/shared/style/style.ts"
    click OTPValidation "https://github.com/smitray/investkarr/blob/main/src/shared/components/hooks/otp-validation.tsx"
    click PasswordValidation "https://github.com/smitray/investkarr/blob/main/src/shared/components/hooks/password-validation.tsx"
    click PINValidation "https://github.com/smitray/investkarr/blob/main/src/shared/components/hooks/pin-validation.tsx"
    click DOBValidation "https://github.com/smitray/investkarr/blob/main/src/shared/components/hooks/dob-validation.tsx"
    click VerifyOTP "https://github.com/smitray/investkarr/blob/main/src/modules/auth/shared/verify-otp.tsx"
    click Password "https://github.com/smitray/investkarr/blob/main/src/modules/auth/shared/password.tsx"
    click Phone "https://github.com/smitray/investkarr/blob/main/src/modules/auth/shared/phone.tsx"
    click PIN "https://github.com/smitray/investkarr/blob/main/src/modules/auth/shared/pin.tsx"
    click DOB "https://github.com/smitray/investkarr/blob/main/src/modules/auth/shared/dob.tsx"
    click OTPScreen "https://github.com/smitray/investkarr/blob/main/src/shared/components/screens/otp-screen.tsx"
    click PINScreen "https://github.com/smitray/investkarr/blob/main/src/shared/components/screens/pin.tsx"

    %% Styles
    classDef auth fill:#FF9900,stroke:#fff,stroke-width:2px
    classDef authShared fill:#FFB366,stroke:#fff,stroke-width:2px
    classDef ui fill:#3498DB,stroke:#fff,stroke-width:2px
    classDef store fill:#9B59B6,stroke:#fff,stroke-width:2px
    classDef theme fill:#F1C40F,stroke:#fff,stroke-width:2px
    classDef validation fill:#2ECC71,stroke:#fff,stroke-width:2px
    classDef screen fill:#E74C3C,stroke:#fff,stroke-width:2px
```
