# yasouanew/staff-last architecture

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

- Interactive diagram: https://gitdiagram.com/yasouanew/staff-last
- Repository: https://github.com/yasouanew/staff-last

## Overview

StaffSaaS is a workforce scheduling and staff-management mobile app for employees. The documented user workflow is signing in, then viewing shifts and rosters, reviewing shift details, and submitting availability or leave requests. Notifications and connectivity recovery support that work; the shared API client, session persistence, and outbox provide internal infrastructure. The README establishes the product capabilities, while source-index references and excerpts support only the specific implementation links shown; several feature modules were not sampled, so their internal call paths are omitted.

Main entry points: [`src/services/connectivity/recoveryPipeline.ts`](https://github.com/yasouanew/staff-last/blob/main/src/services/connectivity/recoveryPipeline.ts) (Connectivity recovery), [`src/features/auth/store/sessionStore.ts`](https://github.com/yasouanew/staff-last/blob/main/src/features/auth/store/sessionStore.ts) (Session state), [`src/features/notifications/screens/NotificationsScreen.tsx`](https://github.com/yasouanew/staff-last/blob/main/src/features/notifications/screens/NotificationsScreen.tsx) (Notification inbox), [`App.tsx`](https://github.com/yasouanew/staff-last/blob/main/App.tsx) (Mobile app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_application["Mobile app<br/>[App.tsx]"]
  node_navigation["Navigation<br/>[RootNavigator.tsx]"]
end

subgraph group_work["Work scheduling"]
  node_home["Home dashboard<br/>[HomeScreen.tsx]"]
  node_roster["My roster<br/>[MyRosterScreen.tsx]"]
  node_shift["Shift details"]
end

subgraph group_account["Account and requests"]
  node_availability["Availability"]
  node_leave["Leave requests"]
  node_authentication["Authentication<br/>[LoginScreen.tsx]"]
  node_session["Session state<br/>[sessionStore.ts]"]
end

subgraph group_messaging["Notifications"]
  node_notifications["Notification inbox"]
  node_push["Push service<br/>[pushService.ts]"]
end

subgraph group_platform["Runtime services"]
  node_recovery["Connectivity recovery"]
  node_outbox["Deferred writes<br/>[syncOutbox.ts]"]
  node_api["HTTP client<br/>[client.ts]"]
  node_credentials["Credential store<br/>[tokenStore.ts]"]
end

node_employee(("Employee"))
node_backend[("StaffSaaS backend")]

node_employee -->|"uses"| node_application
node_application -->|"starts"| node_navigation
node_employee -->|"signs in"| node_authentication
node_navigation -.->|"opens"| node_home
node_employee -->|"views roster"| node_roster
node_employee -->|"reviews shifts"| node_shift
node_employee -->|"submits availability"| node_availability
node_employee -->|"requests leave"| node_leave
node_employee -.->|"checks updates"| node_notifications
node_session -->|"loads token"| node_credentials
node_session -->|"sets auth handler"| node_api
node_api -->|"sends requests"| node_backend
node_recovery -->|"refreshes session"| node_session
node_recovery -->|"flushes writes"| node_outbox
node_recovery -->|"registers device"| node_push
node_recovery -->|"syncs inbox"| node_notifications
node_push -->|"registers token"| node_backend
node_notifications -.->|"fetches updates"| node_backend

click node_application "https://github.com/yasouanew/staff-last/blob/main/App.tsx"
click node_navigation "https://github.com/yasouanew/staff-last/blob/main/src/navigation/RootNavigator.tsx"
click node_home "https://github.com/yasouanew/staff-last/blob/main/src/features/home/screens/HomeScreen.tsx"
click node_roster "https://github.com/yasouanew/staff-last/blob/main/src/features/roster/screens/MyRosterScreen.tsx"
click node_shift "https://github.com/yasouanew/staff-last/blob/main/src/features/shifts/screens/ShiftDetailScreen.tsx"
click node_availability "https://github.com/yasouanew/staff-last/blob/main/src/features/availability/screens/AvailabilityScreen.tsx"
click node_leave "https://github.com/yasouanew/staff-last/blob/main/src/features/leave/screens/LeaveListScreen.tsx"
click node_authentication "https://github.com/yasouanew/staff-last/blob/main/src/features/auth/screens/LoginScreen.tsx"
click node_session "https://github.com/yasouanew/staff-last/blob/main/src/features/auth/store/sessionStore.ts"
click node_notifications "https://github.com/yasouanew/staff-last/blob/main/src/features/notifications/screens/NotificationsScreen.tsx"
click node_push "https://github.com/yasouanew/staff-last/blob/main/src/services/push/pushService.ts"
click node_recovery "https://github.com/yasouanew/staff-last/blob/main/src/services/connectivity/recoveryPipeline.ts"
click node_outbox "https://github.com/yasouanew/staff-last/blob/main/src/services/outbox/syncOutbox.ts"
click node_api "https://github.com/yasouanew/staff-last/blob/main/src/api/client.ts"
click node_credentials "https://github.com/yasouanew/staff-last/blob/main/src/api/tokenStore.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_application,node_navigation toneBlue
class node_home,node_roster,node_shift,node_backend toneAmber
class node_availability,node_leave,node_authentication,node_session toneMint
class node_notifications,node_push toneRose
class node_recovery,node_outbox,node_api,node_credentials,node_employee toneIndigo
```

## Components

### App shell

- [Mobile app](https://github.com/yasouanew/staff-last/blob/main/App.tsx): `App.tsx`
- [Navigation](https://github.com/yasouanew/staff-last/blob/main/src/navigation/RootNavigator.tsx): `src/navigation/RootNavigator.tsx`

### Work scheduling

- [Home dashboard](https://github.com/yasouanew/staff-last/blob/main/src/features/home/screens/HomeScreen.tsx): `src/features/home/screens/HomeScreen.tsx`
- [My roster](https://github.com/yasouanew/staff-last/blob/main/src/features/roster/screens/MyRosterScreen.tsx): `src/features/roster/screens/MyRosterScreen.tsx`
- [Shift details](https://github.com/yasouanew/staff-last/blob/main/src/features/shifts/screens/ShiftDetailScreen.tsx): `src/features/shifts/screens/ShiftDetailScreen.tsx`

### Account and requests

- [Availability](https://github.com/yasouanew/staff-last/blob/main/src/features/availability/screens/AvailabilityScreen.tsx): `src/features/availability/screens/AvailabilityScreen.tsx`
- [Leave requests](https://github.com/yasouanew/staff-last/blob/main/src/features/leave/screens/LeaveListScreen.tsx): `src/features/leave/screens/LeaveListScreen.tsx`
- [Authentication](https://github.com/yasouanew/staff-last/blob/main/src/features/auth/screens/LoginScreen.tsx): `src/features/auth/screens/LoginScreen.tsx`
- [Session state](https://github.com/yasouanew/staff-last/blob/main/src/features/auth/store/sessionStore.ts): `src/features/auth/store/sessionStore.ts`

### Notifications

- [Notification inbox](https://github.com/yasouanew/staff-last/blob/main/src/features/notifications/screens/NotificationsScreen.tsx): `src/features/notifications/screens/NotificationsScreen.tsx`
- [Push service](https://github.com/yasouanew/staff-last/blob/main/src/services/push/pushService.ts): `src/services/push/pushService.ts`

### Runtime services

- [Connectivity recovery](https://github.com/yasouanew/staff-last/blob/main/src/services/connectivity/recoveryPipeline.ts): `src/services/connectivity/recoveryPipeline.ts`
- [Deferred writes](https://github.com/yasouanew/staff-last/blob/main/src/services/outbox/syncOutbox.ts): `src/services/outbox/syncOutbox.ts`
- [HTTP client](https://github.com/yasouanew/staff-last/blob/main/src/api/client.ts): `src/api/client.ts`
- [Credential store](https://github.com/yasouanew/staff-last/blob/main/src/api/tokenStore.ts): `src/api/tokenStore.ts`

### Other components

- **Employee**
- **StaffSaaS backend**

## Connections

- Employee → Mobile app: uses (evidence: `README.md`)
- Mobile app → Navigation: starts (evidence: `App.tsx`)
- Employee → Authentication: signs in (evidence: `README.md`)
- Navigation → Home dashboard: opens
- Employee → My roster: views roster (evidence: `README.md`)
- Employee → Shift details: reviews shifts (evidence: `README.md`)
- Employee → Availability: submits availability (evidence: `README.md`)
- Employee → Leave requests: requests leave (evidence: `README.md`)
- Employee → Notification inbox: checks updates
- Session state → Credential store: loads token (evidence: `src/features/auth/store/sessionStore.ts`)
- Session state → HTTP client: sets auth handler (evidence: `src/features/auth/store/sessionStore.ts`)
- HTTP client → StaffSaaS backend: sends requests (evidence: `src/api/client.ts`)
- Connectivity recovery → Session state: refreshes session (evidence: `src/services/connectivity/recoveryPipeline.ts`)
- Connectivity recovery → Deferred writes: flushes writes (evidence: `src/services/connectivity/recoveryPipeline.ts`)
- Connectivity recovery → Push service: registers device (evidence: `src/services/connectivity/recoveryPipeline.ts`)
- Connectivity recovery → Notification inbox: syncs inbox (evidence: `src/services/connectivity/recoveryPipeline.ts`)
- Push service → StaffSaaS backend: registers token (evidence: `src/services/push/pushService.ts`)
- Notification inbox → StaffSaaS backend: fetches updates
