# orolfat99/eatzy-test architecture

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

- Interactive diagram: https://gitdiagram.com/orolfat99/eatzy-test
- Repository: https://github.com/orolfat99/eatzy-test

## Overview

##### Project type and purpose
- This is a cross-platform mobile application built with Expo and React Native (TypeScript).
- It uses Expo’s file-based routing, theming, and internationalization (i18n) to deliver an authenticated flow plus a bottom-tabs interface for core features (favorites, random, search, profile).

##### File structure
- Top-level:
- package.json / tsconfig.json / Expo config
- app/ directory holds the entire source code
- assets/ contains fonts, translations, images, shared interfaces
- app/ substructure:
- (auth)/ – screens for login/signup, wrapped in an Auth layout
- (tabs)/ – main bottom-tab screens and a Tabs layout
- _layout.tsx – root layout, where providers and routing are composed
- components/ – reusable UI pieces (e.g., passwordInput)
- pages/ – miscellaneous standalone screens (e.g., settings)
- assets/:
- i18n/ – i18n configuration and locale JSON files
- fonts/ – custom fonts
- interface/ – shared TypeScript interfaces

##### README for additional insights
- Standard Expo “create-expo-app” scaffold
- Emphasis on running with `npx expo start` and editing the **app** directory
- Mentions file-based routing but no backend or external microservices

##### Detail without overcomplicating
- Every directory as a component or subcomponent
- How file-based routing translates into navigation structure
- Context providers and asset imports as first-class architectural elements

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Infrastructure Layer
    Expo["Expo Runtime<br/>React Native Engine"]:::infrastructure
    Index["App Entry Point<br/>app/index.tsx"]:::infrastructure
    RootLayout["_layout.tsx<br/>(Root Layout)"]:::infrastructure

    Expo --> Index
    Index --> RootLayout

    %% Providers Layer
    subgraph "Providers Layer"
        ThemeSetup["Theme Setup<br/>(index.ts)"]:::infrastructure
        Colors["Color Definitions<br/>(colors.ts)"]:::infrastructure
        Light["Light Theme<br/>(lightTheme.ts)"]:::infrastructure
        Dark["Dark Theme<br/>(darkTheme.ts)"]:::infrastructure
        I18nConfig["I18n Config<br/>(i18n.config.ts)"]:::infrastructure
        EnLocale["English Locale<br/>(translation.json)"]:::infrastructure
        CnLocale["Chinese Locale<br/>(translation.json)"]:::infrastructure
    end

    RootLayout --> ThemeSetup
    RootLayout --> I18nConfig
    ThemeSetup --> Colors
    ThemeSetup --> Light
    ThemeSetup --> Dark
    I18nConfig --> EnLocale
    I18nConfig --> CnLocale

    %% Router Layer
    subgraph "Router Layer"
        AuthStack["Auth Stack"]:::navigation
        TabsNav["Tabs Navigator"]:::navigation
    end

    RootLayout --> AuthStack
    RootLayout --> TabsNav

    %% Auth Stack Screens
    subgraph "Auth Stack"
        AuthLayout["_layout.tsx"]:::navigation
        Login["Login Screen"]:::UI
        Name["Name Input Screen"]:::UI
        Password["Password Input Screen"]:::UI
        Signup["Signup Screen"]:::UI
    end

    AuthStack --> AuthLayout
    AuthLayout --> Login
    AuthLayout --> Name
    AuthLayout --> Password
    AuthLayout --> Signup

    %% Tabs Navigator Screens
    subgraph "Tabs Navigator"
        TabsLayout["_layout.tsx"]:::navigation
        Home["Home Tab"]:::UI
        Favorites["Favorites Tab"]:::UI
        Random["Random Tab"]:::UI
        Search["Search Tab"]:::UI
        Profile["Profile Tab"]:::UI
    end

    TabsNav --> TabsLayout
    TabsLayout --> Home
    TabsLayout --> Favorites
    TabsLayout --> Random
    TabsLayout --> Search
    TabsLayout --> Profile

    %% Standalone Pages
    Settings["Settings Page"]:::UI
    RootLayout --> Settings

    %% UI Components Library
    subgraph "UI Components"
        PasswordInput["Password Input Component"]:::UI
        SharedInterface["Shared Interfaces"]:::UI
        FavoritesIcon["Favorites Icon"]:::UI
        RandomIcon["Random Icon"]:::UI
        SearchIcon["Search Icon"]:::UI
        ProfileIcon["Profile Icon"]:::UI
    end

    %% Assets Store
    subgraph "Assets Store"
        AssetsFonts["Fonts"]:::assets
        AssetsImages["Images (Icons)"]:::assets
        AssetsTranslations["Translations"]:::assets
    end

    %% Relationships
    Login --> PasswordInput
    Name --> PasswordInput
    Signup --> PasswordInput
    Home --> FavoritesIcon
    Favorites --> FavoritesIcon
    Random --> RandomIcon
    Search --> SearchIcon
    Profile --> ProfileIcon
    PasswordInput --> AssetsFonts
    FavoritesIcon --> AssetsImages
    RandomIcon --> AssetsImages
    SearchIcon --> AssetsImages
    ProfileIcon --> AssetsImages
    Login --> AssetsTranslations
    Name --> AssetsTranslations
    Password --> AssetsTranslations
    Signup --> AssetsTranslations

    %% Click Events
    click Index "https://github.com/orolfat99/eatzy-test/blob/main/app/index.tsx"
    click RootLayout "https://github.com/orolfat99/eatzy-test/blob/main/app/_layout.tsx"
    click ThemeSetup "https://github.com/orolfat99/eatzy-test/blob/main/app/theme/index.ts"
    click Colors "https://github.com/orolfat99/eatzy-test/blob/main/app/theme/colors.ts"
    click Light "https://github.com/orolfat99/eatzy-test/blob/main/app/theme/lightTheme.ts"
    click Dark "https://github.com/orolfat99/eatzy-test/blob/main/app/theme/darkTheme.ts"
    click I18nConfig "https://github.com/orolfat99/eatzy-test/blob/main/assets/i18n/i18n.config.ts"
    click EnLocale "https://github.com/orolfat99/eatzy-test/blob/main/assets/i18n/locales/en-US/translation.json"
    click CnLocale "https://github.com/orolfat99/eatzy-test/blob/main/assets/i18n/locales/zh-CN/translation.json"
    click AuthLayout "https://github.com/orolfat99/eatzy-test/blob/main/app/(auth)/_layout.tsx"
    click Login "https://github.com/orolfat99/eatzy-test/blob/main/app/(auth)/login.tsx"
    click Name "https://github.com/orolfat99/eatzy-test/blob/main/app/(auth)/name.tsx"
    click Password "https://github.com/orolfat99/eatzy-test/blob/main/app/(auth)/password.tsx"
    click Signup "https://github.com/orolfat99/eatzy-test/blob/main/app/(auth)/signup.tsx"
    click TabsLayout "https://github.com/orolfat99/eatzy-test/blob/main/app/(tabs)/_layout.tsx"
    click Home "https://github.com/orolfat99/eatzy-test/blob/main/app/(tabs)/index.tsx"
    click Favorites "https://github.com/orolfat99/eatzy-test/blob/main/app/(tabs)/favorites.tsx"
    click Random "https://github.com/orolfat99/eatzy-test/blob/main/app/(tabs)/random.tsx"
    click Search "https://github.com/orolfat99/eatzy-test/blob/main/app/(tabs)/search.tsx"
    click Profile "https://github.com/orolfat99/eatzy-test/blob/main/app/(tabs)/profile.tsx"
    click Settings "https://github.com/orolfat99/eatzy-test/blob/main/app/pages/setting.tsx"
    click PasswordInput "https://github.com/orolfat99/eatzy-test/blob/main/app/components/passwordInput.tsx"
    click SharedInterface "https://github.com/orolfat99/eatzy-test/blob/main/assets/interface/sharedInterface.tsx"
    click FavoritesIcon "https://github.com/orolfat99/eatzy-test/blob/main/assets/images/bottomBarIcon/favorites.tsx"
    click RandomIcon "https://github.com/orolfat99/eatzy-test/blob/main/assets/images/bottomBarIcon/fork.tsx"
    click SearchIcon "https://github.com/orolfat99/eatzy-test/blob/main/assets/images/bottomBarIcon/search.tsx"
    click ProfileIcon "https://github.com/orolfat99/eatzy-test/blob/main/assets/images/bottomBarIcon/profile.tsx"
    click AssetsFonts "https://github.com/orolfat99/eatzy-test/tree/main/assets/fonts"

    %% Styles
    classDef infrastructure fill:#D0E8FF,stroke:#0366d6,color:#0366d6
    classDef navigation fill:#D6F5D6,stroke:#28a745,color:#28a745
    classDef UI fill:#FFE5CC,stroke:#d97706,color:#d97706
    classDef assets fill:#E0E0E0,stroke:#6c757d,color:#6c757d
```
