# harshpatel2414/zivacare-app architecture

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

- Interactive diagram: https://gitdiagram.com/harshpatel2414/zivacare-app
- Repository: https://github.com/harshpatel2414/zivacare-app

## Overview

ZivaCare is a mobile care-discovery and appointment-booking app. The main user journey is onboarding or sign-in, browsing doctors and treatments, selecting a schedule and submitting an appointment, then tracking appointments and notifications. Separate flows support profile updates and doctor or treatment reviews. The tree identifies Firebase service modules and Appwrite auth code; sampled excerpts confirm some UI and auth behavior, but not every screen-to-service connection, so uncertain wiring is omitted.

Main entry points: [`app/(tabs)/_layout.jsx`](https://github.com/harshpatel2414/zivacare-app/blob/master/app/(tabs)/_layout.jsx) (Tab Routes), [`app/(tabs)/index.jsx`](https://github.com/harshpatel2414/zivacare-app/blob/master/app/(tabs)/index.jsx) (Home), [`app/index.jsx`](https://github.com/harshpatel2414/zivacare-app/blob/master/app/index.jsx) (Onboarding), [`app/screens/EnterMobileNumber.jsx`](https://github.com/harshpatel2414/zivacare-app/blob/master/app/screens/EnterMobileNumber.jsx) (Mobile Sign-in)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["App Navigation"]
  node_onboarding["Onboarding<br/>[index.jsx]"]
  node_tabs["Tab Routes<br/>[_layout.jsx]"]
  node_authscreen["Mobile Sign-in"]
end

subgraph group_discovery["Care Discovery"]
  node_home["Home<br/>[index.jsx]"]
  node_doctor["Doctor Detail<br/>[&#91;id&#93;.jsx]"]
  node_treatment["Treatment Detail<br/>[&#91;id&#93;.jsx]"]
  node_schedule["Schedule<br/>[&#91;id&#93;.jsx]"]
end

subgraph group_care["Booking and Account"]
  node_book["Book Appointment"]
  node_appointments["Appointments<br/>[appointments.jsx]"]
  node_notifications["Notifications<br/>[notifications.jsx]"]
  node_profile["Profile<br/>[profile.jsx]"]
  node_profileedit["Edit Profile<br/>[update-profile.jsx]"]
  node_doctorreview["Doctor Review<br/>[DoctorReview.jsx]"]
  node_treatmentreview["Treatment Review"]
end

subgraph group_services["Backend Services"]
  node_authcontext["Auth Context<br/>[AuthContext.js]"]
  node_appointmentservice["Appointment Service<br/>[appointment.js]"]
  node_doctorservice["Doctor Service<br/>[doctor.js]"]
  node_treatmentservice["Treatment Service<br/>[treatment.js]"]
  node_notificationservice["Notification Service<br/>[notification.js]"]
  node_userservice["User Service<br/>[user.js]"]
  node_firebase["Firebase Setup<br/>[firebase.js]"]
  node_appwriteauth["Appwrite Auth<br/>[auth.js]"]
end

node_user(("Patient"))
node_firestore[("Firestore")]
node_appwrite["Appwrite"]
node_asyncstorage[("Local Storage")]

node_user -->|"starts"| node_onboarding
node_onboarding -->|"continues to"| node_authscreen
node_user -->|"signs in"| node_authscreen
node_authscreen -->|"requests auth"| node_appwriteauth
node_appwriteauth -->|"creates session"| node_appwrite
node_onboarding -->|"saves status"| node_asyncstorage
node_user -->|"browses"| node_home
node_home -->|"opens doctor"| node_doctor
node_home -->|"opens treatment"| node_treatment
node_doctor -->|"opens schedule"| node_schedule
node_schedule -->|"continues booking"| node_book
node_user -->|"submits details"| node_book
node_book -->|"requests booking"| node_appointmentservice
node_doctorreview -->|"submits review"| node_doctorservice
node_treatmentreview -->|"submits review"| node_treatmentservice
node_treatment -->|"reads detail"| node_firestore
node_authcontext -->|"subscribes to notifications"| node_firestore
node_authcontext -->|"saves user"| node_asyncstorage
node_profile -->|"opens settings"| node_profileedit
node_profileedit -->|"uploads image"| node_appointmentservice
node_tabs -->|"routes to"| node_home
node_tabs -->|"routes to"| node_appointments
node_tabs -->|"routes to"| node_notifications
node_tabs -->|"routes to"| node_profile

click node_onboarding "https://github.com/harshpatel2414/zivacare-app/blob/master/app/index.jsx"
click node_tabs "https://github.com/harshpatel2414/zivacare-app/blob/master/app/(tabs)/_layout.jsx"
click node_home "https://github.com/harshpatel2414/zivacare-app/blob/master/app/(tabs)/index.jsx"
click node_doctor "https://github.com/harshpatel2414/zivacare-app/blob/master/app/home/doctors/%5Bid%5D.jsx"
click node_treatment "https://github.com/harshpatel2414/zivacare-app/blob/master/app/home/treatments/%5Bid%5D.jsx"
click node_schedule "https://github.com/harshpatel2414/zivacare-app/blob/master/app/home/schedule/%5Bid%5D.jsx"
click node_book "https://github.com/harshpatel2414/zivacare-app/blob/master/app/home/BookAppointment.jsx"
click node_appointments "https://github.com/harshpatel2414/zivacare-app/blob/master/app/(tabs)/appointments.jsx"
click node_notifications "https://github.com/harshpatel2414/zivacare-app/blob/master/app/(tabs)/notifications.jsx"
click node_profile "https://github.com/harshpatel2414/zivacare-app/blob/master/app/(tabs)/profile.jsx"
click node_profileedit "https://github.com/harshpatel2414/zivacare-app/blob/master/app/auth/update-profile.jsx"
click node_doctorreview "https://github.com/harshpatel2414/zivacare-app/blob/master/app/screens/DoctorReview.jsx"
click node_treatmentreview "https://github.com/harshpatel2414/zivacare-app/blob/master/app/screens/TreatmentReview.jsx"
click node_authscreen "https://github.com/harshpatel2414/zivacare-app/blob/master/app/screens/EnterMobileNumber.jsx"
click node_authcontext "https://github.com/harshpatel2414/zivacare-app/blob/master/context/AuthContext.js"
click node_appointmentservice "https://github.com/harshpatel2414/zivacare-app/blob/master/app/firebase/appointment.js"
click node_doctorservice "https://github.com/harshpatel2414/zivacare-app/blob/master/app/firebase/doctor.js"
click node_treatmentservice "https://github.com/harshpatel2414/zivacare-app/blob/master/app/firebase/treatment.js"
click node_notificationservice "https://github.com/harshpatel2414/zivacare-app/blob/master/app/firebase/notification.js"
click node_userservice "https://github.com/harshpatel2414/zivacare-app/blob/master/app/firebase/user.js"
click node_firebase "https://github.com/harshpatel2414/zivacare-app/blob/master/app/firebase/firebase.js"
click node_appwriteauth "https://github.com/harshpatel2414/zivacare-app/blob/master/appwrite/auth.js"

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_onboarding,node_tabs,node_authscreen toneBlue
class node_home,node_doctor,node_treatment,node_schedule,node_firestore,node_asyncstorage toneAmber
class node_book,node_appointments,node_notifications,node_profile,node_profileedit,node_doctorreview,node_treatmentreview toneMint
class node_authcontext,node_appointmentservice,node_doctorservice,node_treatmentservice,node_notificationservice,node_userservice,node_firebase,node_appwriteauth toneRose
class node_user,node_appwrite toneIndigo
```

## Components

### App Navigation

- [Onboarding](https://github.com/harshpatel2414/zivacare-app/blob/master/app/index.jsx): `app/index.jsx`
- [Tab Routes](https://github.com/harshpatel2414/zivacare-app/blob/master/app/(tabs)/_layout.jsx): `app/(tabs)/_layout.jsx`
- [Mobile Sign-in](https://github.com/harshpatel2414/zivacare-app/blob/master/app/screens/EnterMobileNumber.jsx): `app/screens/EnterMobileNumber.jsx`

### Care Discovery

- [Home](https://github.com/harshpatel2414/zivacare-app/blob/master/app/(tabs)/index.jsx): `app/(tabs)/index.jsx`
- [Doctor Detail](https://github.com/harshpatel2414/zivacare-app/blob/master/app/home/doctors/%5Bid%5D.jsx): `app/home/doctors/[id].jsx`
- [Treatment Detail](https://github.com/harshpatel2414/zivacare-app/blob/master/app/home/treatments/%5Bid%5D.jsx): `app/home/treatments/[id].jsx`
- [Schedule](https://github.com/harshpatel2414/zivacare-app/blob/master/app/home/schedule/%5Bid%5D.jsx): `app/home/schedule/[id].jsx`

### Booking and Account

- [Book Appointment](https://github.com/harshpatel2414/zivacare-app/blob/master/app/home/BookAppointment.jsx): `app/home/BookAppointment.jsx`
- [Appointments](https://github.com/harshpatel2414/zivacare-app/blob/master/app/(tabs)/appointments.jsx): `app/(tabs)/appointments.jsx`
- [Notifications](https://github.com/harshpatel2414/zivacare-app/blob/master/app/(tabs)/notifications.jsx): `app/(tabs)/notifications.jsx`
- [Profile](https://github.com/harshpatel2414/zivacare-app/blob/master/app/(tabs)/profile.jsx): `app/(tabs)/profile.jsx`
- [Edit Profile](https://github.com/harshpatel2414/zivacare-app/blob/master/app/auth/update-profile.jsx): `app/auth/update-profile.jsx`
- [Doctor Review](https://github.com/harshpatel2414/zivacare-app/blob/master/app/screens/DoctorReview.jsx): `app/screens/DoctorReview.jsx`
- [Treatment Review](https://github.com/harshpatel2414/zivacare-app/blob/master/app/screens/TreatmentReview.jsx): `app/screens/TreatmentReview.jsx`

### Backend Services

- [Auth Context](https://github.com/harshpatel2414/zivacare-app/blob/master/context/AuthContext.js): `context/AuthContext.js`
- [Appointment Service](https://github.com/harshpatel2414/zivacare-app/blob/master/app/firebase/appointment.js): `app/firebase/appointment.js`
- [Doctor Service](https://github.com/harshpatel2414/zivacare-app/blob/master/app/firebase/doctor.js): `app/firebase/doctor.js`
- [Treatment Service](https://github.com/harshpatel2414/zivacare-app/blob/master/app/firebase/treatment.js): `app/firebase/treatment.js`
- [Notification Service](https://github.com/harshpatel2414/zivacare-app/blob/master/app/firebase/notification.js): `app/firebase/notification.js`
- [User Service](https://github.com/harshpatel2414/zivacare-app/blob/master/app/firebase/user.js): `app/firebase/user.js`
- [Firebase Setup](https://github.com/harshpatel2414/zivacare-app/blob/master/app/firebase/firebase.js): `app/firebase/firebase.js`
- [Appwrite Auth](https://github.com/harshpatel2414/zivacare-app/blob/master/appwrite/auth.js): `appwrite/auth.js`

### Other components

- **Patient**
- **Firestore**
- **Appwrite**
- **Local Storage**

## Connections

- Patient → Onboarding: starts
- Onboarding → Mobile Sign-in: continues to
- Patient → Mobile Sign-in: signs in
- Mobile Sign-in → Appwrite Auth: requests auth
- Appwrite Auth → Appwrite: creates session
- Onboarding → Local Storage: saves status
- Patient → Home: browses
- Home → Doctor Detail: opens doctor
- Home → Treatment Detail: opens treatment
- Doctor Detail → Schedule: opens schedule
- Schedule → Book Appointment: continues booking
- Patient → Book Appointment: submits details
- Book Appointment → Appointment Service: requests booking
- Doctor Review → Doctor Service: submits review
- Treatment Review → Treatment Service: submits review
- Treatment Detail → Firestore: reads detail
- Auth Context → Firestore: subscribes to notifications
- Auth Context → Local Storage: saves user
- Profile → Edit Profile: opens settings
- Edit Profile → Appointment Service: uploads image
- Tab Routes → Home: routes to
- Tab Routes → Appointments: routes to
- Tab Routes → Notifications: routes to
- Tab Routes → Profile: routes to
