# stevenpersia/tinder-expo architecture

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

- Interactive diagram: https://gitdiagram.com/stevenpersia/tinder-expo
- Repository: https://github.com/stevenpersia/tinder-expo

## Overview

##### Project type and purpose
- This is a **mobile client application** (no backend code in this repo)
- Built with **Expo** (managed React Native workflow) and **TypeScript**
- Four main screens: Explore (Home), Matches, Messages, Profile
- Pure UI focus: card swiping, lists, navigation

A. Application Shell
- App.tsx – initializes the app, wraps everything in Expo/React Navigation
- Navigation Container + Bottom Tab Navigator (tabs for Home, Matches, Messages, Profile)
B. Screens Layer
- Home.tsx
- Matches.tsx
- Messages.tsx
- Profile.tsx
C. UI Components Library
- Each component lives under `/components` and is imported by one or more screens
D. Assets & Data
- `/assets/images`, `/assets/styles`, `images.d.ts` (types for static assets)
- `/assets/data/demo.ts` – local stub data for profiles/messages
E. Build & Tooling
- `babel.config.js`, `tsconfig.json`, Metro bundler via Expo CLI
- `package.json` – dependencies: react, react-native, expo, typescript, @react-navigation

##### External/Platform Services
- Expo SDK (camera, location, push notifications, etc.)
- App Store / Play Store delivery via Expo (or standalone build)

1) **User Interaction** → TabNavigator → Screen Component
2) **Screen Component** → imports UI Components → renders with props
3) **UI Component** requests data from **Data Source** (demo.ts or remote API)
4) **Assets** and **Styles** supply images/CSS-in-JS to Components
5) **App Shell** manages global state (if added later) and navigation events

##### Architectural Patterns & Design Principles
- **Component-Based UI**: All UI is broken into small, reusable React components
- **Unidirectional Data Flow**: Parent Screen passes props into child components
- **Feature-by-Screen Organization**: Separation of concerns by screen folder
- **Static Typing**: TypeScript ensures props/contracts in `/types.ts` and `images.d.ts`

##### Detailed breakdown

- The **hierarchy**: App → Navigation → Screens → Components
- The **data flow**: Data Source → Screens/Components → Render
- The **assets dependency**: Styles & Images → Components
- The **external platform**: Expo SDK & optional backend

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Mobile Client Boundary
    subgraph "📱 Mobile Client"
        direction TB
        App["Expo App (App.tsx)"]:::frontend
        NavContainer["Navigation Container"]:::frontend
        BottomTab["Bottom Tab Navigator"]:::frontend

        App -->|"initializes"| NavContainer
        NavContainer -->|"uses"| BottomTab

        subgraph "Screens" 
            direction TB
            Home["Home Screen (screens/Home.tsx)"]:::frontend
            Matches["Matches Screen (screens/Matches.tsx)"]:::frontend
            Messages["Messages Screen (screens/Messages.tsx)"]:::frontend
            Profile["Profile Screen (screens/Profile.tsx)"]:::frontend
        end

        BottomTab -->|tabs| Home
        BottomTab -->|tabs| Matches
        BottomTab -->|tabs| Messages
        BottomTab -->|tabs| Profile

        subgraph "UI Components" 
            direction TB
            CardItem["CardItem Component"]:::frontend
            ProfileItem["ProfileItem Component"]:::frontend
            MessageComp["Message Component"]:::frontend
            City["City Component"]:::frontend
            Filters["Filters Component"]:::frontend
            Icon["Icon Component"]:::frontend
            TabBarIcon["TabBarIcon Component"]:::frontend
        end

        Home -->|renders| CardItem
        Home -->|renders| Filters
        Matches -->|renders| ProfileItem
        Messages -->|renders| MessageComp
        Profile -->|renders| City

        %% Shared UI Components
        Home -->|tab icon| TabBarIcon
        Matches -->|tab icon| TabBarIcon
        Messages -->|tab icon| TabBarIcon
        Profile -->|tab icon| TabBarIcon
    end

    %% Assets & Styles Layer
    subgraph "Assets & Styles" 
        direction TB
        Images["Images Assets (assets/images)"]:::data
        Styles["Styles Assets (assets/styles)"]:::data
        TypesStatic["images.d.ts"]:::data
    end

    %% Data Source
    Demo["Demo Data Source (assets/data/demo.ts)"]:::dataDatabase
    RemoteAPI["(Optional) Remote API"]:::external

    %% Connections from Data & Assets
    Images -->|provides| CardItem
    Styles -->|provides| CardItem
    Images -->|provides| ProfileItem
    Styles -->|provides| ProfileItem
    Demo -->|data| Home
    Demo -->|data| Matches
    Demo -->|data| Messages
    Demo -->|data| Profile
    Demo -->|data| CardItem
    RemoteAPI -.->|optional| Demo
    RemoteAPI -.->|optional| Home

    %% Build & Tooling
    subgraph "Build & Tooling" 
        direction TB
        Babel["babel.config.js"]:::tooling
        TSConfig["tsconfig.json"]:::tooling
        Package["package.json"]:::tooling
        AppConfig["app.json"]:::tooling
    end

    %% Tooling links
    Babel -->|configures| App
    TSConfig -->|types| App
    Package -->|dependencies| App
    AppConfig -->|expo config| App

    %% Click Events
    click App "https://github.com/stevenpersia/tinder-expo/blob/master/App.tsx"
    click BottomTab "https://github.com/stevenpersia/tinder-expo/blob/master/screens/index.ts"
    click Home "https://github.com/stevenpersia/tinder-expo/blob/master/screens/Home.tsx"
    click Matches "https://github.com/stevenpersia/tinder-expo/blob/master/screens/Matches.tsx"
    click Messages "https://github.com/stevenpersia/tinder-expo/blob/master/screens/Messages.tsx"
    click Profile "https://github.com/stevenpersia/tinder-expo/blob/master/screens/Profile.tsx"
    click CardItem "https://github.com/stevenpersia/tinder-expo/blob/master/components/CardItem.tsx"
    click ProfileItem "https://github.com/stevenpersia/tinder-expo/blob/master/components/ProfileItem.tsx"
    click MessageComp "https://github.com/stevenpersia/tinder-expo/blob/master/components/Message.tsx"
    click City "https://github.com/stevenpersia/tinder-expo/blob/master/components/City.tsx"
    click Filters "https://github.com/stevenpersia/tinder-expo/blob/master/components/Filters.tsx"
    click Icon "https://github.com/stevenpersia/tinder-expo/blob/master/components/Icon.tsx"
    click TabBarIcon "https://github.com/stevenpersia/tinder-expo/blob/master/components/TabBarIcon.tsx"
    click ComponentsIndex "https://github.com/stevenpersia/tinder-expo/blob/master/components/index.ts"
    click Demo "https://github.com/stevenpersia/tinder-expo/blob/master/assets/data/demo.ts"
    click Images "https://github.com/stevenpersia/tinder-expo/tree/master/assets/images"
    click Styles "https://github.com/stevenpersia/tinder-expo/tree/master/assets/styles"
    click TypesStatic "https://github.com/stevenpersia/tinder-expo/blob/master/images.d.ts"
    click TSConfig "https://github.com/stevenpersia/tinder-expo/blob/master/tsconfig.json"
    click Babel "https://github.com/stevenpersia/tinder-expo/blob/master/babel.config.js"
    click Package "https://github.com/stevenpersia/tinder-expo/blob/master/package.json"
    click AppConfig "https://github.com/stevenpersia/tinder-expo/blob/master/app.json"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0277BD,stroke-width:1px;
    classDef data fill:#E8F5E9,stroke:#2E7D32,stroke-width:1px;
    classDef dataDatabase fill:#E8F5E9,stroke:#2E7D32,stroke-width:1px,shape:cylinder;
    classDef tooling fill:#FFF3E0,stroke:#FB8C00,stroke-width:1px;
    classDef external fill:#ECEFF1,stroke:#546E7A,stroke-width:1px,stroke-dasharray: 2 2;
```
