# saneren/focus-tracker-and-analysis-mobile-app architecture

> Architecture diagram of the GitHub repository saneren/focus-tracker-and-analysis-mobile-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/saneren/focus-tracker-and-analysis-mobile-app
- Repository: https://github.com/saneren/focus-tracker-and-analysis-mobile-app

## Overview

Focus Tracker is a mobile focus-timer app. Users create or log into an account, configure a timed session and category, then run, pause, reset or cancel it; leaving the app is tracked as a distraction. Session records are stored in Firestore and feed current-session and historical analytics, including category and weekly charts. The app also provides account settings and English/Turkish localization. The README documents the product capabilities; unsampled implementations are represented by their exact tree paths, with uncertain internal wiring omitted.

Main entry points: [`src/screens/Home.js`](https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/screens/Home.js) (Focus timer), [`src/api/SaveUserDataCol.js`](https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/api/SaveUserDataCol.js) (Session data API), [`src/screens/Dashboard.js`](https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/screens/Dashboard.js) (Dashboard screen), [`src/api/FirebaseConfig.js`](https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/api/FirebaseConfig.js) (Firebase setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_app["App providers<br/>[App.js]"]
  node_navigation["Root navigation<br/>[RootNavigator.js]"]
  node_tabs["Main tabs<br/>[AppTabBar.js]"]
end

subgraph group_identity["Accounts and settings"]
  node_authscreens["Login and signup<br/>[Login.js]"]
  node_signup["Account creation<br/>[Signup.js]"]
  node_authstate["Auth state<br/>[AuthContext.js]"]
  node_settings["Settings screen<br/>[Settings.js]"]
  node_settingsmodal["Settings modal"]
end

subgraph group_focus["Focus sessions"]
  node_home["Focus timer<br/>[Home.js]"]
  node_setup["Session setup<br/>[SetupView.js]"]
  node_appstate["App leave tracking<br/>[AppLeft.js]"]
  node_timerstate["Timer state<br/>[TimerContext.js]"]
  node_countdown["Countdown state"]
  node_sessionstate["Current session state<br/>[SessionContext.js]"]
  node_sessionapi["Session data API<br/>[SaveUserDataCol.js]"]
end

subgraph group_insights["Analytics"]
  node_dashboard["Dashboard screen<br/>[Dashboard.js]"]
  node_basicstats["Live session stats<br/>[BasicStats.js]"]
  node_summary["Summary statistics"]
  node_category["Category chart"]
  node_weekly["Weekly focus chart"]
end

subgraph group_platform["Firebase and language"]
  node_firebase["Firebase setup<br/>[FirebaseConfig.js]"]
  node_fireauth[("Firebase Auth")]
  node_firestore[("Cloud Firestore")]
  node_language["Language state<br/>[LanguageContext.js]"]
  node_translations["Translations<br/>[i18n.js]"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_navigation
node_navigation -->|"routes"| node_authscreens
node_navigation -->|"routes"| node_signup
node_navigation -->|"routes"| node_tabs
node_tabs -->|"routes"| node_home
node_tabs -->|"routes"| node_dashboard
node_tabs -->|"routes"| node_settings
node_authscreens -->|"uses auth"| node_firebase
node_signup -->|"creates account"| node_firebase
node_firebase -->|"initializes"| node_fireauth
node_firebase -->|"initializes"| node_firestore
node_authstate -->|"observes auth"| node_firebase
node_app -->|"provides state"| node_authstate
node_app -->|"provides state"| node_language
node_language -->|"configures"| node_translations
node_language -->|"reads and writes"| node_firestore
node_settings -->|"uses"| node_settingsmodal
node_settingsmodal -->|"logs out"| node_authstate
node_settingsmodal -->|"changes language"| node_language
node_home -->|"renders setup"| node_setup
node_home -->|"reads leave count"| node_appstate
node_home -->|"controls timer"| node_timerstate
node_home -->|"updates countdown"| node_countdown
node_home -->|"tracks session"| node_sessionstate
node_home -->|"creates and updates"| node_sessionapi
node_sessionapi -->|"reads and writes"| node_firestore
node_dashboard -->|"renders"| node_basicstats
node_dashboard -->|"renders"| node_summary
node_dashboard -->|"renders"| node_category
node_dashboard -->|"renders"| node_weekly
node_basicstats -->|"fetches session"| node_sessionapi
node_summary -->|"fetches analytics"| node_sessionapi
node_category -->|"fetches categories"| node_sessionapi
node_weekly -->|"fetches weekly data"| node_sessionapi

click node_app "https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/App.js"
click node_navigation "https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/navigation/RootNavigator.js"
click node_tabs "https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/navigation/AppTabBar.js"
click node_authscreens "https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/screens/Login.js"
click node_signup "https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/screens/Signup.js"
click node_authstate "https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/contexts/AuthContext.js"
click node_settings "https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/screens/Settings.js"
click node_settingsmodal "https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/components/SettingsComponent.js"
click node_home "https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/screens/Home.js"
click node_setup "https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/components/SetupView.js"
click node_appstate "https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/contexts/AppLeft.js"
click node_timerstate "https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/contexts/TimerContext.js"
click node_countdown "https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/contexts/CountdownContext.js"
click node_sessionstate "https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/contexts/SessionContext.js"
click node_sessionapi "https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/api/SaveUserDataCol.js"
click node_dashboard "https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/screens/Dashboard.js"
click node_basicstats "https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/components/BasicStats.js"
click node_summary "https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/components/DashboardSummaryStats.js"
click node_category "https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/components/CategoryPieChart.js"
click node_weekly "https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/components/WeeklyFocusChart.js"
click node_firebase "https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/api/FirebaseConfig.js"
click node_language "https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/contexts/LanguageContext.js"
click node_translations "https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/i18n/lang/i18n.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_navigation,node_tabs,node_user toneBlue
class node_authscreens,node_signup,node_authstate,node_settings,node_settingsmodal toneAmber
class node_home,node_setup,node_appstate,node_timerstate,node_countdown,node_sessionstate,node_sessionapi toneMint
class node_dashboard,node_basicstats,node_summary,node_category,node_weekly toneRose
class node_firebase,node_fireauth,node_firestore,node_language,node_translations toneIndigo
```

## Components

### App shell

- [App providers](https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/App.js): `App.js`
- [Root navigation](https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/navigation/RootNavigator.js): `src/navigation/RootNavigator.js`
- [Main tabs](https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/navigation/AppTabBar.js): `src/navigation/AppTabBar.js`

### Accounts and settings

- [Login and signup](https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/screens/Login.js): `src/screens/Login.js`
- [Account creation](https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/screens/Signup.js): `src/screens/Signup.js`
- [Auth state](https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/contexts/AuthContext.js): `src/contexts/AuthContext.js`
- [Settings screen](https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/screens/Settings.js): `src/screens/Settings.js`
- [Settings modal](https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/components/SettingsComponent.js): `src/components/SettingsComponent.js`

### Focus sessions

- [Focus timer](https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/screens/Home.js): `src/screens/Home.js`
- [Session setup](https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/components/SetupView.js): `src/components/SetupView.js`
- [App leave tracking](https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/contexts/AppLeft.js): `src/contexts/AppLeft.js`
- [Timer state](https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/contexts/TimerContext.js): `src/contexts/TimerContext.js`
- [Countdown state](https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/contexts/CountdownContext.js): `src/contexts/CountdownContext.js`
- [Current session state](https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/contexts/SessionContext.js): `src/contexts/SessionContext.js`
- [Session data API](https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/api/SaveUserDataCol.js): `src/api/SaveUserDataCol.js`

### Analytics

- [Dashboard screen](https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/screens/Dashboard.js): `src/screens/Dashboard.js`
- [Live session stats](https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/components/BasicStats.js): `src/components/BasicStats.js`
- [Summary statistics](https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/components/DashboardSummaryStats.js): `src/components/DashboardSummaryStats.js`
- [Category chart](https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/components/CategoryPieChart.js): `src/components/CategoryPieChart.js`
- [Weekly focus chart](https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/components/WeeklyFocusChart.js): `src/components/WeeklyFocusChart.js`

### Firebase and language

- [Firebase setup](https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/api/FirebaseConfig.js): `src/api/FirebaseConfig.js`
- **Firebase Auth**
- **Cloud Firestore**
- [Language state](https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/contexts/LanguageContext.js): `src/contexts/LanguageContext.js`
- [Translations](https://github.com/saneren/focus-tracker-and-analysis-mobile-app/blob/main/src/i18n/lang/i18n.js): `src/i18n/lang/i18n.js`

### Other components

- **User**

## Connections

- User → App providers: uses (evidence: `README.md`)
- App providers → Root navigation: renders (evidence: `App.js`)
- Root navigation → Login and signup: routes (evidence: `src/navigation/RootNavigator.js`)
- Root navigation → Account creation: routes (evidence: `src/navigation/RootNavigator.js`)
- Root navigation → Main tabs: routes (evidence: `src/navigation/RootNavigator.js`)
- Main tabs → Focus timer: routes (evidence: `src/navigation/AppTabBar.js`)
- Main tabs → Dashboard screen: routes (evidence: `src/navigation/AppTabBar.js`)
- Main tabs → Settings screen: routes (evidence: `src/navigation/AppTabBar.js`)
- Login and signup → Firebase setup: uses auth (evidence: `src/screens/Login.js`)
- Account creation → Firebase setup: creates account (evidence: `src/screens/Signup.js`)
- Firebase setup → Firebase Auth: initializes (evidence: `src/api/FirebaseConfig.js`)
- Firebase setup → Cloud Firestore: initializes (evidence: `src/api/FirebaseConfig.js`)
- Auth state → Firebase setup: observes auth (evidence: `src/contexts/AuthContext.js`)
- App providers → Auth state: provides state (evidence: `App.js`)
- App providers → Language state: provides state (evidence: `App.js`)
- Language state → Translations: configures (evidence: `src/contexts/LanguageContext.js`)
- Language state → Cloud Firestore: reads and writes (evidence: `src/contexts/LanguageContext.js`)
- Settings screen → Settings modal: uses (evidence: `src/screens/Settings.js`)
- Settings modal → Auth state: logs out (evidence: `src/components/SettingsComponent.js`)
- Settings modal → Language state: changes language (evidence: `src/components/SettingsComponent.js`)
- Focus timer → Session setup: renders setup (evidence: `src/screens/Home.js`)
- Focus timer → App leave tracking: reads leave count (evidence: `src/screens/Home.js`)
- Focus timer → Timer state: controls timer (evidence: `src/screens/Home.js`)
- Focus timer → Countdown state: updates countdown (evidence: `src/screens/Home.js`)
- Focus timer → Current session state: tracks session (evidence: `src/screens/Home.js`)
- Focus timer → Session data API: creates and updates (evidence: `src/screens/Home.js`)
- Session data API → Cloud Firestore: reads and writes (evidence: `src/api/SaveUserDataCol.js`)
- Dashboard screen → Live session stats: renders (evidence: `src/screens/Dashboard.js`)
- Dashboard screen → Summary statistics: renders (evidence: `src/screens/Dashboard.js`)
- Dashboard screen → Category chart: renders (evidence: `src/screens/Dashboard.js`)
- Dashboard screen → Weekly focus chart: renders (evidence: `src/screens/Dashboard.js`)
- Live session stats → Session data API: fetches session (evidence: `src/components/BasicStats.js`)
- Summary statistics → Session data API: fetches analytics (evidence: `src/components/DashboardSummaryStats.js`)
- Category chart → Session data API: fetches categories (evidence: `src/components/CategoryPieChart.js`)
- Weekly focus chart → Session data API: fetches weekly data (evidence: `src/components/WeeklyFocusChart.js`)
