# sarai1209/app_movil_sentinel_face architecture

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

- Interactive diagram: https://gitdiagram.com/sarai1209/app_movil_sentinel_face
- Repository: https://github.com/sarai1209/app_movil_sentinel_face

## Overview

Sentinel Face is a mobile app for biometric access control, with administrator-facing access-event monitoring and system management. The documented login-to-role-based navigation is only partly reflected in the supplied tree: it contains admin routes, but no user tab routes or face-scan screen, so those workflow stages are not represented as implemented components. Admin screens call the API and use shared session, settings, and alert state. Several screen implementations were not excerpted; their documented capabilities are preserved, but uncertain calls are omitted.

Main entry points: [`services/api.ts`](https://github.com/sarai1209/app_movil_sentinel_face/blob/main/services/api.ts) (Backend API client), [`store/authStore.ts`](https://github.com/sarai1209/app_movil_sentinel_face/blob/main/store/authStore.ts) (Auth session), [`app/(admin)/alerts.tsx`](https://github.com/sarai1209/app_movil_sentinel_face/blob/main/app/(admin)/alerts.tsx) (Alert center), [`app/(admin)/users.tsx`](https://github.com/sarai1209/app_movil_sentinel_face/blob/main/app/(admin)/users.tsx) (User and role management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and session"]
  node_login["Login<br/>[index.tsx]"]
  node_session["Auth session<br/>[authStore.ts]"]
  node_jwt["Token validation<br/>[jwtUtils.ts]"]
  node_admin_routes["Admin route guard<br/>[_layout.tsx]"]
end

subgraph group_admin["Admin operations"]
  node_dashboard["Dashboard<br/>[dashboard.tsx]"]
  node_users["User and role management<br/>[users.tsx]"]
  node_register["Employee registration<br/>[register.tsx]"]
  node_gallery["Face gallery<br/>[gallery.tsx]"]
  node_alerts["Alert center<br/>[alerts.tsx]"]
  node_alert_detail["Alert details<br/>[alert-detail.tsx]"]
  node_audit["Audit records<br/>[audit.tsx]"]
  node_history["Access history<br/>[history.tsx]"]
  node_admin_settings["System settings<br/>[settings.tsx]"]
  node_admin_profile["Admin profile<br/>[profile.tsx]"]
end

subgraph group_platform["API and shared state"]
  node_api["Backend API client<br/>[api.ts]"]
  node_alert_state["Alert state<br/>[alertStore.ts]"]
  node_settings_state["Preference state<br/>[settingsStore.ts]"]
  node_domain["Domain types<br/>[domain.ts]"]
end

subgraph group_ui["Shared interface"]
  node_theme["Theme colors<br/>[theme.ts]"]
  node_custom_alert["Custom alert dialog<br/>[CustomAlert.tsx]"]
end

node_admin(("Administrator"))
node_backend["Backend service<br/>external system"]

node_admin -->|"signs in"| node_login
node_login -->|"submits credentials"| node_session
node_session -->|"requests login"| node_api
node_session -->|"checks expiry"| node_jwt
node_admin_routes -->|"checks role"| node_session
node_session -->|"refreshes token"| node_api
node_api -->|"updates session"| node_session
node_api -->|"sends requests"| node_backend
node_dashboard -->|"fetches dashboard data"| node_api
node_users -->|"manages users and roles"| node_api
node_users -->|"uses user types"| node_domain
node_register -->|"registers employees"| node_api
node_gallery -->|"loads gallery data"| node_api
node_alerts -->|"loads and resolves alerts"| node_api
node_alerts -->|"raises notices"| node_alert_state
node_alerts -->|"uses alert types"| node_domain
node_alert_detail -->|"loads alert details"| node_api
node_audit -->|"loads audit records"| node_api
node_history -->|"loads access logs"| node_api
node_admin_settings -->|"updates system settings"| node_api
node_admin_settings -->|"reads preferences"| node_settings_state
node_admin_profile -->|"reads session"| node_session
node_theme -->|"reads dark mode"| node_settings_state
node_custom_alert -->|"displays alert state"| node_alert_state

click node_login "https://github.com/sarai1209/app_movil_sentinel_face/blob/main/app/index.tsx"
click node_session "https://github.com/sarai1209/app_movil_sentinel_face/blob/main/store/authStore.ts"
click node_jwt "https://github.com/sarai1209/app_movil_sentinel_face/blob/main/utils/jwtUtils.ts"
click node_admin_routes "https://github.com/sarai1209/app_movil_sentinel_face/blob/main/app/(admin)/_layout.tsx"
click node_dashboard "https://github.com/sarai1209/app_movil_sentinel_face/blob/main/app/(admin)/dashboard.tsx"
click node_users "https://github.com/sarai1209/app_movil_sentinel_face/blob/main/app/(admin)/users.tsx"
click node_register "https://github.com/sarai1209/app_movil_sentinel_face/blob/main/app/(admin)/register.tsx"
click node_gallery "https://github.com/sarai1209/app_movil_sentinel_face/blob/main/app/(admin)/gallery.tsx"
click node_alerts "https://github.com/sarai1209/app_movil_sentinel_face/blob/main/app/(admin)/alerts.tsx"
click node_alert_detail "https://github.com/sarai1209/app_movil_sentinel_face/blob/main/app/(admin)/alert-detail.tsx"
click node_audit "https://github.com/sarai1209/app_movil_sentinel_face/blob/main/app/(admin)/audit.tsx"
click node_history "https://github.com/sarai1209/app_movil_sentinel_face/blob/main/app/(admin)/history.tsx"
click node_admin_settings "https://github.com/sarai1209/app_movil_sentinel_face/blob/main/app/(admin)/settings.tsx"
click node_admin_profile "https://github.com/sarai1209/app_movil_sentinel_face/blob/main/app/(admin)/profile.tsx"
click node_api "https://github.com/sarai1209/app_movil_sentinel_face/blob/main/services/api.ts"
click node_alert_state "https://github.com/sarai1209/app_movil_sentinel_face/blob/main/store/alertStore.ts"
click node_settings_state "https://github.com/sarai1209/app_movil_sentinel_face/blob/main/store/settingsStore.ts"
click node_domain "https://github.com/sarai1209/app_movil_sentinel_face/blob/main/types/domain.ts"
click node_theme "https://github.com/sarai1209/app_movil_sentinel_face/blob/main/constants/theme.ts"
click node_custom_alert "https://github.com/sarai1209/app_movil_sentinel_face/blob/main/components/ui/CustomAlert.tsx"

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_login,node_session,node_jwt,node_admin_routes toneBlue
class node_dashboard,node_users,node_register,node_gallery,node_alerts,node_alert_detail,node_audit,node_history,node_admin_settings,node_admin_profile toneAmber
class node_api,node_alert_state,node_settings_state,node_domain toneMint
class node_theme,node_custom_alert toneRose
class node_admin,node_backend toneIndigo
```

## Components

### Identity and session

- [Login](https://github.com/sarai1209/app_movil_sentinel_face/blob/main/app/index.tsx): `app/index.tsx`
- [Auth session](https://github.com/sarai1209/app_movil_sentinel_face/blob/main/store/authStore.ts): `store/authStore.ts`
- [Token validation](https://github.com/sarai1209/app_movil_sentinel_face/blob/main/utils/jwtUtils.ts): `utils/jwtUtils.ts`
- [Admin route guard](https://github.com/sarai1209/app_movil_sentinel_face/blob/main/app/(admin)/_layout.tsx): `app/(admin)/_layout.tsx`

### Admin operations

- [Dashboard](https://github.com/sarai1209/app_movil_sentinel_face/blob/main/app/(admin)/dashboard.tsx): `app/(admin)/dashboard.tsx`
- [User and role management](https://github.com/sarai1209/app_movil_sentinel_face/blob/main/app/(admin)/users.tsx): `app/(admin)/users.tsx`
- [Employee registration](https://github.com/sarai1209/app_movil_sentinel_face/blob/main/app/(admin)/register.tsx): `app/(admin)/register.tsx`
- [Face gallery](https://github.com/sarai1209/app_movil_sentinel_face/blob/main/app/(admin)/gallery.tsx): `app/(admin)/gallery.tsx`
- [Alert center](https://github.com/sarai1209/app_movil_sentinel_face/blob/main/app/(admin)/alerts.tsx): `app/(admin)/alerts.tsx`
- [Alert details](https://github.com/sarai1209/app_movil_sentinel_face/blob/main/app/(admin)/alert-detail.tsx): `app/(admin)/alert-detail.tsx`
- [Audit records](https://github.com/sarai1209/app_movil_sentinel_face/blob/main/app/(admin)/audit.tsx): `app/(admin)/audit.tsx`
- [Access history](https://github.com/sarai1209/app_movil_sentinel_face/blob/main/app/(admin)/history.tsx): `app/(admin)/history.tsx`
- [System settings](https://github.com/sarai1209/app_movil_sentinel_face/blob/main/app/(admin)/settings.tsx): `app/(admin)/settings.tsx`
- [Admin profile](https://github.com/sarai1209/app_movil_sentinel_face/blob/main/app/(admin)/profile.tsx): `app/(admin)/profile.tsx`

### API and shared state

- [Backend API client](https://github.com/sarai1209/app_movil_sentinel_face/blob/main/services/api.ts): `services/api.ts`
- [Alert state](https://github.com/sarai1209/app_movil_sentinel_face/blob/main/store/alertStore.ts): `store/alertStore.ts`
- [Preference state](https://github.com/sarai1209/app_movil_sentinel_face/blob/main/store/settingsStore.ts): `store/settingsStore.ts`
- [Domain types](https://github.com/sarai1209/app_movil_sentinel_face/blob/main/types/domain.ts): `types/domain.ts`

### Shared interface

- [Theme colors](https://github.com/sarai1209/app_movil_sentinel_face/blob/main/constants/theme.ts): `constants/theme.ts`
- [Custom alert dialog](https://github.com/sarai1209/app_movil_sentinel_face/blob/main/components/ui/CustomAlert.tsx): `components/ui/CustomAlert.tsx`

### Other components

- **Administrator**
- **Backend service**: external system

## Connections

- Administrator → Login: signs in (evidence: `README.md`)
- Login → Auth session: submits credentials (evidence: `app/index.tsx`)
- Auth session → Backend API client: requests login (evidence: `store/authStore.ts`)
- Auth session → Token validation: checks expiry (evidence: `store/authStore.ts`)
- Admin route guard → Auth session: checks role (evidence: `app/(admin)/_layout.tsx`)
- Auth session → Backend API client: refreshes token (evidence: `services/api.ts`)
- Backend API client → Auth session: updates session (evidence: `services/api.ts`)
- Backend API client → Backend service: sends requests (evidence: `services/api.ts`)
- Dashboard → Backend API client: fetches dashboard data (evidence: `app/(admin)/dashboard.tsx`)
- User and role management → Backend API client: manages users and roles (evidence: `app/(admin)/users.tsx`)
- User and role management → Domain types: uses user types (evidence: `app/(admin)/users.tsx`)
- Employee registration → Backend API client: registers employees (evidence: `app/(admin)/register.tsx`)
- Face gallery → Backend API client: loads gallery data (evidence: `app/(admin)/gallery.tsx`)
- Alert center → Backend API client: loads and resolves alerts (evidence: `app/(admin)/alerts.tsx`)
- Alert center → Alert state: raises notices (evidence: `app/(admin)/alerts.tsx`)
- Alert center → Domain types: uses alert types (evidence: `app/(admin)/alerts.tsx`)
- Alert details → Backend API client: loads alert details (evidence: `app/(admin)/alert-detail.tsx`)
- Audit records → Backend API client: loads audit records (evidence: `app/(admin)/audit.tsx`)
- Access history → Backend API client: loads access logs (evidence: `app/(admin)/history.tsx`)
- System settings → Backend API client: updates system settings (evidence: `app/(admin)/settings.tsx`)
- System settings → Preference state: reads preferences (evidence: `app/(admin)/settings.tsx`)
- Admin profile → Auth session: reads session (evidence: `app/(admin)/profile.tsx`)
- Theme colors → Preference state: reads dark mode (evidence: `constants/theme.ts`)
- Custom alert dialog → Alert state: displays alert state (evidence: `components/ui/CustomAlert.tsx`)
