# omar290904/jaladope architecture

> Architecture diagram of the GitHub repository omar290904/jaladope, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/omar290904/jaladope
- Repository: https://github.com/omar290904/jaladope

## Overview

##### Project type and purpose
- This is a full-stack mobile application built with Expo (React Native) using the expo-router “app” folder convention for screen-based routing.
- A simple Node.js/Express API (“API/api.js”) and a local “db” folder implement your backend data layer.
- The mobile client handles authentication, tabbed navigation, QR features, and user-specific shortcuts.

##### File structure
- Top-level “app” folder: expo-router screens organized into two route groups:
- (auth): authentication flows
- (tabs): main tabbed UI (add, chat, courses, profile, qr)
- _layout.js files define shared layouts per group and the root navigation container
- “components”: reusable UI pieces (ShortCuts, TabBar)
- “views”: screen subcomponents and modals (Home shortcuts, QR scanner, QR display)
- “context”: React Context providers for AuthContext (login state, tokens) and UIContext (theme, loading states)
- “service/auth.service.js”: client-side service for calling backend auth endpoints
- “API/api.js”: Express server entrypoint defining REST endpoints
- “db/user/user.js”: data model or file for user persistence
- “assets” and “themes”: fonts, images, and theming definitions

##### Detail without overcomplicating
- Grouping (e.g., group all “app/(tabs)” screens under a “Tabs” container)
- Don’t omit the Context or Service layer—they are critical glue

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Mobile Client Boundary
    subgraph "Mobile Client"
        direction TB

        User["User"]:::external

        subgraph "Routing / Layout"
            direction TB
            RootLayout["Root Layout"]:::ui
            AuthLayout["Auth Group Layout"]:::ui
            TabsLayout["Tabs Group Layout"]:::ui
        end

        subgraph "Auth Screens Group"
            direction TB
            AuthScreens["Auth Screens"]:::ui
        end

        subgraph "Tabs Screens Group"
            direction TB
            HomeIndex["Home Screen"]:::ui
            AddScreen["Add Screen"]:::ui
            ChatScreen["Chat Screen"]:::ui
            CoursesScreen["Courses Screen"]:::ui
            ProfileScreen["Profile Screen"]:::ui
            QRScreen["QR Screen"]:::ui
        end

        subgraph "UI Components"
            direction TB
            TabBar["TabBar Layout"]:::ui
            HomeCal["Home Calendar Shortcut"]:::ui
            HomeShort["Home Shortcut Item"]:::ui
        end

        subgraph "Views / Modals"
            direction TB
            UserShortCut["User ShortCut View"]:::ui
            ScanModal["QR Scanner Modal"]:::ui
            QRDisplay["QR Display"]:::ui
        end

        subgraph "State Contexts"
            direction TB
            AuthContext["Auth Context"]:::context
            UIContext["UI Context"]:::context
        end

        subgraph "Service Layer"
            direction TB
            AuthService["Auth Service"]:::service
        end

        User --> RootLayout
        RootLayout --> AuthLayout
        RootLayout --> TabsLayout

        AuthLayout --> AuthScreens

        TabsLayout --> HomeIndex
        TabsLayout --> AddScreen
        TabsLayout --> ChatScreen
        TabsLayout --> CoursesScreen
        TabsLayout --> ProfileScreen
        TabsLayout --> QRScreen

        %% Screens interaction with Contexts and Components
        AuthScreens --> AuthContext
        AuthScreens --> UIContext

        HomeIndex --> AuthContext
        HomeIndex --> UIContext
        AddScreen --> AuthContext
        AddScreen --> UIContext
        ChatScreen --> AuthContext
        ChatScreen --> UIContext
        CoursesScreen --> AuthContext
        CoursesScreen --> UIContext
        ProfileScreen --> AuthContext
        ProfileScreen --> UIContext
        QRScreen --> AuthContext
        QRScreen --> UIContext

        HomeIndex --> TabBar
        HomeIndex --> HomeCal
        HomeIndex --> HomeShort

        HomeShort --> UserShortCut
        QRScreen --> ScanModal
        QRScreen --> QRDisplay

        %% Context to Service to API
        AuthContext --> AuthService
        AuthService -->|"HTTP Request"| ExpressAPI
        ExpressAPI -->|"read/write"| UserModel
        ExpressAPI -->|"HTTP Response"| AuthService
        AuthService -->|"data"| AuthContext

    end

    %% Backend Boundary
    subgraph "Backend API"
        direction TB
        ExpressAPI["Express API Server"]:::backend
        UserModel["User Data Model"]:::data
    end

    %% Assets and Themes
    subgraph "Assets & Themes"
        direction TB
        Fonts["Fonts"]:::asset
        Images["Images"]:::asset
        Theme["Theme Definitions"]:::asset
    end

    %% Click Events
    click RootLayout "https://github.com/omar290904/jaladope/blob/main/app/_layout.js"
    click AuthLayout "https://github.com/omar290904/jaladope/blob/main/app/(auth)/_layout.js"
    click TabsLayout "https://github.com/omar290904/jaladope/blob/main/app/(tabs)/_layout.js"
    click AuthScreens "https://github.com/omar290904/jaladope/tree/main/app/(auth)"
    click HomeIndex "https://github.com/omar290904/jaladope/blob/main/app/(tabs)/index.js"
    click AddScreen "https://github.com/omar290904/jaladope/blob/main/app/(tabs)/add.js"
    click ChatScreen "https://github.com/omar290904/jaladope/blob/main/app/(tabs)/chat.js"
    click CoursesScreen "https://github.com/omar290904/jaladope/blob/main/app/(tabs)/courses.js"
    click ProfileScreen "https://github.com/omar290904/jaladope/blob/main/app/(tabs)/profile.js"
    click QRScreen "https://github.com/omar290904/jaladope/blob/main/app/(tabs)/qr.js"
    click TabBar "https://github.com/omar290904/jaladope/blob/main/components/TabBar/TabBarLayout.js"
    click HomeCal "https://github.com/omar290904/jaladope/blob/main/components/ShortCuts/HomeCalendar.js"
    click HomeShort "https://github.com/omar290904/jaladope/blob/main/components/ShortCuts/HomeShortCut.js"
    click UserShortCut "https://github.com/omar290904/jaladope/blob/main/views/Home/UserShortCut.js"
    click ScanModal "https://github.com/omar290904/jaladope/blob/main/views/QR/ScanQRCodeModal.js"
    click QRDisplay "https://github.com/omar290904/jaladope/blob/main/views/QR/UserViewQr.js"
    click AuthContext "https://github.com/omar290904/jaladope/blob/main/context/Auth/AuthContext.js"
    click UIContext "https://github.com/omar290904/jaladope/blob/main/context/UI/UIContext.js"
    click AuthService "https://github.com/omar290904/jaladope/blob/main/service/auth.service.js"
    click ExpressAPI "https://github.com/omar290904/jaladope/blob/main/API/api.js"
    click UserModel "https://github.com/omar290904/jaladope/blob/main/db/user/user.js"
    click Fonts "https://github.com/omar290904/jaladope/tree/main/assets/fonts"
    click Images "https://github.com/omar290904/jaladope/tree/main/assets/img"
    click Theme "https://github.com/omar290904/jaladope/blob/main/themes/theme.js"

    %% Styles
    classDef ui fill:#D0EEFF,stroke:#0077CC,color:#000000
    classDef context fill:#E0FFE0,stroke:#009900,color:#000000
    classDef service fill:#FFE5CC,stroke:#CC6600,color:#000000
    classDef backend fill:#FFC0C0,stroke:#CC0000,color:#000000
    classDef data fill:#EEEEEE,stroke:#888888,color:#000000
    classDef asset fill:#F0F0F0,stroke:#BBBBBB,color:#000000
    classDef external fill:#FFFFFF,stroke:#000000,color:#000000
```
