# qleanfeel-bot/qleanfeel-rn architecture

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

- Interactive diagram: https://gitdiagram.com/qleanfeel-bot/qleanfeel-rn
- Repository: https://github.com/qleanfeel-bot/qleanfeel-rn

## Overview

Qleanfeel is a React Native app for authentication and user-facing calendar, manual-order, and profile workflows, paired with a NestJS backend whose shown API surface handles authentication and health. The mobile entry point composes services and gates the authenticated shell; application services delegate domain operations to repositories and infrastructure adapters. Backend auth routes invoke session use cases, with persistence wiring supplied by the database module. The README describes the mobile product but not its feature details; unsampled feature and backend links are omitted or marked unverified.

Main entry points: [`src/presentation/auth/AuthenticatedAppShell.tsx`](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/presentation/auth/AuthenticatedAppShell.tsx) (App shell), [`src/presentation/auth/AuthGate.tsx`](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/presentation/auth/AuthGate.tsx) (Auth gate), [`backend/src/http/auth/auth.controller.ts`](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/backend/src/http/auth/auth.controller.ts) (Auth routes), [`src/application/calendar/CalendarService.ts`](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/application/calendar/CalendarService.ts) (Calendar service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile application"]
  node_app["App entry<br/>[App.tsx]"]
  node_shell["App shell"]
  node_navigation["Navigation<br/>[RootNavigator.tsx]"]
end

subgraph group_mobile_auth["Mobile authentication"]
  node_auth_gate["Auth gate<br/>[AuthGate.tsx]"]
  node_auth_controller["Auth state"]
  node_provider_port["Provider adapter"]
  node_auth_api_port["Auth API port<br/>[AuthApi.ts]"]
  node_login["Login screen<br/>[LoginScreen.tsx]"]
  node_dev_auth["Preview auth"]
end

subgraph group_mobile_features["Product features"]
  node_calendar_ui["Calendar screens"]
  node_calendar_service["Calendar service<br/>[CalendarService.ts]"]
  node_calendar_adapter["Calendar API adapter"]
  node_calendar_api["Calendar API<br/>[CalendarApi.ts]"]
  node_calendar_domain["Calendar model<br/>[CalendarEntry.ts]"]
  node_manual_ui["Order screens"]
  node_scheduled_order["Scheduled order use case"]
  node_order_service["Order service"]
  node_order_adapter["Order API adapter"]
  node_order_api["Order API<br/>[ManualOrderApi.ts]"]
  node_order_domain["Order model<br/>[ManualOrder.ts]"]
  node_profile_ui["Profile screens"]
  node_profile_service["Profile service<br/>[ProfileService.ts]"]
  node_profile_adapter["Profile API adapter"]
  node_profile_api["Profile API<br/>[ProfileApi.ts]"]
  node_profile_domain["Profile model<br/>[Profile.ts]"]
end

subgraph group_backend_http["Backend API"]
  node_backend_main["Backend startup<br/>[main.ts]"]
  node_auth_controller_http["Auth routes<br/>[auth.controller.ts]"]
  node_me_controller["Current-user route<br/>[me.controller.ts]"]
  node_access_guard["Access guard"]
  node_health["Health endpoint"]
  node_app_module["Backend modules<br/>[app.module.ts]"]
end

subgraph group_backend_core["Backend identity and storage"]
  node_bootstrap_usecase["Bootstrap session"]
end

node_user(("App user"))
node_backend_client(("Mobile client"))

node_user -.->|"uses"| node_app
node_app -->|"renders"| node_auth_gate
node_app -.->|"composes preview"| node_dev_auth
node_auth_gate -->|"initializes"| node_auth_controller
node_auth_gate -->|"renders"| node_login
node_auth_gate -->|"renders"| node_shell
node_auth_controller -->|"requests credentials"| node_provider_port
node_auth_controller -->|"authenticates with"| node_auth_api_port
node_shell -->|"renders"| node_navigation
node_shell -->|"provides"| node_calendar_service
node_shell -->|"provides"| node_order_service
node_shell -->|"provides"| node_scheduled_order
node_shell -->|"provides"| node_profile_service
node_calendar_ui -.->|"uses"| node_calendar_service
node_calendar_service -->|"delegates"| node_calendar_adapter
node_calendar_adapter -->|"calls"| node_calendar_api
node_calendar_adapter -->|"maps entries"| node_calendar_domain
node_manual_ui -.->|"uses"| node_order_service
node_scheduled_order -->|"uses"| node_calendar_service
node_scheduled_order -->|"uses"| node_order_service
node_order_service -->|"delegates"| node_order_adapter
node_order_adapter -->|"calls"| node_order_api
node_order_adapter -->|"maps orders"| node_order_domain
node_profile_ui -.->|"uses"| node_profile_service
node_profile_service -->|"delegates"| node_profile_adapter
node_profile_adapter -->|"calls"| node_profile_api
node_profile_adapter -->|"maps profile"| node_profile_domain
node_backend_client -.->|"calls"| node_auth_controller_http
node_backend_main -->|"starts"| node_app_module
node_app_module -->|"registers"| node_auth_controller_http
node_app_module -->|"registers"| node_health
node_auth_controller_http -->|"executes"| node_bootstrap_usecase
node_auth_controller_http -->|"guards logout"| node_access_guard
node_me_controller -->|"guards route"| node_access_guard

click node_app "https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/App.tsx"
click node_auth_gate "https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/presentation/auth/AuthGate.tsx"
click node_auth_controller "https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/application/auth/AuthStateController.ts"
click node_provider_port "https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/application/auth/ports/AuthProviderAdapter.ts"
click node_auth_api_port "https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/application/auth/ports/AuthApi.ts"
click node_login "https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/presentation/auth/LoginScreen.tsx"
click node_dev_auth "https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/development/auth/createDevelopmentAuthController.ts"
click node_shell "https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/presentation/auth/AuthenticatedAppShell.tsx"
click node_navigation "https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/presentation/navigation/RootNavigator.tsx"
click node_calendar_ui "https://github.com/qleanfeel-bot/qleanfeel-rn/tree/main/src/presentation/calendar"
click node_calendar_service "https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/application/calendar/CalendarService.ts"
click node_calendar_adapter "https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/infrastructure/calendar/CalendarApiRepository.ts"
click node_calendar_api "https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/infrastructure/calendar/CalendarApi.ts"
click node_calendar_domain "https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/domain/calendar/entities/CalendarEntry.ts"
click node_manual_ui "https://github.com/qleanfeel-bot/qleanfeel-rn/tree/main/src/presentation/manualOrder"
click node_scheduled_order "https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/application/manualOrder/CreateScheduledManualOrder.ts"
click node_order_service "https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/application/manualOrder/ManualOrderService.ts"
click node_order_adapter "https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/infrastructure/manualOrder/ManualOrderApiRepository.ts"
click node_order_api "https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/infrastructure/manualOrder/ManualOrderApi.ts"
click node_order_domain "https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/domain/manualOrder/entities/ManualOrder.ts"
click node_profile_ui "https://github.com/qleanfeel-bot/qleanfeel-rn/tree/main/src/presentation/profile"
click node_profile_service "https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/application/profile/ProfileService.ts"
click node_profile_adapter "https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/infrastructure/profile/ProfileApiRepository.ts"
click node_profile_api "https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/infrastructure/profile/ProfileApi.ts"
click node_profile_domain "https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/domain/profile/entities/Profile.ts"
click node_backend_main "https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/backend/src/main.ts"
click node_auth_controller_http "https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/backend/src/http/auth/auth.controller.ts"
click node_me_controller "https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/backend/src/http/auth/me.controller.ts"
click node_access_guard "https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/backend/src/http/auth/qleanfeel-access.guard.ts"
click node_health "https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/backend/src/http/health/health.controller.ts"
click node_app_module "https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/backend/src/app.module.ts"
click node_bootstrap_usecase "https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/backend/src/application/identity/use-cases/bootstrap-auth-session.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_app,node_shell,node_navigation,node_user,node_backend_client toneBlue
class node_auth_gate,node_auth_controller,node_provider_port,node_auth_api_port,node_login,node_dev_auth toneAmber
class node_calendar_ui,node_calendar_service,node_calendar_adapter,node_calendar_api,node_calendar_domain,node_manual_ui,node_scheduled_order,node_order_service,node_order_adapter,node_order_api,node_order_domain,node_profile_ui,node_profile_service,node_profile_adapter,node_profile_api,node_profile_domain toneMint
class node_backend_main,node_auth_controller_http,node_me_controller,node_access_guard,node_health,node_app_module toneRose
class node_bootstrap_usecase toneIndigo
```

## Components

### Mobile application

- [App entry](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/App.tsx): `App.tsx`
- [App shell](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/presentation/auth/AuthenticatedAppShell.tsx): `src/presentation/auth/AuthenticatedAppShell.tsx`
- [Navigation](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/presentation/navigation/RootNavigator.tsx): `src/presentation/navigation/RootNavigator.tsx`

### Mobile authentication

- [Auth gate](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/presentation/auth/AuthGate.tsx): `src/presentation/auth/AuthGate.tsx`
- [Auth state](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/application/auth/AuthStateController.ts): `src/application/auth/AuthStateController.ts`
- [Provider adapter](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/application/auth/ports/AuthProviderAdapter.ts): `src/application/auth/ports/AuthProviderAdapter.ts`
- [Auth API port](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/application/auth/ports/AuthApi.ts): `src/application/auth/ports/AuthApi.ts`
- [Login screen](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/presentation/auth/LoginScreen.tsx): `src/presentation/auth/LoginScreen.tsx`
- [Preview auth](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/development/auth/createDevelopmentAuthController.ts): `src/development/auth/createDevelopmentAuthController.ts`

### Product features

- [Calendar screens](https://github.com/qleanfeel-bot/qleanfeel-rn/tree/main/src/presentation/calendar): `src/presentation/calendar`
- [Calendar service](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/application/calendar/CalendarService.ts): `src/application/calendar/CalendarService.ts`
- [Calendar API adapter](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/infrastructure/calendar/CalendarApiRepository.ts): `src/infrastructure/calendar/CalendarApiRepository.ts`
- [Calendar API](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/infrastructure/calendar/CalendarApi.ts): `src/infrastructure/calendar/CalendarApi.ts`
- [Calendar model](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/domain/calendar/entities/CalendarEntry.ts): `src/domain/calendar/entities/CalendarEntry.ts`
- [Order screens](https://github.com/qleanfeel-bot/qleanfeel-rn/tree/main/src/presentation/manualOrder): `src/presentation/manualOrder`
- [Scheduled order use case](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/application/manualOrder/CreateScheduledManualOrder.ts): `src/application/manualOrder/CreateScheduledManualOrder.ts`
- [Order service](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/application/manualOrder/ManualOrderService.ts): `src/application/manualOrder/ManualOrderService.ts`
- [Order API adapter](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/infrastructure/manualOrder/ManualOrderApiRepository.ts): `src/infrastructure/manualOrder/ManualOrderApiRepository.ts`
- [Order API](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/infrastructure/manualOrder/ManualOrderApi.ts): `src/infrastructure/manualOrder/ManualOrderApi.ts`
- [Order model](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/domain/manualOrder/entities/ManualOrder.ts): `src/domain/manualOrder/entities/ManualOrder.ts`
- [Profile screens](https://github.com/qleanfeel-bot/qleanfeel-rn/tree/main/src/presentation/profile): `src/presentation/profile`
- [Profile service](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/application/profile/ProfileService.ts): `src/application/profile/ProfileService.ts`
- [Profile API adapter](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/infrastructure/profile/ProfileApiRepository.ts): `src/infrastructure/profile/ProfileApiRepository.ts`
- [Profile API](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/infrastructure/profile/ProfileApi.ts): `src/infrastructure/profile/ProfileApi.ts`
- [Profile model](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/src/domain/profile/entities/Profile.ts): `src/domain/profile/entities/Profile.ts`

### Backend API

- [Backend startup](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/backend/src/main.ts): `backend/src/main.ts`
- [Auth routes](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/backend/src/http/auth/auth.controller.ts): `backend/src/http/auth/auth.controller.ts`
- [Current-user route](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/backend/src/http/auth/me.controller.ts): `backend/src/http/auth/me.controller.ts`
- [Access guard](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/backend/src/http/auth/qleanfeel-access.guard.ts): `backend/src/http/auth/qleanfeel-access.guard.ts`
- [Health endpoint](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/backend/src/http/health/health.controller.ts): `backend/src/http/health/health.controller.ts`
- [Backend modules](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/backend/src/app.module.ts): `backend/src/app.module.ts`

### Backend identity and storage

- [Bootstrap session](https://github.com/qleanfeel-bot/qleanfeel-rn/blob/main/backend/src/application/identity/use-cases/bootstrap-auth-session.ts): `backend/src/application/identity/use-cases/bootstrap-auth-session.ts`

### Other components

- **App user**
- **Mobile client**

## Connections

- App user → App entry: uses
- App entry → Auth gate: renders (evidence: `App.tsx`)
- App entry → Preview auth: composes preview
- Auth gate → Auth state: initializes (evidence: `src/presentation/auth/AuthGate.tsx`)
- Auth gate → Login screen: renders (evidence: `src/presentation/auth/AuthGate.tsx`)
- Auth gate → App shell: renders (evidence: `src/presentation/auth/AuthGate.tsx`)
- Auth state → Provider adapter: requests credentials (evidence: `src/application/auth/AuthStateController.ts`)
- Auth state → Auth API port: authenticates with (evidence: `src/application/auth/AuthStateController.ts`)
- App shell → Navigation: renders (evidence: `src/presentation/auth/AuthenticatedAppShell.tsx`)
- App shell → Calendar service: provides (evidence: `src/presentation/auth/AuthenticatedAppShell.tsx`)
- App shell → Order service: provides (evidence: `src/presentation/auth/AuthenticatedAppShell.tsx`)
- App shell → Scheduled order use case: provides (evidence: `src/presentation/auth/AuthenticatedAppShell.tsx`)
- App shell → Profile service: provides (evidence: `src/presentation/auth/AuthenticatedAppShell.tsx`)
- Calendar screens → Calendar service: uses
- Calendar service → Calendar API adapter: delegates (evidence: `src/application/calendar/CalendarService.ts`)
- Calendar API adapter → Calendar API: calls (evidence: `src/infrastructure/calendar/CalendarApiRepository.ts`)
- Calendar API adapter → Calendar model: maps entries (evidence: `src/infrastructure/calendar/CalendarApiRepository.ts`)
- Order screens → Order service: uses
- Scheduled order use case → Calendar service: uses (evidence: `src/application/manualOrder/CreateScheduledManualOrder.ts`)
- Scheduled order use case → Order service: uses (evidence: `src/application/manualOrder/CreateScheduledManualOrder.ts`)
- Order service → Order API adapter: delegates (evidence: `src/application/manualOrder/ManualOrderService.ts`)
- Order API adapter → Order API: calls (evidence: `src/infrastructure/manualOrder/ManualOrderApiRepository.ts`)
- Order API adapter → Order model: maps orders (evidence: `src/infrastructure/manualOrder/ManualOrderApiRepository.ts`)
- Profile screens → Profile service: uses
- Profile service → Profile API adapter: delegates (evidence: `src/application/profile/ProfileService.ts`)
- Profile API adapter → Profile API: calls (evidence: `src/infrastructure/profile/ProfileApiRepository.ts`)
- Profile API adapter → Profile model: maps profile (evidence: `src/infrastructure/profile/ProfileApiRepository.ts`)
- Mobile client → Auth routes: calls
- Backend startup → Backend modules: starts (evidence: `backend/src/main.ts`)
- Backend modules → Auth routes: registers (evidence: `backend/src/app.module.ts`)
- Backend modules → Health endpoint: registers (evidence: `backend/src/app.module.ts`)
- Auth routes → Bootstrap session: executes (evidence: `backend/src/http/auth/auth.controller.ts`)
- Auth routes → Access guard: guards logout (evidence: `backend/src/http/auth/auth.controller.ts`)
- Current-user route → Access guard: guards route (evidence: `backend/src/http/auth/me.controller.ts`)
