# mahah26/globalconnect_frontend architecture

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

- Interactive diagram: https://gitdiagram.com/mahah26/globalconnect_frontend
- Repository: https://github.com/mahah26/globalconnect_frontend

## Overview

This is a cross-platform Expo workforce-management app. Employees and administrators sign in, then use role-specific dashboards and routed screens for attendance, leave, employee records, communications, and reporting; screens retrieve or update data through a shared API client. The graph preserves the README’s template-level description and the product capabilities visible in sampled source, without implying a backend implementation. Relationships are limited to imports and calls shown in the source index or excerpts; several route details and unsampled implementations remain unverified.

Main entry points: [`src/lib/api.ts`](https://github.com/mahah26/globalconnect_frontend/blob/master/src/lib/api.ts) (API client), [`src/app/(app)/_layout.tsx`](https://github.com/mahah26/globalconnect_frontend/blob/master/src/app/(app)/_layout.tsx) (App routing shell), [`src/context/AuthContext.tsx`](https://github.com/mahah26/globalconnect_frontend/blob/master/src/context/AuthContext.tsx) (Authentication state), [`src/components/CalendarPicker.tsx`](https://github.com/mahah26/globalconnect_frontend/blob/master/src/components/CalendarPicker.tsx) (Date controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and navigation"]
  node_auth_screens["Landing and login"]
  node_auth_shared["Auth components<br/>[AuthShared.tsx]"]
  node_auth_context["Authentication state<br/>[AuthContext.tsx]"]
  node_app_shell["App routing shell<br/>[_layout.tsx]"]
  node_navigation["Sidebar navigation<br/>[Sidebar.tsx]"]
end

subgraph group_workforce["Workforce operations"]
  node_dashboards["Role dashboards"]
  node_attendance["Attendance<br/>[attendance.tsx]"]
  node_team_attendance["Team attendance"]
  node_employees["Employee records"]
  node_leave["Leave requests and review"]
  node_locations["Locations<br/>[locations.tsx]"]
end

subgraph group_communication["Communication"]
  node_chat["Team chat"]
  node_notifications["Notifications<br/>[notifications.tsx]"]
  node_notification_state["Notification state"]
end

subgraph group_insights["Insights and administration"]
  node_insights["Personal insights<br/>[insights.tsx]"]
  node_reports["Reports and progress"]
  node_settings_profile["Settings and profile"]
end

subgraph group_platform["Shared platform"]
  node_api["API client<br/>[api.ts]"]
  node_storage[("Token storage<br/>[storage.ts]")]
  node_ui["Shared UI components<br/>[ui.tsx]"]
  node_date_controls["Date controls<br/>[CalendarPicker.tsx]"]
  node_theme["Theme<br/>[theme.ts]"]
end

node_user(("Employee or admin"))
node_backend["Application API"]

node_user -->|"signs in"| node_auth_screens
node_auth_screens -->|"renders"| node_auth_shared
node_auth_screens -->|"uses auth"| node_auth_context
node_auth_context -->|"authenticates"| node_api
node_api -->|"stores tokens"| node_storage
node_api -->|"sends requests"| node_backend
node_app_shell -->|"uses auth"| node_auth_context
node_app_shell -->|"renders"| node_navigation
node_app_shell -->|"uses components"| node_ui
node_app_shell -->|"calls"| node_api
node_app_shell -->|"routes to"| node_dashboards
node_dashboards -->|"reads user"| node_auth_context
node_dashboards -->|"loads data"| node_api
node_attendance -->|"loads and updates"| node_api
node_team_attendance -->|"loads data"| node_api
node_employees -->|"loads and updates"| node_api
node_leave -->|"loads and updates"| node_api
node_locations -->|"loads and updates"| node_api
node_chat -->|"loads and sends"| node_api
node_notifications -->|"uses state"| node_notification_state
node_notification_state -->|"reads user"| node_auth_context
node_notification_state -->|"loads and updates"| node_api
node_insights -->|"loads data"| node_api
node_reports -->|"loads data"| node_api
node_settings_profile -->|"loads and updates"| node_api
node_attendance -->|"uses picker"| node_date_controls
node_leave -->|"uses picker"| node_date_controls
node_reports -->|"uses picker"| node_date_controls
node_auth_shared -->|"uses components"| node_ui
node_auth_shared -->|"uses styles"| node_theme
node_date_controls -->|"uses styles"| node_theme
node_ui -->|"uses styles"| node_theme

click node_auth_screens "https://github.com/mahah26/globalconnect_frontend/tree/master/src/app"
click node_auth_shared "https://github.com/mahah26/globalconnect_frontend/blob/master/src/components/AuthShared.tsx"
click node_auth_context "https://github.com/mahah26/globalconnect_frontend/blob/master/src/context/AuthContext.tsx"
click node_app_shell "https://github.com/mahah26/globalconnect_frontend/blob/master/src/app/(app)/_layout.tsx"
click node_navigation "https://github.com/mahah26/globalconnect_frontend/blob/master/src/components/Sidebar.tsx"
click node_dashboards "https://github.com/mahah26/globalconnect_frontend/tree/master/src/components"
click node_attendance "https://github.com/mahah26/globalconnect_frontend/blob/master/src/app/(app)/attendance.tsx"
click node_team_attendance "https://github.com/mahah26/globalconnect_frontend/blob/master/src/app/(app)/team-attendance.tsx"
click node_employees "https://github.com/mahah26/globalconnect_frontend/tree/master/src/app/(app)"
click node_leave "https://github.com/mahah26/globalconnect_frontend/tree/master/src/app/(app)"
click node_locations "https://github.com/mahah26/globalconnect_frontend/blob/master/src/app/(app)/locations.tsx"
click node_chat "https://github.com/mahah26/globalconnect_frontend/tree/master/src/app/(app)"
click node_notifications "https://github.com/mahah26/globalconnect_frontend/blob/master/src/app/(app)/notifications.tsx"
click node_notification_state "https://github.com/mahah26/globalconnect_frontend/blob/master/src/context/NotificationContext.tsx"
click node_insights "https://github.com/mahah26/globalconnect_frontend/blob/master/src/app/(app)/insights.tsx"
click node_reports "https://github.com/mahah26/globalconnect_frontend/tree/master/src/app/(app)"
click node_settings_profile "https://github.com/mahah26/globalconnect_frontend/tree/master/src/app/(app)"
click node_api "https://github.com/mahah26/globalconnect_frontend/blob/master/src/lib/api.ts"
click node_storage "https://github.com/mahah26/globalconnect_frontend/blob/master/src/lib/storage.ts"
click node_ui "https://github.com/mahah26/globalconnect_frontend/blob/master/src/components/ui.tsx"
click node_date_controls "https://github.com/mahah26/globalconnect_frontend/blob/master/src/components/CalendarPicker.tsx"
click node_theme "https://github.com/mahah26/globalconnect_frontend/blob/master/src/theme.ts"

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_auth_screens,node_auth_shared,node_auth_context,node_app_shell,node_navigation toneBlue
class node_dashboards,node_attendance,node_team_attendance,node_employees,node_leave,node_locations toneAmber
class node_chat,node_notifications,node_notification_state,node_backend toneMint
class node_insights,node_reports,node_settings_profile toneRose
class node_api,node_storage,node_ui,node_date_controls,node_theme,node_user toneIndigo
```

## Components

### Access and navigation

- [Landing and login](https://github.com/mahah26/globalconnect_frontend/tree/master/src/app): `src/app`
- [Auth components](https://github.com/mahah26/globalconnect_frontend/blob/master/src/components/AuthShared.tsx): `src/components/AuthShared.tsx`
- [Authentication state](https://github.com/mahah26/globalconnect_frontend/blob/master/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [App routing shell](https://github.com/mahah26/globalconnect_frontend/blob/master/src/app/(app)/_layout.tsx): `src/app/(app)/_layout.tsx`
- [Sidebar navigation](https://github.com/mahah26/globalconnect_frontend/blob/master/src/components/Sidebar.tsx): `src/components/Sidebar.tsx`

### Workforce operations

- [Role dashboards](https://github.com/mahah26/globalconnect_frontend/tree/master/src/components): `src/components`
- [Attendance](https://github.com/mahah26/globalconnect_frontend/blob/master/src/app/(app)/attendance.tsx): `src/app/(app)/attendance.tsx`
- [Team attendance](https://github.com/mahah26/globalconnect_frontend/blob/master/src/app/(app)/team-attendance.tsx): `src/app/(app)/team-attendance.tsx`
- [Employee records](https://github.com/mahah26/globalconnect_frontend/tree/master/src/app/(app)): `src/app/(app)`
- [Leave requests and review](https://github.com/mahah26/globalconnect_frontend/tree/master/src/app/(app)): `src/app/(app)`
- [Locations](https://github.com/mahah26/globalconnect_frontend/blob/master/src/app/(app)/locations.tsx): `src/app/(app)/locations.tsx`

### Communication

- [Team chat](https://github.com/mahah26/globalconnect_frontend/tree/master/src/app/(app)): `src/app/(app)`
- [Notifications](https://github.com/mahah26/globalconnect_frontend/blob/master/src/app/(app)/notifications.tsx): `src/app/(app)/notifications.tsx`
- [Notification state](https://github.com/mahah26/globalconnect_frontend/blob/master/src/context/NotificationContext.tsx): `src/context/NotificationContext.tsx`

### Insights and administration

- [Personal insights](https://github.com/mahah26/globalconnect_frontend/blob/master/src/app/(app)/insights.tsx): `src/app/(app)/insights.tsx`
- [Reports and progress](https://github.com/mahah26/globalconnect_frontend/tree/master/src/app/(app)): `src/app/(app)`
- [Settings and profile](https://github.com/mahah26/globalconnect_frontend/tree/master/src/app/(app)): `src/app/(app)`

### Shared platform

- [API client](https://github.com/mahah26/globalconnect_frontend/blob/master/src/lib/api.ts): `src/lib/api.ts`
- [Token storage](https://github.com/mahah26/globalconnect_frontend/blob/master/src/lib/storage.ts): `src/lib/storage.ts`
- [Shared UI components](https://github.com/mahah26/globalconnect_frontend/blob/master/src/components/ui.tsx): `src/components/ui.tsx`
- [Date controls](https://github.com/mahah26/globalconnect_frontend/blob/master/src/components/CalendarPicker.tsx): `src/components/CalendarPicker.tsx`
- [Theme](https://github.com/mahah26/globalconnect_frontend/blob/master/src/theme.ts): `src/theme.ts`

### Other components

- **Employee or admin**
- **Application API**

## Connections

- Employee or admin → Landing and login: signs in (evidence: `src/app/login.tsx`)
- Landing and login → Auth components: renders (evidence: `src/app/login.tsx`)
- Landing and login → Authentication state: uses auth (evidence: `src/app/login.tsx`)
- Authentication state → API client: authenticates (evidence: `src/context/AuthContext.tsx`)
- API client → Token storage: stores tokens (evidence: `src/lib/api.ts`)
- API client → Application API: sends requests (evidence: `src/lib/api.ts`)
- App routing shell → Authentication state: uses auth (evidence: `src/app/(app)/_layout.tsx`)
- App routing shell → Sidebar navigation: renders (evidence: `src/app/(app)/_layout.tsx`)
- App routing shell → Shared UI components: uses components (evidence: `src/app/(app)/_layout.tsx`)
- App routing shell → API client: calls (evidence: `src/app/(app)/_layout.tsx`)
- App routing shell → Role dashboards: routes to (evidence: `src/app/(app)/_layout.tsx`)
- Role dashboards → Authentication state: reads user (evidence: `src/components/EmployeeHome.tsx`)
- Role dashboards → API client: loads data (evidence: `src/components/EmployeeHome.tsx`)
- Attendance → API client: loads and updates (evidence: `src/app/(app)/attendance.tsx`)
- Team attendance → API client: loads data (evidence: `src/app/(app)/team-attendance.tsx`)
- Employee records → API client: loads and updates (evidence: `src/app/(app)/employees.tsx`)
- Leave requests and review → API client: loads and updates (evidence: `src/app/(app)/leave-review.tsx`)
- Locations → API client: loads and updates (evidence: `src/app/(app)/locations.tsx`)
- Team chat → API client: loads and sends (evidence: `src/app/(app)/chat-room.tsx`)
- Notifications → Notification state: uses state (evidence: `src/app/(app)/notifications.tsx`)
- Notification state → Authentication state: reads user (evidence: `src/context/NotificationContext.tsx`)
- Notification state → API client: loads and updates (evidence: `src/context/NotificationContext.tsx`)
- Personal insights → API client: loads data (evidence: `src/app/(app)/insights.tsx`)
- Reports and progress → API client: loads data (evidence: `src/app/(app)/reports.tsx`)
- Settings and profile → API client: loads and updates (evidence: `src/app/(app)/settings.tsx`)
- Attendance → Date controls: uses picker (evidence: `src/app/(app)/attendance.tsx`)
- Leave requests and review → Date controls: uses picker (evidence: `src/app/(app)/leave.tsx`)
- Reports and progress → Date controls: uses picker (evidence: `src/app/(app)/reports.tsx`)
- Auth components → Shared UI components: uses components (evidence: `src/components/AuthShared.tsx`)
- Auth components → Theme: uses styles (evidence: `src/components/AuthShared.tsx`)
- Date controls → Theme: uses styles (evidence: `src/components/CalendarPicker.tsx`)
- Shared UI components → Theme: uses styles (evidence: `src/components/ui.tsx`)
