# rxssett11/yamisa-app architecture

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

- Interactive diagram: https://gitdiagram.com/rxssett11/yamisa-app
- Repository: https://github.com/rxssett11/yamisa-app

## Overview

##### Project type and purpose
- This is a hybrid mobile application built with Expo/React Native and TypeScript.
- Purpose: Provide PyMEs in the cut-and-sew sector an inventory, sales and production-cost management tool. Users log in, track raw-material and product stock, analyze sales trends, and receive stock alerts. Data persistence and auth are handled by Supabase.

##### File structure
- Top-level “app” directory follows the Expo Router convention:
- app/(tabs)/… — Tab-based screens (Explore, Items, Results, Contact, etc.)
- app/auth/* — Authentication layout and login screen
- app/_layout.tsx & app/appNavigator.tsx — Global navigation shells, theming and layout
- app/index.tsx — Entry point or default landing screen
- “components” — Reusable UI components (Collapsible, ParallaxScrollView, ThemedText/View, TabBarBackground, etc.)
- “hooks” — Custom hooks for theming/useColorScheme
- “lib/supabase.ts” — Supabase client wrapper for API calls (auth, CRUD)
- “assets” — Fonts and images
- “scripts/reset-project.js” — Development helper
- Config files: tsconfig.json, package.json, app.json

##### README for additional insights
- Confirms Expo + React Native front end, Supabase back end, Node 16+
- Features: Inventory management, sales analytics, production cost tracking, stock alerts
- Intended for small/medium enterprises (PyMEs)

##### Detailed breakdown
– Frontend block:
- “app/(tabs)” — Tab screens (Explore, Items, Results, Contact)
- “app/auth” — Login flow
- “components/” — Shared UI
- “hooks/” — Theme & business logic hooks
- “lib/supabase.ts” — API client
– Backend block (Supabase):
- Auth service
- PostgreSQL tables & PostgREST API
- Realtime subscriptions
– External block (optional):
- Push Notification service for stock alerts

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Mobile App (Expo/React Native)" 
        direction TB
        subgraph "Tab Navigator" 
            TabNav["app/(tabs)/"]:::frontend
        end
        subgraph "Authentication Flow"
            AuthFlow["app/auth/"]:::frontend
        end
        subgraph "Global Layout & Navigation"
            GlobalNav1["_layout.tsx"]:::frontend
            GlobalNav2["appNavigator.tsx"]:::frontend
        end
        EntryPoint["index.tsx"]:::frontend
        subgraph "Reusable UI Components"
            Components["components/"]:::frontend
            CompText["ThemedText.tsx"]:::frontend
            CompView["ThemedView.tsx"]:::frontend
        end
        subgraph "Shared UI & Custom Inputs"
            Collapsible["Collapsible.tsx"]:::frontend
            ParallaxScrollView["ParallaxScrollView.tsx"]:::frontend
            ExternalLink["ExternalLink.tsx"]:::frontend
            HapticTab["HapticTab.tsx"]:::frontend
            Inputs["inputs.tsx"]:::frontend
            TabBarBackground["TabBarBackground.(ios).tsx"]:::frontend
            IconSymbol["IconSymbol.(ios).tsx"]:::frontend
        end
        subgraph "Hooks"
            useColorScheme["useColorScheme.ts"]:::frontend
            useColorSchemeWeb["useColorScheme.web.ts"]:::frontend
            useThemeColor["useThemeColor.ts"]:::frontend
        end
        SupabaseClient["lib/supabase.ts"]:::frontend
        ColorsConst["Colors.ts"]:::frontend
        ResetScript["reset-project.js"]:::frontend
        subgraph "Config Files"
            AppJson["app.json"]:::frontend
            TSConfig["tsconfig.json"]:::frontend
            PackageJson["package.json"]:::frontend
        end
    end

    subgraph "Supabase Backend" 
        direction TB
        SupAuth["Supabase Auth Service"]:::backend
        SupDB["PostgreSQL & PostgREST"]:::backend
        SupRealtime["Realtime API"]:::backend
    end

    subgraph "External Services"
        PushNotif["Push Notification Service"]:::external
    end

    EntryPoint -->|"Auth API calls"| SupAuth
    EntryPoint -->|"CRUD API calls"| SupDB
    EntryPoint -->|"subscribe() to updates"| SupRealtime
    SupDB -->|"real-time updates"| EntryPoint
    PushNotif -->|"stock alerts"| EntryPoint

    click TabNav "https://github.com/rxssett11/yamisa-app/tree/main/app/(tabs)/"
    click AuthFlow "https://github.com/rxssett11/yamisa-app/tree/main/app/auth/"
    click GlobalNav1 "https://github.com/rxssett11/yamisa-app/blob/main/app/_layout.tsx"
    click GlobalNav2 "https://github.com/rxssett11/yamisa-app/blob/main/app/appNavigator.tsx"
    click EntryPoint "https://github.com/rxssett11/yamisa-app/blob/main/app/index.tsx"
    click Components "https://github.com/rxssett11/yamisa-app/tree/main/components/"
    click CompText "https://github.com/rxssett11/yamisa-app/blob/main/components/ThemedText.tsx"
    click CompView "https://github.com/rxssett11/yamisa-app/blob/main/components/ThemedView.tsx"
    click Collapsible "https://github.com/rxssett11/yamisa-app/blob/main/components/Collapsible.tsx"
    click ParallaxScrollView "https://github.com/rxssett11/yamisa-app/blob/main/components/ParallaxScrollView.tsx"
    click ExternalLink "https://github.com/rxssett11/yamisa-app/blob/main/components/ExternalLink.tsx"
    click HapticTab "https://github.com/rxssett11/yamisa-app/blob/main/components/HapticTab.tsx"
    click Inputs "https://github.com/rxssett11/yamisa-app/blob/main/components/inputs.tsx"
    click TabBarBackground "https://github.com/rxssett11/yamisa-app/blob/main/components/ui/TabBarBackground.(ios).tsx"
    click IconSymbol "https://github.com/rxssett11/yamisa-app/blob/main/components/ui/IconSymbol.(ios).tsx"
    click useColorScheme "https://github.com/rxssett11/yamisa-app/blob/main/hooks/useColorScheme.ts"
    click useColorSchemeWeb "https://github.com/rxssett11/yamisa-app/blob/main/hooks/useColorScheme.web.ts"
    click useThemeColor "https://github.com/rxssett11/yamisa-app/blob/main/hooks/useThemeColor.ts"
    click SupabaseClient "https://github.com/rxssett11/yamisa-app/blob/main/lib/supabase.ts"
    click ColorsConst "https://github.com/rxssett11/yamisa-app/blob/main/constants/Colors.ts"
    click ResetScript "https://github.com/rxssett11/yamisa-app/blob/main/scripts/reset-project.js"
    click AppJson "https://github.com/rxssett11/yamisa-app/blob/main/app.json"
    click TSConfig "https://github.com/rxssett11/yamisa-app/blob/main/tsconfig.json"
    click PackageJson "https://github.com/rxssett11/yamisa-app/blob/main/package.json"

    classDef frontend fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef backend fill:#90EE90,stroke:#333,stroke-width:1px
    classDef external fill:#FFA500,stroke:#333,stroke-width:1px
```
