# sebastiannarvaez11/schoolpayappv2 architecture

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

- Interactive diagram: https://gitdiagram.com/sebastiannarvaez11/schoolpayappv2
- Repository: https://github.com/sebastiannarvaez11/schoolpayappv2

## Overview

##### Project Type and Purpose
- This project is a React Native mobile application created using the official React Native CLI. It is designed for both Android and iOS platforms.
- The project is structured as a full-stack mobile app where the JavaScript/TypeScript layer (React Native) interfaces with native components on Android and iOS. It appears to include modular business logic (e.g., an authentication module) and uses a clear separation of concerns across UI, state management, and domain logic.

##### Analyzing the File Structure
a. Native Directories:
- The directories “android” and “ios” contain native code specific for each platform. They include configuration files, build scripts, native resource files (like Android manifests, gradle settings, Xcode projects, assets, etc.).
- These represent the native shell that boots up the React Native JavaScript code.

b. JavaScript/TypeScript Layer:
- The “src” directory holds the main app logic.
- The “adapters” and “config” directories abstract storage adapters and API settings (like a specific schoolpayApi), which allows for integration with external services.

c. Supporting Files:
- Configuration files (e.g., .eslintrc.js, tsconfig.json, babel.config.js) as well as testing files (in “__tests__”) indicate standard practices in code style and testing.
- The README explains how to run the Metro bundler and start the application on both Android and iOS.

- Presentation (components, navigation, screens, providers)
- Business Logic (modules such as auth with their own sub-modules: actions, domain, infrastructure)
- Adapters & API Configurations.
- That every extracted element (from file tree and README) is accounted for and clearly labeled.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Metro Bundler/React Native Runtime
    subgraph "Metro Bundler/React Native Runtime"
        MB1["Metro Bundler Config"]:::metro
        MB2["Metro Bundler Entry"]:::metro
    end

    %% React Native App (JS/TS Layer)
    subgraph "React Native App (JS/TS Layer)"
        %% Presentation Layer (Screens, Navigation, Providers, Store)
        subgraph "Presentation Layer"
            PS1["Home Screen"]:::presentation
            PS2["Splash Screen"]:::presentation
            PN1["RootStack Navigation"]:::presentation
            PN2["Navigation Index"]:::presentation
            PP1["Auth Provider"]:::presentation
            PP2["Theme Provider"]:::presentation
            ST1["Auth Store"]:::presentation
            ST2["Theme Store"]:::presentation
            ST3["Store Index"]:::presentation
        end

        %% Auth Module (Business Logic)
        subgraph "Auth Module"
            %% Actions
            subgraph "Actions"
                A1["Login Action"]:::auth
                A2["Check-Status Action"]:::auth
                A3["Actions Index"]:::auth
            end
            %% Domain Models
            subgraph "Domain Models"
                D1["User Model"]:::auth
                D2["School Model"]:::auth
                D3["Domain Index"]:::auth
            end
            %% Infrastructure
            subgraph "Infrastructure"
                I1["Auth Interface"]:::auth
                I2["Auth Mapper"]:::auth
                I3["Infrastructure Index"]:::auth
            end
            %% Auth Presentation
            subgraph "Auth Presentation"
                AP1["Login Screen"]:::auth
            end
        end

        %% Adapters & API Configuration
        subgraph "Adapters & API Configuration"
            subgraph "Adapters"
                AD1["Adapters Index"]:::adapters
                AD2["Storage Adapter"]:::adapters
            end
            subgraph "API Configuration"
                API1["Schoolpay API"]:::adapters
            end
        end

        %% General Configuration
        subgraph "General Configuration"
            GC1["Config Index"]:::config
            GC2["Theme Config"]:::config
            GC3["ESLint Config"]:::config
            GC4["Babel Config"]:::config
            GC5["TSConfig"]:::config
        end
    end

    %% Native Containers
    subgraph "Native Containers"
        AN["Android Native Container"]:::native
        IN["iOS Native Container"]:::native
    end

    %% Flow Connections
    MB2 -->|"starts"| PS1
    PN1 -->|"updates"| ST3
    PP1 -->|"triggers"| A1
    A3 -->|"calls"| AD1
    ST3 -->|"deploys to"| AN
    ST3 -->|"deploys to"| IN

    %% Click Events for Metro Bundler/React Native Runtime
    click MB1 "https://github.com/sebastiannarvaez11/schoolpayappv2/blob/main/metro.config.js"
    click MB2 "https://github.com/sebastiannarvaez11/schoolpayappv2/blob/main/index.js"

    %% Click Events for Native Containers
    click AN "https://github.com/sebastiannarvaez11/schoolpayappv2/tree/main/android/"
    click IN "https://github.com/sebastiannarvaez11/schoolpayappv2/tree/main/ios/"

    %% Click Events for Presentation Layer
    click PS1 "https://github.com/sebastiannarvaez11/schoolpayappv2/blob/main/src/presentation/screens/home/HomeScreen.tsx"
    click PS2 "https://github.com/sebastiannarvaez11/schoolpayappv2/blob/main/src/presentation/screens/splash/SplashScreen.tsx"
    click PN1 "https://github.com/sebastiannarvaez11/schoolpayappv2/blob/main/src/presentation/navigation/RootStackNavigation.tsx"
    click PN2 "https://github.com/sebastiannarvaez11/schoolpayappv2/blob/main/src/presentation/navigation/index.ts"
    click PP1 "https://github.com/sebastiannarvaez11/schoolpayappv2/blob/main/src/presentation/providers/AuthProvider.tsx"
    click PP2 "https://github.com/sebastiannarvaez11/schoolpayappv2/blob/main/src/presentation/providers/ThemeProvider.tsx"
    click ST1 "https://github.com/sebastiannarvaez11/schoolpayappv2/blob/main/src/presentation/store/authStore.ts"
    click ST2 "https://github.com/sebastiannarvaez11/schoolpayappv2/blob/main/src/presentation/store/themeStore.ts"
    click ST3 "https://github.com/sebastiannarvaez11/schoolpayappv2/blob/main/src/presentation/store/index.ts"

    %% Click Events for Auth Module - Actions
    click A1 "https://github.com/sebastiannarvaez11/schoolpayappv2/blob/main/src/modules/auth/actions/login.ts"
    click A2 "https://github.com/sebastiannarvaez11/schoolpayappv2/blob/main/src/modules/auth/actions/check-status.ts"
    click A3 "https://github.com/sebastiannarvaez11/schoolpayappv2/blob/main/src/modules/auth/actions/index.ts"

    %% Click Events for Auth Module - Domain Models
    click D1 "https://github.com/sebastiannarvaez11/schoolpayappv2/blob/main/src/modules/auth/domain/models/user.ts"
    click D2 "https://github.com/sebastiannarvaez11/schoolpayappv2/blob/main/src/modules/auth/domain/models/school.ts"
    click D3 "https://github.com/sebastiannarvaez11/schoolpayappv2/blob/main/src/modules/auth/domain/index.ts"

    %% Click Events for Auth Module - Infrastructure
    click I1 "https://github.com/sebastiannarvaez11/schoolpayappv2/blob/main/src/modules/auth/infrastructure/interfaces/auth.interface.ts"
    click I2 "https://github.com/sebastiannarvaez11/schoolpayappv2/blob/main/src/modules/auth/infrastructure/mappers/auth.mapper.ts"
    click I3 "https://github.com/sebastiannarvaez11/schoolpayappv2/blob/main/src/modules/auth/infrastructure/index.ts"

    %% Click Events for Auth Module - Presentation
    click AP1 "https://github.com/sebastiannarvaez11/schoolpayappv2/blob/main/src/modules/auth/presentation/screens/login/LoginScreen.tsx"

    %% Click Events for Adapters & API Configuration
    click AD1 "https://github.com/sebastiannarvaez11/schoolpayappv2/blob/main/src/adapters/index.ts"
    click AD2 "https://github.com/sebastiannarvaez11/schoolpayappv2/blob/main/src/adapters/storage.adapter.ts"
    click API1 "https://github.com/sebastiannarvaez11/schoolpayappv2/blob/main/src/config/apis/schoolpayApi.ts"

    %% Click Events for General Configuration
    click GC1 "https://github.com/sebastiannarvaez11/schoolpayappv2/blob/main/src/config/index.ts"
    click GC2 "https://github.com/sebastiannarvaez11/schoolpayappv2/blob/main/src/config/theme/theme.tsx"
    click GC3 "https://github.com/sebastiannarvaez11/schoolpayappv2/blob/main/.eslintrc.js"
    click GC4 "https://github.com/sebastiannarvaez11/schoolpayappv2/blob/main/babel.config.js"
    click GC5 "https://github.com/sebastiannarvaez11/schoolpayappv2/blob/main/tsconfig.json"

    %% Legend
    subgraph "Legend"
        L1["Metro Bundler: light blue"]:::metro
        L2["Presentation Layer: light green"]:::presentation
        L3["Auth Module: light pink"]:::auth
        L4["Adapters & API: light yellow"]:::adapters
        L5["General Config: light purple"]:::config
        L6["Native Containers: light grey"]:::native
    end

    %% Styling Classes
    classDef metro fill:#aed9e0,stroke:#333,stroke-width:2px;
    classDef presentation fill:#c9e4c5,stroke:#333,stroke-width:2px;
    classDef auth fill:#f4b6c2,stroke:#333,stroke-width:2px;
    classDef adapters fill:#f9e79f,stroke:#333,stroke-width:2px;
    classDef config fill:#d2b4de,stroke:#333,stroke-width:2px;
    classDef native fill:#d5dbdb,stroke:#333,stroke-width:2px;
    classDef legend fill:#eeeeee,stroke:#333,stroke-width:1px,stroke-dasharray: 5,5;
```
