# thetechieakash/watcho architecture

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

- Interactive diagram: https://gitdiagram.com/thetechieakash/watcho
- Repository: https://github.com/thetechieakash/watcho

## Overview

##### Project type and purpose
- Watcho is a cross-platform mobile application (built with Expo and React Native) that allows users to browse, search, and rank movies.
- It uses Appwrite as a backend for real-time data storage (popularity algorithm) and an external IMDB/TMDB API for movie metadata.

##### File structure
- app/ — contains the navigation layout (tabs + top-level layouts) and all screen components (.tsx).
- components/ — reusable UI pieces (MovieCard, SearchBar, TrendingCard).
- services/ — wrappers around external integration:
- Appwrite.ts (SDK initialization & database calls)
- api.ts (TMDB/IMDB HTTP client)
- usefetch.ts (custom hook for data fetching).
- assets/, constants/, types/, interfaces/ — static assets, type definitions, and constants.
- config files (babel.config.js, metro.config.js, tailwind.config.js, tsconfig.json) set up build, styling, and TypeScript.

##### Insights from the README
- Tech stack: Expo, React Native, TypeScript, Tailwind CSS, Appwrite.
- Features: real-time movie data, search, and a “popularity” algorithm that tracks user engagement via Appwrite.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Subgraph: Mobile Client
    subgraph "Mobile Client" 
        direction TB
        MC1["app.json"]:::client
        subgraph "Navigation Layout" 
            direction TB
            RL["Root Layout<br>(app/_layout.tsx)"]:::client
            TL["Tab Navigator Layout<br>(app/(tabs)/_layout.tsx)"]:::client
        end
        subgraph "UI Layer" 
            direction TB
            HS["Home Screen<br>(app/(tabs)/index.tsx)"]:::client
            SS["Search Screen<br>(app/(tabs)/search.tsx)"]:::client
            SVS["Saved Screen<br>(app/(tabs)/save.tsx)"]:::client
            PS["Profile Screen<br>(app/(tabs)/profile.tsx)"]:::client
            DS["Details Screen<br>(app/movies/[id].tsx)"]:::client
            DTS["Dev/Test Screen<br>(app/dev.tsx)"]:::client
            GS["Global Styles<br>(app/global.css)"]:::client
        end
        subgraph "Components" 
            direction TB
            MC["MovieCard"]:::client
            SB["SearchBar"]:::client
            TC["TrendingCard"]:::client
        end
    end

    %% Subgraph: Service Layer
    subgraph "Service Layer" 
        direction TB
        API["api.ts"]:::service
        AW["Appwrite.ts"]:::service
        UF["usefetch.ts"]:::service
    end

    %% Subgraph: Static Assets
    subgraph "Static Assets"
        direction TB
        AF["assets/fonts/"]:::static
        AI["assets/icons/"]:::static
        AIMG["assets/images/"]:::static
    end

    %% Subgraph: Constants & Types
    subgraph "Constants & Types"
        direction TB
        CI["constants/icons.ts"]:::static
        CIM["constants/images.ts"]:::static
        IFS["interfaces/interfaces.d.ts"]:::static
        TIMG["types/images.d.ts"]:::static
    end

    %% Subgraph: Config Files
    subgraph "Build & Config"
        direction TB
        BC["babel.config.js"]:::config
        MCfg["metro.config.js"]:::config
        TCss["tailwind.config.js"]:::config
        TS["tsconfig.json"]:::config
    end

    %% External Services
    subgraph "External Services"
        direction TB
        TMDB["TMDB/IMDB API"]:::external
        AWB["Appwrite Backend"]:::external
    end

    %% Datastore
    DB["Appwrite Database<br>(Collections)"]:::database

    %% Connections
    HS -->|uses| UF
    SS -->|uses| UF
    SVS -->|uses| UF
    PS -->|uses| UF
    DS -->|uses| UF
    DTS -->|uses| UF

    UF -->|fetches| API
    API -->|GET /movies| TMDB

    HS -->|read/write trending| AW
    SS -->|read/write trending| AW
    SVS -->|read/write trending| AW

    AW -->|writes/reads| DB
    AW -->|auth/events| AWB
    AWB -->|stores| DB

    %% Component Usage
    HS --> MC
    SS --> SB
    HS --> TC
    SVS --> TC

    %% Click Events
    click MC1 "https://github.com/thetechieakash/watcho/blob/main/app.json"
    click RL "https://github.com/thetechieakash/watcho/blob/main/app/_layout.tsx"
    click TL "https://github.com/thetechieakash/watcho/blob/main/app/(tabs)/_layout.tsx"
    click HS "https://github.com/thetechieakash/watcho/blob/main/app/(tabs)/index.tsx"
    click SS "https://github.com/thetechieakash/watcho/blob/main/app/(tabs)/search.tsx"
    click SVS "https://github.com/thetechieakash/watcho/blob/main/app/(tabs)/save.tsx"
    click PS "https://github.com/thetechieakash/watcho/blob/main/app/(tabs)/profile.tsx"
    click DS "https://github.com/thetechieakash/watcho/blob/main/app/movies/[id].tsx"
    click DTS "https://github.com/thetechieakash/watcho/blob/main/app/dev.tsx"
    click GS "https://github.com/thetechieakash/watcho/blob/main/app/global.css"
    click MC "https://github.com/thetechieakash/watcho/blob/main/components/MovieCard.tsx"
    click SB "https://github.com/thetechieakash/watcho/blob/main/components/SearchBar.tsx"
    click TC "https://github.com/thetechieakash/watcho/blob/main/components/TrandingCard.tsx"
    click API "https://github.com/thetechieakash/watcho/blob/main/services/api.ts"
    click AW "https://github.com/thetechieakash/watcho/blob/main/services/Appwrite.ts"
    click UF "https://github.com/thetechieakash/watcho/blob/main/services/usefetch.ts"
    click AF "https://github.com/thetechieakash/watcho/tree/main/assets/fonts/"
    click AI "https://github.com/thetechieakash/watcho/tree/main/assets/icons/"
    click AIMG "https://github.com/thetechieakash/watcho/tree/main/assets/images/"
    click CI "https://github.com/thetechieakash/watcho/blob/main/constants/icons.ts"
    click CIM "https://github.com/thetechieakash/watcho/blob/main/constants/images.ts"
    click IFS "https://github.com/thetechieakash/watcho/blob/main/interfaces/interfaces.d.ts"
    click TIMG "https://github.com/thetechieakash/watcho/blob/main/types/images.d.ts"
    click BC "https://github.com/thetechieakash/watcho/blob/main/babel.config.js"
    click MCfg "https://github.com/thetechieakash/watcho/blob/main/metro.config.js"
    click TCss "https://github.com/thetechieakash/watcho/blob/main/tailwind.config.js"
    click TS "https://github.com/thetechieakash/watcho/blob/main/tsconfig.json"

    %% Styles
    classDef client fill:#cce5ff,stroke:#004085,color:#004085
    classDef service fill:#fff3cd,stroke:#856404,color:#856404
    classDef database fill:#d4edda,stroke:#155724,color:#155724
    classDef external fill:#ffe5b4,stroke:#cc8400,color:#cc8400
    classDef static fill:#e2e3e5,stroke:#6c757d,color:#6c757d
    classDef config fill:#f8d7da,stroke:#721c24,color:#721c24
```
