# thinkific/mobile-test architecture

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

- Interactive diagram: https://gitdiagram.com/thinkific/mobile-test
- Repository: https://github.com/thinkific/mobile-test

## Overview

##### Project type and purpose
- This is a mobile-only, React Native “learning platform” app built with Expo and Expo Router.
- Its purpose is to let learners browse and view courses (catalog, details), handle theming (light/dark), and demo navigation via file-based routing.

##### File structure
- **app/**
- Implements screens via Expo Router (file-based routing).
- `(tabs)/index.tsx` & `explore.tsx` are the tab navigator’s home/profile screens.
- `course/[id].tsx` is the dynamic course-detail page.
- `_layout.tsx` files define shared navigators or wrappers.
- **components/**
- Reusable UI pieces (CourseCard, themed-text/view, collapsible UI).
- **services/**
- `courseService.ts` abstracts data fetching (API or mocks).
- `courseMocks.ts` holds mock data.
- `__tests__/` for unit tests on service logic.
- **hooks/**
- **constants/**
- **types/**
- Shared TypeScript interfaces: `course.ts`, `navigation.ts`.
- **assets/images/** for static image assets.
- Configuration (babel.config.js, tsconfig.json), ESLint, Jest config, and scripts/reset-project.js.

##### README for additional insights
- Emphasizes debugging, performance fixes, refactoring, architectural discussions.
- Lists tech stack: React Native, Expo, Expo Router, TypeScript, Jest, RN Testing Library.
- Mentions core features: Course Catalog, Course Details, User Profile, Theming.

##### Detail
- Don’t collapse the layout wrappers (`_layout.tsx`) and dynamic routes—they’re central to navigation.
- Custom hooks as first-class architectural elements because they handle theming logic.
- Tests as a separate slice to highlight test coverage areas.

## Diagram (Mermaid)

```mermaid
graph TB
  subgraph "Mobile App (React Native/Expo)"
    subgraph "Navigation Layer"
      NAV1["_layout.tsx"]:::nav
      NAV2["(tabs)/_layout.tsx"]:::nav
    end
    subgraph "Tab Screens"
      Home["index.tsx (Home)"]:::nav
      Explore["explore.tsx (Explore)"]:::nav
    end
    Modal["modal.tsx"]:::nav
    CourseDetail["[id].tsx (Course Detail)"]:::nav

    subgraph "UI Component Library"
      CourseCard["CourseCard.tsx"]:::ui
      ThemedText["themed-text.tsx"]:::ui
      ThemedView["themed-view.tsx"]:::ui
      Parallax["parallax-scroll-view.tsx"]:::ui
      Haptic["haptic-tab.tsx"]:::ui
      ExternalLink["external-link.tsx"]:::ui
      HelloWave["hello-wave.tsx"]:::ui
      Collapsible["ui/collapsible.tsx"]:::ui
      IconSymbol["ui/icon-symbol.tsx"]:::ui
      IconSymbolIOS["ui/icon-symbol.ios.tsx"]:::ui
    end

    subgraph "Theming & Hooks"
      ThemeConst["theme.ts"]:::hook
      UseColorScheme["use-color-scheme.ts"]:::hook
      UseColorSchemeWeb["use-color-scheme.web.ts"]:::hook
      UseThemeColor["use-theme-color.ts"]:::hook
    end

    Assets["assets/images/"]:::asset
  end

  subgraph "Data Layer"
    Service["courseService.ts"]:::data
    Mocks["courseMocks.ts"]:::data
  end

  ExternalAPI["External API"]:::external

  subgraph "Types & Contracts"
    TypeCourse["course.ts"]:::type
    TypeNav["navigation.ts"]:::type
  end

  subgraph "Tests & Config"
    TestService["courseService.test.ts"]:::test
    Configs["babel.config.js\n tsconfig.json\n eslint.config.js\n jest.config.js\n jest-setup.ts\n scripts/reset-project.js"]:::config
  end

  %% Runtime Flows
  Home -->|"navigate"|CourseDetail
  Home -->|"uses"|CourseCard
  Explore -->|"uses"|CourseCard
  CourseDetail -->|"uses"|CourseCard

  %% Navigation Dependencies
  Home -->NAV2
  Explore -->NAV2
  NAV2 -->NAV1
  Modal -->NAV1
  CourseDetail -->NAV1

  %% Data Flows
  Home -->|"fetch()"|Service
  Explore -->|"fetch()"|Service
  CourseDetail -->|"fetch()"|Service
  Service -->|"fallback"|Mocks
  Service -->|"API call"|ExternalAPI

  %% Theme Flows
  UIComponents(("UI Components")) -->ThemeConst
  UIComponents -->UseThemeColor
  UseThemeColor -->UseColorScheme
  ThemeConst -->UseColorScheme
  UIComponents -->Assets

  %% Types Dependencies
  Service -.->|uses types|TypeCourse
  Home -.->|uses types|TypeNav
  Explore -.->|uses types|TypeNav
  CourseDetail -.->|uses types|TypeNav
  CourseCard -.->|uses types|TypeCourse

  %% Tests & Config
  TestService -.->Service
  TestService -.->Mocks
  TestService -.->CourseCard

  %% Click Events
  click NAV1 "https://github.com/thinkific/mobile-test/blob/master/app/_layout.tsx"
  click NAV2 "https://github.com/thinkific/mobile-test/blob/master/app/(tabs)/_layout.tsx"
  click Home "https://github.com/thinkific/mobile-test/blob/master/app/(tabs)/index.tsx"
  click Explore "https://github.com/thinkific/mobile-test/blob/master/app/(tabs)/explore.tsx"
  click CourseDetail "https://github.com/thinkific/mobile-test/blob/master/app/course/[id].tsx"
  click Modal "https://github.com/thinkific/mobile-test/blob/master/app/modal.tsx"
  click CourseCard "https://github.com/thinkific/mobile-test/blob/master/components/CourseCard.tsx"
  click ThemedText "https://github.com/thinkific/mobile-test/blob/master/components/themed-text.tsx"
  click ThemedView "https://github.com/thinkific/mobile-test/blob/master/components/themed-view.tsx"
  click Parallax "https://github.com/thinkific/mobile-test/blob/master/components/parallax-scroll-view.tsx"
  click Haptic "https://github.com/thinkific/mobile-test/blob/master/components/haptic-tab.tsx"
  click ExternalLink "https://github.com/thinkific/mobile-test/blob/master/components/external-link.tsx"
  click HelloWave "https://github.com/thinkific/mobile-test/blob/master/components/hello-wave.tsx"
  click Collapsible "https://github.com/thinkific/mobile-test/blob/master/components/ui/collapsible.tsx"
  click IconSymbol "https://github.com/thinkific/mobile-test/blob/master/components/ui/icon-symbol.tsx"
  click IconSymbolIOS "https://github.com/thinkific/mobile-test/blob/master/components/ui/icon-symbol.ios.tsx"
  click ThemeConst "https://github.com/thinkific/mobile-test/blob/master/constants/theme.ts"
  click UseColorScheme "https://github.com/thinkific/mobile-test/blob/master/hooks/use-color-scheme.ts"
  click UseColorSchemeWeb "https://github.com/thinkific/mobile-test/blob/master/hooks/use-color-scheme.web.ts"
  click UseThemeColor "https://github.com/thinkific/mobile-test/blob/master/hooks/use-theme-color.ts"
  click Service "https://github.com/thinkific/mobile-test/blob/master/services/courseService.ts"
  click Mocks "https://github.com/thinkific/mobile-test/blob/master/services/courseMocks.ts"
  click TestService "https://github.com/thinkific/mobile-test/blob/master/services/__tests__/courseService.test.ts"
  click TypeCourse "https://github.com/thinkific/mobile-test/blob/master/types/course.ts"
  click TypeNav "https://github.com/thinkific/mobile-test/blob/master/types/navigation.ts"
  click Assets "https://github.com/thinkific/mobile-test/tree/master/assets/images/"
  click Configs "https://github.com/thinkific/mobile-test/blob/master/babel.config.js"

  classDef nav fill:#D0E6FF,stroke:#0366D6
  classDef ui fill:#D0E6FF,stroke:#0366D6
  classDef data fill:#D4F8D4,stroke:#28A745
  classDef hook fill:#FFE5B4,stroke:#E69500
  classDef asset fill:#F0F0F0,stroke:#656D78
  classDef test fill:#F0F0F0,stroke:#656D78,stroke-dasharray: 5 5
  classDef type fill:#F0F0F0,stroke:#656D78,stroke-dasharray: 2 2
  classDef external fill:#E8D7FF,stroke:#6F42C1
  classDef config fill:#EFEFEF,stroke:#999999,stroke-dasharray: 4 2
```
