# valesh-gosats/sticker-smash architecture

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

- Interactive diagram: https://gitdiagram.com/valesh-gosats/sticker-smash
- Repository: https://github.com/valesh-gosats/sticker-smash

## Overview

##### Project type and purpose
- This is a mobile application built with Expo and React Native.
- It uses file-based routing (via React Navigation under the hood) to define screens.
- Its primary purpose is to let users pick, view, and stick emojis onto images (an “Emoji Sticker” demo app).

##### File structure
- Top-level configuration
– package.json / package-lock.json: npm dependencies (Expo, React, React Native)
– tsconfig.json / eslint.config.js: TypeScript and linting setup
– app.json: Expo project configuration (app name, SDK version)
- app/ directory
– (tabs)/_layout.tsx, about.tsx, index.tsx: tab navigator screens
– +not-found.tsx: 404-like fallback screen
– _layout.tsx: root layout and navigation container
- components/ directory
– Button.tsx, CircleButton.tsx, IconButton.tsx: reusable UI controls
– EmojiList.tsx, EmojiPicker.tsx, EmojiSticker.tsx: core feature UI
– ImageViewer.tsx: image display and manipulation

##### README for additional insights
- Confirms Expo CLI usage, development build targets (Android, iOS, web)
- Notes file-based routing and starter project reset command

a. Main components
1. Device / Platform layer
- Android emulator, iOS simulator, or physical device via Expo Go
2. Expo runtime (Metro bundler + native runtime)
3. React Native application code
- Navigation container (file-based routing)
- UI components library (components/)
- Screens (app/(tabs) and app root)
4. Assets store (assets/images)
5. External services / OS APIs
- Camera roll or file system (if used)
- Touch input, gesture handler
b. Relationships and interactions
- User taps on navigation tabs → Navigation container loads corresponding screen component
- EmojiPicker → passes chosen emoji to EmojiList → renders EmojiSticker on top of ImageViewer
- ImageViewer reads static assets or user-selected images via Expo Asset or FileSystem API
- Expo Go runtime communicates with Metro bundler on developer machine for hot reloads
c. Architectural patterns and design principles
- Component-based architecture: small, reusable presentational and container components
- File-based routing: directory names map to navigation stacks/tabs
- Separation of concerns: UI components, navigation, assets, and configs are in distinct folders
d. Key technologies, frameworks, libraries
- Expo SDK (expo, react-native, metro)
- React Navigation (implicit via Expo’s file-based router)
- TypeScript for static typing
- ESLint for code quality

##### Detailed capturing of architectural elements
- File-based routing: a “Tabs” navigator block containing “Index” and “About” screens
- Assets flow into ImageViewer via Expo Asset module

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Developer & Build Loop
    DevMachine["Developer Machine"]:::device
    Metro["Metro Bundler"]:::runtime
    ExpoGo["Expo Go Runtime"]:::runtime
    DevMachine -->|"sends code"| Metro
    Metro -->|"bundles JS"| ExpoGo
    ExpoGo -->|"runs on"| DeviceLayer

    %% Device Layer
    DeviceLayer["Device OS & Hardware\n(Android/iOS)"]:::device
    User["User Touch Input"]:::device
    ExpoGo --> DeviceLayer
    User -->|"taps"| NavigationContainer

    %% React Native App Code
    subgraph "React Native App Code"
        subgraph "Navigation"
            NavigationContainer["App Root Layout\n(app/_layout.tsx)"]:::rn
            TabNavigator["Tab Navigator Layout\n(app/(tabs)/_layout.tsx)"]:::rn
            NotFound["Not-Found Screen\n(app/+not-found.tsx)"]:::rn
        end
        NavigationContainer -->|routes| TabNavigator
        NavigationContainer -->|fallback| NotFound

        subgraph "Screens"
            IndexScreen["Index Screen\n(app/(tabs)/index.tsx)"]:::rn
            AboutScreen["About Screen\n(app/(tabs)/about.tsx)"]:::rn
        end
        TabNavigator -->|home tab| IndexScreen
        TabNavigator -->|about tab| AboutScreen

        subgraph "UI Components\n(components)"
            EmojiPicker["EmojiPicker\n(EmojiPicker.tsx)"]:::rn
            EmojiList["EmojiList\n(EmojiList.tsx)"]:::rn
            EmojiSticker["EmojiSticker\n(EmojiSticker.tsx)"]:::rn
            ImageViewer["ImageViewer\n(ImageViewer.tsx)"]:::rn
            ButtonUI["Button\n(Button.tsx)"]:::rn
            CircleButton["CircleButton\n(CircleButton.tsx)"]:::rn
            IconButton["IconButton\n(IconButton.tsx)"]:::rn
        end

        %% Interactions
        IndexScreen -->|uses| EmojiPicker
        EmojiPicker -->|selects| EmojiList
        EmojiList -->|renders| EmojiSticker
        EmojiSticker -->|overlays| ImageViewer
        ImageViewer -->|loads| AssetsStore
        %% Common controls
        EmojiPicker --> ButtonUI
        EmojiPicker --> CircleButton
        EmojiPicker --> IconButton
    end

    %% Assets & Configs
    AssetsStore["Assets Store\n(assets/images)"]:::device
    Configs["Config & Tools"]
    packagejson["package.json"]:::device
    tsconfig["tsconfig.json"]:::device
    eslint["eslint.config.js"]:::device
    appjson["app.json"]:::device
    Configs --> packagejson
    Configs --> tsconfig
    Configs --> eslint
    Configs --> appjson
    ImageViewer -->|fetches| AssetsStore

    %% Click Events
    click NavigationContainer "https://github.com/valesh-gosats/sticker-smash/blob/main/app/_layout.tsx"
    click TabNavigator "https://github.com/valesh-gosats/sticker-smash/blob/main/app/(tabs)/_layout.tsx"
    click IndexScreen "https://github.com/valesh-gosats/sticker-smash/blob/main/app/(tabs)/index.tsx"
    click AboutScreen "https://github.com/valesh-gosats/sticker-smash/blob/main/app/(tabs)/about.tsx"
    click NotFound "https://github.com/valesh-gosats/sticker-smash/blob/main/app/+not-found.tsx"
    click EmojiPicker "https://github.com/valesh-gosats/sticker-smash/blob/main/components/EmojiPicker.tsx"
    click EmojiList "https://github.com/valesh-gosats/sticker-smash/blob/main/components/EmojiList.tsx"
    click EmojiSticker "https://github.com/valesh-gosats/sticker-smash/blob/main/components/EmojiSticker.tsx"
    click ImageViewer "https://github.com/valesh-gosats/sticker-smash/blob/main/components/ImageViewer.tsx"
    click ButtonUI "https://github.com/valesh-gosats/sticker-smash/blob/main/components/Button.tsx"
    click CircleButton "https://github.com/valesh-gosats/sticker-smash/blob/main/components/CircleButton.tsx"
    click IconButton "https://github.com/valesh-gosats/sticker-smash/blob/main/components/IconButton.tsx"
    click AssetsStore "https://github.com/valesh-gosats/sticker-smash/tree/main/assets/images"
    click appjson "https://github.com/valesh-gosats/sticker-smash/blob/main/app.json"
    click packagejson "https://github.com/valesh-gosats/sticker-smash/blob/main/package.json"
    click tsconfig "https://github.com/valesh-gosats/sticker-smash/blob/main/tsconfig.json"
    click eslint "https://github.com/valesh-gosats/sticker-smash/blob/main/eslint.config.js"

    %% Styles
    classDef rn fill:#DDEEFF,stroke:#333,stroke-width:1px
    classDef runtime fill:#CCFFCC,stroke:#333,stroke-width:1px
    classDef device fill:#EEEEEE,stroke:#333,stroke-width:1px
```
