# aniruddha-gade/hospital-appointment-booking__react-native architecture

> Architecture diagram of the GitHub repository aniruddha-gade/hospital-appointment-booking__react-native, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aniruddha-gade/hospital-appointment-booking__react-native
- Repository: https://github.com/aniruddha-gade/hospital-appointment-booking__react-native

## Overview

##### Main Components Identification
- Frontend Mobile Client:
- Built with React Native and Expo.
- Contains various screens (e.g., Home, Login, BookAppointment, HospitalDetails, Profile) and sub-components (e.g., Navigation modules, Shared components, Hooks).
- Shows how the UI is structured using the “App/components”, “App/screens”, “App/Navigations”, and “App/hooks” directories.
- Navigation & UI Layer:
- The “App/Navigations” and “App/components” directories reflect architectural decisions (like tab and home navigation) to manage screen transitions and display components.
- API Services:
- The “services” folder (with files such as globalApi.js) highlights the abstraction for network requests to the backend.
- Backend API:
- Although not directly visible in the file tree, the README indicates that a robust API is implemented using Strapi.
- This API handles appointments, doctor details, user profiles, etc., and is likely connected to a database.
- Authentication Service:
- Clerk is used for secure user authentication and authorization.
- External Dependencies:
- Integration with external libraries and frameworks like Expo (for mobile development) and potentially a database used via the Strapi backend.

##### Relationships and Data Flow
- Optionally, include a notional database component behind the Strapi API to indicate data persistence.

##### Important Architectural Patterns and Principles
- Separation of Concerns: The distinction between UI (React Native screens/components), business logic (API service calls and hooks), and backend processing (Strapi API, authentication with Clerk) is key.
- Layered Architecture: Clearly mark the presentation layer (UI), service layer (API integration and hooks), and backend (Strapi + database) layer.
- Use of External Services: Highlight the integration of external authentication (Clerk) and backend (Strapi).

- Mobile App to the API Service layer (globalApi) which will then connect downward to the Backend API (Strapi) and ultimately to a Database symbol.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Mobile Client Layer
    subgraph "Mobile App (React Native/Expo)"
        direction TB
        AppMain["Mobile App (App.js & App Directory)"]:::frontend
        Navigation["Navigation (Home & Tab Navigation)"]:::frontend
        UI["UI Components (Screens, Shared Components, Hooks)"]:::frontend
        SignIn["Authentication UI (SignInWithOAuth)"]:::frontend
    end

    %% Service Layer
    APIService["API Service (globalApi)"]:::service

    %% Backend Layer
    Backend["Backend (Strapi API)"]:::backend
    Database["Database"]:::backend

    %% External Authentication Service
    Clerk["Authentication Service (Clerk)"]:::external

    %% Relationships and Data Flow
    AppMain -->|"Uses"| Navigation
    AppMain -->|"Uses"| UI
    AppMain -->|"API calls"| APIService
    APIService -->|"Processes request"| Backend
    Backend -->|"Persists data"| Database
    AppMain -->|"Login"| SignIn
    SignIn -->|"Authenticates via"| Clerk
    Clerk -->|"Auth response"| AppMain

    %% Click Events
    click AppMain "https://github.com/aniruddha-gade/hospital-appointment-booking__react-native/tree/main/App"
    click Navigation "https://github.com/aniruddha-gade/hospital-appointment-booking__react-native/tree/main/App/Navigations"
    click UI "https://github.com/aniruddha-gade/hospital-appointment-booking__react-native/tree/main/App/components"
    click APIService "https://github.com/aniruddha-gade/hospital-appointment-booking__react-native/blob/main/services/globalApi.js"
    click SignIn "https://github.com/aniruddha-gade/hospital-appointment-booking__react-native/blob/main/App/components/SignInWithOAuth.js"

    %% Styles
    classDef frontend fill:#AED6F1,stroke:#5DADE2,stroke-width:2px;
    classDef service fill:#A9DFBF,stroke:#27AE60,stroke-width:2px;
    classDef backend fill:#F9E79F,stroke:#F1C40F,stroke-width:2px;
    classDef external fill:#F5B7B1,stroke:#E74C3C,stroke-width:2px;
```
