# exviolet/tapytap-expo architecture

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

- Interactive diagram: https://gitdiagram.com/exviolet/tapytap-expo
- Repository: https://github.com/exviolet/tapytap-expo

## Overview

##### Project type and purpose
- From the file tree and minimal README (# TapyTap-expo), this is a full-stack, cross-platform mobile habit-tracker app built with React Native (Expo) for iOS and Android.
- It provides screens for login/registration, habit creation, calendar view, statistics, settings, etc., persists data via Supabase (and appears to include Firebase config for possible auth/analytics), and manages client-side state with React Context and a custom hook/store.

##### File structure
- Top-level files: App.tsx, index.ts, package.json, tsconfig.json, assets folder
- Native iOS (ios/) and Android (android/) project scaffolds (Expo-managed)
- src/ subdivided into:
- components/ (UI building blocks)
- contexts/ (AuthContext for user/session state)
- lib/ (business logic helper: habits.ts)
- navigation/ (AppNavigator with React Navigation)
- screens/ (one file per screen)
- store/ (useHabitStore.ts, likely using Zustand or similar)
- firebase/ and supabase/ directories (clients and config)
- Build and config files for both platforms, Babel, and Expo app.json

##### README for additional insights
- README is sparse, but project naming (“expo”) indicates Expo CLI management

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Native Host Layer
    subgraph "Native Host"
        direction TB
        NP1["MainActivity.kt"]:::native
        NP2["MainApplication.kt"]:::native
        NP3["AppDelegate.swift"]:::native
        JS["React Native Runtime"]:::native
    end
    NP1 --> JS
    NP2 --> JS
    NP3 --> JS

    %% Mobile App
    subgraph "Mobile App (Expo/React Native)"
        direction TB

        %% App Entry
        subgraph "App Entry"
            direction TB
            App["App.tsx"]:::frontend
        end

        App --> Nav

        %% Navigation Layer
        subgraph "Navigation Layer"
            direction TB
            Nav["AppNavigator.tsx"]:::frontend
        end

        Nav --> Screens

        %% UI Layer
        subgraph "UI - Screens & Components"
            direction TB
            Screens["Screens (src/screens/)"]:::frontend
            Components["Components (src/components/)"]:::frontend
        end

        Screens --> Components
        Screens --> Auth
        Screens --> Store
        Components --> Auth

        %% State & Business Logic
        subgraph "State & Business Logic"
            direction TB
            Auth["AuthContext.tsx"]:::state
            Store["useHabitStore.ts"]:::state
            Habits["habits.ts"]:::state
        end

        Auth --> SupClient
        Store --> Habits
        Habits --> SupClient

        %% API Clients
        subgraph "API Clients"
            direction TB
            SupClient["supabaseClient.ts"]:::api
            Firebase["firebaseConfig.ts"]:::api
        end

        SupClient --> SupabaseDB
        Firebase --> FirebaseSvc
    end

    %% External Services
    SupabaseDB[(Supabase)]:::external
    FirebaseSvc[(Firebase)]:::external

    %% Click Events
    click App "https://github.com/exviolet/tapytap-expo/blob/master/App.tsx"
    click Components "https://github.com/exviolet/tapytap-expo/tree/master/src/components/"
    click Screens "https://github.com/exviolet/tapytap-expo/tree/master/src/screens/"
    click Nav "https://github.com/exviolet/tapytap-expo/blob/master/src/navigation/AppNavigator.tsx"
    click Auth "https://github.com/exviolet/tapytap-expo/blob/master/src/contexts/AuthContext.tsx"
    click Store "https://github.com/exviolet/tapytap-expo/blob/master/src/store/useHabitStore.ts"
    click Habits "https://github.com/exviolet/tapytap-expo/blob/master/src/lib/habits.ts"
    click SupClient "https://github.com/exviolet/tapytap-expo/blob/master/src/supabase/supabaseClient.ts"
    click Firebase "https://github.com/exviolet/tapytap-expo/blob/master/src/firebase/firebaseConfig.ts"
    click NP1 "https://github.com/exviolet/tapytap-expo/blob/master/android/app/src/main/java/com/anonymous/habittrackerapp/MainActivity.kt"
    click NP2 "https://github.com/exviolet/tapytap-expo/blob/master/android/app/src/main/java/com/anonymous/habittrackerapp/MainApplication.kt"
    click NP3 "https://github.com/exviolet/tapytap-expo/blob/master/ios/habittrackerapp/AppDelegate.swift"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef state fill:#98FB98,stroke:#333,stroke-width:1px
    classDef api fill:#FFA500,stroke:#333,stroke-width:1px
    classDef external fill:#DDA0DD,stroke:#333,stroke-width:1px
    classDef native fill:#D3D3D3,stroke:#333,stroke-width:1px
```
