# gercamjr/auto-organize-me architecture

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

- Interactive diagram: https://gitdiagram.com/gercamjr/auto-organize-me
- Repository: https://github.com/gercamjr/auto-organize-me

## Overview

##### Project type and purpose
- This is a single‐repository, full-featured Expo/React Native mobile application (“Auto Organize Me”) for car mechanics.
- It’s an offline-first client app that manages clients, vehicles, jobs, appointments, photos, and invoicing on a local SQLite database.

##### File structure
- Top‐level: App.tsx (entry), index.ts, Expo configs (app.json, metro.config.js, babel.config.js).
- assets/: static images and fonts.
- src/contexts/: React Context providers (AuthContext, DatabaseContext).
- src/hooks/: repository hooks (useClientRepository, useJobRepository, useVehicleRepository) implementing the repository pattern.
- src/navigation/: React Navigation definitions organized by feature (Auth, Clients, Vehicles, Jobs, Main, Root).
- src/screens/: Feature folders (auth, client, job, vehicle), each containing all related UI screens.
- src/utils/: Theming and shared utilities (theme.ts).
- Config files: ESLint, Prettier, tsconfig, CI/CD workflow in .github/workflows.

##### README for additional insights
- Tech stack: TypeScript, React Native Paper (UI), React Navigation, Expo-SQLite, Context API.
- Architecture hints: “repository pattern for database operations,” “offline first.”
- CI/CD: GitHub Actions → linting → EAS Build → release.

##### Final recommendations
- Every architectural element—from the Expo entry point through to the SQL tables.
- Keep it detailed: the goal is a one-page view that a new engineer can use to orient themselves immediately.

## Diagram (Mermaid)

```mermaid
flowchart TD
  subgraph "Presentation Layer"
    direction TB
    App["App.tsx"]:::entry
    Index["index.ts"]:::entry
    subgraph "UI Screens"
      direction TB
      LS["LoginScreen"]:::ui
      SP["SetupPinScreen"]:::ui
      CL["ClientListScreen"]:::ui
      CD["ClientDetailsScreen"]:::ui
      AEC["AddEditClientScreen"]:::ui
      CV["ClientVehiclesScreen"]:::ui
      VL["VehicleListScreen"]:::ui
      VD["VehicleDetailsScreen"]:::ui
      AEV["AddEditVehicleScreen"]:::ui
      VP["VehiclePhotosScreen"]:::ui
      JL["JobListScreen"]:::ui
      JD["JobDetailsScreen"]:::ui
      AEJ["AddEditJobScreen"]:::ui
      AED["AddEditDiagnosticScreen"]:::ui
      AEL["AddEditLaborScreen"]:::ui
      AEP["AddEditPartScreen"]:::ui
      JH["JobHistoryScreen"]:::ui
      JDG["JobDiagnosticsScreen"]:::ui
      JLB["JobLaborScreen"]:::ui
      JPT["JobPartsScreen"]:::ui
      JPH["JobPhotosScreen"]:::ui
    end
  end

  subgraph "Navigation Layer"
    direction TB
    AuthNav["AuthNavigator"]:::nav
    ClientsNav["ClientsNavigator"]:::nav
    VehiclesNav["VehiclesNavigator"]:::nav
    JobsNav["JobsNavigator"]:::nav
    MainNav["MainNavigator"]:::nav
    RootNav["RootNavigator"]:::nav
  end

  subgraph "State Management"
    direction TB
    AuthCtx["AuthContext"]:::ctx
    DbCtx["DatabaseContext"]:::ctx
  end

  subgraph "Repository Layer"
    direction TB
    ClientRepo["useClientRepository"]:::repo
    VehicleRepo["useVehicleRepository"]:::repo
    JobRepo["useJobRepository"]:::repo
  end

  subgraph "Persistence Layer"
    direction TB
    SQLite["SQLite Database"]:::db
  end

  subgraph "Assets & Utilities"
    direction TB
    Assets["assets/"]:::assets
    Theme["theme.ts"]:::util
  end

  App -->|starts| Index
  App -->|renders| RootNav
  RootNav --> AuthNav
  RootNav --> MainNav
  MainNav --> ClientsNav
  MainNav --> VehiclesNav
  MainNav --> JobsNav

  AuthNav --> LS
  AuthNav --> SP

  ClientsNav --> CL
  ClientsNav --> CD
  ClientsNav --> AEC
  ClientsNav --> CV

  VehiclesNav --> VL
  VehiclesNav --> VD
  VehiclesNav --> AEV
  VehiclesNav --> VP

  JobsNav --> JL
  JobsNav --> JD
  JobsNav --> AEJ
  JobsNav --> AED
  JobsNav --> AEL
  JobsNav --> AEP
  JobsNav --> JH
  JobsNav --> JDG
  JobsNav --> JLB
  JobsNav --> JPT
  JobsNav --> JPH

  LS -->|uses| AuthCtx
  SP -->|uses| AuthCtx
  LS -->|renders| SP

  subgraph UI_to_Context_and_Repo
    direction TB
    CL -->|uses| DbCtx
    CD -->|uses| DbCtx
    AEC -->|uses| DbCtx
    CV -->|uses| DbCtx
    VL -->|uses| DbCtx
    VD -->|uses| DbCtx
    AEV -->|uses| DbCtx
    VP -->|uses| DbCtx
    JL -->|uses| DbCtx
    JD -->|uses| DbCtx
    AEJ -->|uses| DbCtx
    AED -->|uses| DbCtx
    AEL -->|uses| DbCtx
    AEP -->|uses| DbCtx
    JH -->|uses| DbCtx
    JDG -->|uses| DbCtx
    JLB -->|uses| DbCtx
    JPT -->|uses| DbCtx
    JPH -->|uses| DbCtx
    CL -->|calls| ClientRepo
    VL -->|calls| VehicleRepo
    JL -->|calls| JobRepo
  end

  DbCtx -->|provides DB| SQLite
  ClientRepo -->|queries| DbCtx
  VehicleRepo -->|queries| DbCtx
  JobRepo -->|queries| DbCtx

  JPH -->|captures images| Assets
  Assets -->|stored| SQLite

  Theme -.-> UI_to_Context_and_Repo

  click App "https://github.com/gercamjr/auto-organize-me/blob/main/App.tsx"
  click Index "https://github.com/gercamjr/auto-organize-me/blob/main/index.ts"
  click LS "https://github.com/gercamjr/auto-organize-me/blob/main/src/screens/auth/LoginScreen.tsx"
  click SP "https://github.com/gercamjr/auto-organize-me/blob/main/src/screens/auth/SetupPinScreen.tsx"
  click CL "https://github.com/gercamjr/auto-organize-me/blob/main/src/screens/client/ClientListScreen.tsx"
  click CD "https://github.com/gercamjr/auto-organize-me/blob/main/src/screens/client/ClientDetailsScreen.tsx"
  click AEC "https://github.com/gercamjr/auto-organize-me/blob/main/src/screens/client/AddEditClientScreen.tsx"
  click CV "https://github.com/gercamjr/auto-organize-me/blob/main/src/screens/client/ClientVehiclesScreen.tsx"
  click VL "https://github.com/gercamjr/auto-organize-me/blob/main/src/screens/vehicle/VehicleListScreen.tsx"
  click VD "https://github.com/gercamjr/auto-organize-me/blob/main/src/screens/vehicle/VehicleDetailsScreen.tsx"
  click AEV "https://github.com/gercamjr/auto-organize-me/blob/main/src/screens/vehicle/AddEditVehicleScreen.tsx"
  click VP "https://github.com/gercamjr/auto-organize-me/blob/main/src/screens/vehicle/VehiclePhotosScreen.tsx"
  click JL "https://github.com/gercamjr/auto-organize-me/blob/main/src/screens/job/JobListScreen.tsx"
  click JD "https://github.com/gercamjr/auto-organize-me/blob/main/src/screens/job/JobDetailsScreen.tsx"
  click AEJ "https://github.com/gercamjr/auto-organize-me/blob/main/src/screens/job/AddEditJobScreen.tsx"
  click AED "https://github.com/gercamjr/auto-organize-me/blob/main/src/screens/job/AddEditDiagnosticScreen.tsx"
  click AEL "https://github.com/gercamjr/auto-organize-me/blob/main/src/screens/job/AddEditLaborScreen.tsx"
  click AEP "https://github.com/gercamjr/auto-organize-me/blob/main/src/screens/job/AddEditPartScreen.tsx"
  click JH "https://github.com/gercamjr/auto-organize-me/blob/main/src/screens/job/JobHistoryScreen.tsx"
  click JDG "https://github.com/gercamjr/auto-organize-me/blob/main/src/screens/job/JobDiagnosticsScreen.tsx"
  click JLB "https://github.com/gercamjr/auto-organize-me/blob/main/src/screens/job/JobLaborScreen.tsx"
  click JPT "https://github.com/gercamjr/auto-organize-me/blob/main/src/screens/job/JobPartsScreen.tsx"
  click JPH "https://github.com/gercamjr/auto-organize-me/blob/main/src/screens/job/JobPhotosScreen.tsx"
  click AuthNav "https://github.com/gercamjr/auto-organize-me/blob/main/src/navigation/AuthNavigator.tsx"
  click ClientsNav "https://github.com/gercamjr/auto-organize-me/blob/main/src/navigation/ClientsNavigator.tsx"
  click VehiclesNav "https://github.com/gercamjr/auto-organize-me/blob/main/src/navigation/VehiclesNavigator.tsx"
  click JobsNav "https://github.com/gercamjr/auto-organize-me/blob/main/src/navigation/JobsNavigator.tsx"
  click MainNav "https://github.com/gercamjr/auto-organize-me/blob/main/src/navigation/MainNavigator.tsx"
  click RootNav "https://github.com/gercamjr/auto-organize-me/blob/main/src/navigation/RootNavigator.tsx"
  click AuthCtx "https://github.com/gercamjr/auto-organize-me/blob/main/src/contexts/AuthContext.tsx"
  click DbCtx "https://github.com/gercamjr/auto-organize-me/blob/main/src/contexts/DatabaseContext.tsx"
  click ClientRepo "https://github.com/gercamjr/auto-organize-me/blob/main/src/hooks/useClientRepository.ts"
  click VehicleRepo "https://github.com/gercamjr/auto-organize-me/blob/main/src/hooks/useVehicleRepository.ts"
  click JobRepo "https://github.com/gercamjr/auto-organize-me/blob/main/src/hooks/useJobRepository.ts"
  click Assets "https://github.com/gercamjr/auto-organize-me/tree/main/assets/"
  click Theme "https://github.com/gercamjr/auto-organize-me/blob/main/src/utils/theme.ts"

  classDef entry fill:#f9f,stroke:#333,stroke-width:2px
  classDef ui fill:#bbdefb,stroke:#1e88e5,stroke-width:1px
  classDef nav fill:#d1c4e9,stroke:#7e57c2,stroke-width:1px
  classDef ctx fill:#c8e6c9,stroke:#2e7d32,stroke-width:1px
  classDef repo fill:#ffe0b2,stroke:#fb8c00,stroke-width:1px
  classDef db fill:#cfd8dc,stroke:#455a64,stroke-width:1px,stroke-dasharray: 5 5
  classDef assets fill:#d7ccc8,stroke:#6d4c41,stroke-width:1px
  classDef util fill:#e0e0e0,stroke:#9e9e9e,stroke-width:1px
```
