# omarhatemsobhymostafa/mohemafinal architecture

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

- Interactive diagram: https://gitdiagram.com/omarhatemsobhymostafa/mohemafinal
- Repository: https://github.com/omarhatemsobhymostafa/mohemafinal

## Overview

Femora is an Arabic pregnancy companion whose main workflow is account access, pregnancy tracking, and browsing weekly pregnancy content backed by a separate Express API. Auth state and shared API transport support the dashboard, week selector, and admin content editor; the README documents backend registration, login, tracking, and weekly content. Other documented or visible branches include AI-related UI/API, a pregnancy-journal product page, and Android APK installation. Some route and integration sources were not excerpted, so uncertain connections are left unasserted.

Main entry points: [`app/components/auth/AuthProvider.tsx`](https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/components/auth/AuthProvider.tsx) (Auth session), [`app/lib/api.ts`](https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/lib/api.ts) (API transport), [`app/dashboard/page.tsx`](https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/dashboard/page.tsx) (Pregnancy dashboard), [`app/journey/[id]/page.tsx`](https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/journey/%5Bid%5D/page.tsx) (Weekly content)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and Account"]
  node_landing["Welcome page<br/>[page.tsx]"]
  node_authform["Sign-in and signup<br/>[AuthForm.tsx]"]
  node_google["Google sign-in"]
  node_authstate["Auth session<br/>[AuthProvider.tsx]"]
end

subgraph group_pregnancy["Pregnancy Journey"]
  node_dashboard["Pregnancy dashboard<br/>[page.tsx]"]
  node_weeklist["Week selector<br/>[WeekSelector.jsx]"]
  node_weekdetail["Weekly content<br/>[page.tsx]"]
  node_admin["Weekly content editor<br/>[page.tsx]"]
end

subgraph group_services["API and AI"]
  node_api["API transport<br/>[api.ts]"]
  node_backend[("Femora backend")]
  node_aiui["Pregnancy AI UI<br/>[Ai.tsx]"]
  node_airoute["AI API route<br/>[route.ts]"]
  node_ai_service["AI service"]
end

subgraph group_commerce["Product and Android"]
  node_journal["Pregnancy journal page<br/>[page.tsx]"]
  node_apkcard["Android download"]
  node_apkhelper["APK installer bridge<br/>[android-apk.ts]"]
  node_nativeplugin["Android installer plugin"]
  node_mainactivity["Android activity<br/>[MainActivity.java]"]
end

node_user(("Pregnant user"))

node_user -.->|"visits"| node_landing
node_landing -->|"checks session"| node_authstate
node_authform -->|"submits credentials"| node_authstate
node_authform -->|"renders"| node_google
node_authstate -->|"requests account"| node_api
node_api -->|"sends requests"| node_backend
node_dashboard -->|"reads session"| node_authstate
node_dashboard -.->|"loads and saves"| node_api
node_dashboard -->|"renders"| node_aiui
node_weeklist -->|"loads weeks"| node_api
node_weekdetail -->|"renders"| node_weeklist
node_weekdetail -->|"renders"| node_aiui
node_weekdetail -->|"fetches weekly content"| node_backend
node_admin -->|"checks role"| node_authstate
node_admin -->|"edits weekly content"| node_api
node_aiui -.->|"requests AI"| node_airoute
node_airoute -.->|"uses service"| node_ai_service
node_apkcard -->|"uses installer helper"| node_apkhelper
node_mainactivity -->|"registers"| node_nativeplugin
node_apkhelper -.->|"invokes"| node_nativeplugin

click node_landing "https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/page.tsx"
click node_authform "https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/components/auth/AuthForm.tsx"
click node_google "https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/components/auth/GoogleSignInButton.tsx"
click node_authstate "https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/components/auth/AuthProvider.tsx"
click node_dashboard "https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/dashboard/page.tsx"
click node_weeklist "https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/components/pregnancy/WeekSelector.jsx"
click node_weekdetail "https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/journey/%5Bid%5D/page.tsx"
click node_admin "https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/panel/page.tsx"
click node_api "https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/lib/api.ts"
click node_aiui "https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/components/pregnancy/Ai.tsx"
click node_airoute "https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/api/ai/route.ts"
click node_journal "https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/product/page.tsx"
click node_apkcard "https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/components/AndroidDownloadCard.tsx"
click node_apkhelper "https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/lib/android-apk.ts"
click node_nativeplugin "https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/android/app/src/main/java/com/mohema/app/AndroidApkInstallerPlugin.java"
click node_mainactivity "https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/android/app/src/main/java/com/mohema/app/MainActivity.java"

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_landing,node_authform,node_google,node_authstate,node_user toneBlue
class node_dashboard,node_weeklist,node_weekdetail,node_admin toneAmber
class node_api,node_backend,node_aiui,node_airoute,node_ai_service toneMint
class node_journal,node_apkcard,node_apkhelper,node_nativeplugin,node_mainactivity toneRose
```

## Components

### Entry and Account

- [Welcome page](https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/page.tsx): `app/page.tsx`
- [Sign-in and signup](https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/components/auth/AuthForm.tsx): `app/components/auth/AuthForm.tsx`
- [Google sign-in](https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/components/auth/GoogleSignInButton.tsx): `app/components/auth/GoogleSignInButton.tsx`
- [Auth session](https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/components/auth/AuthProvider.tsx): `app/components/auth/AuthProvider.tsx`

### Pregnancy Journey

- [Pregnancy dashboard](https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/dashboard/page.tsx): `app/dashboard/page.tsx`
- [Week selector](https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/components/pregnancy/WeekSelector.jsx): `app/components/pregnancy/WeekSelector.jsx`
- [Weekly content](https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/journey/%5Bid%5D/page.tsx): `app/journey/[id]/page.tsx`
- [Weekly content editor](https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/panel/page.tsx): `app/panel/page.tsx`

### API and AI

- [API transport](https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/lib/api.ts): `app/lib/api.ts`
- **Femora backend**
- [Pregnancy AI UI](https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/components/pregnancy/Ai.tsx): `app/components/pregnancy/Ai.tsx`
- [AI API route](https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/api/ai/route.ts): `app/api/ai/route.ts`
- **AI service**

### Product and Android

- [Pregnancy journal page](https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/product/page.tsx): `app/product/page.tsx`
- [Android download](https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/components/AndroidDownloadCard.tsx): `app/components/AndroidDownloadCard.tsx`
- [APK installer bridge](https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/app/lib/android-apk.ts): `app/lib/android-apk.ts`
- [Android installer plugin](https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/android/app/src/main/java/com/mohema/app/AndroidApkInstallerPlugin.java): `android/app/src/main/java/com/mohema/app/AndroidApkInstallerPlugin.java`
- [Android activity](https://github.com/omarhatemsobhymostafa/mohemafinal/blob/main/android/app/src/main/java/com/mohema/app/MainActivity.java): `android/app/src/main/java/com/mohema/app/MainActivity.java`

### Other components

- **Pregnant user**

## Connections

- Pregnant user → Welcome page: visits
- Welcome page → Auth session: checks session (evidence: `app/page.tsx`)
- Sign-in and signup → Auth session: submits credentials (evidence: `app/components/auth/AuthForm.tsx`)
- Sign-in and signup → Google sign-in: renders (evidence: `app/components/auth/AuthForm.tsx`)
- Auth session → API transport: requests account (evidence: `app/components/auth/AuthProvider.tsx`)
- API transport → Femora backend: sends requests (evidence: `README.md`)
- Pregnancy dashboard → Auth session: reads session (evidence: `app/dashboard/page.tsx`)
- Pregnancy dashboard → API transport: loads and saves (evidence: `app/dashboard/page.tsx`)
- Pregnancy dashboard → Pregnancy AI UI: renders (evidence: `app/dashboard/page.tsx`)
- Week selector → API transport: loads weeks (evidence: `app/components/pregnancy/WeekSelector.jsx`)
- Weekly content → Week selector: renders (evidence: `app/journey/[id]/page.tsx`)
- Weekly content → Pregnancy AI UI: renders (evidence: `app/journey/[id]/page.tsx`)
- Weekly content → Femora backend: fetches weekly content (evidence: `README.md`)
- Weekly content editor → Auth session: checks role (evidence: `app/panel/page.tsx`)
- Weekly content editor → API transport: edits weekly content (evidence: `app/panel/page.tsx`)
- Pregnancy AI UI → AI API route: requests AI
- AI API route → AI service: uses service
- Android download → APK installer bridge: uses installer helper (evidence: `app/components/AndroidDownloadCard.tsx`)
- Android activity → Android installer plugin: registers (evidence: `android/app/src/main/java/com/mohema/app/MainActivity.java`)
- APK installer bridge → Android installer plugin: invokes
