# guivconb/mandaily architecture

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

- Interactive diagram: https://gitdiagram.com/guivconb/mandaily
- Repository: https://github.com/guivconb/mandaily

## Overview

Mandaily is represented here primarily by an Express backend for user accounts, medication and appointment records, and scheduling; the README identifies the Flutter app only as a starter project. The main backend flow is an HTTP request through route and controller to a domain service, which accesses models. The Flutter application’s Dart source is absent from the supplied tree, so its UI and client-side calls cannot be mapped. Links are limited to relationships visible in excerpts or the SOURCE INDEX; scheduling and persistence details are consequently incomplete.

Main entry points: [`backend/src/index.js`](https://github.com/guivconb/mandaily/blob/master/backend/src/index.js) (Express server), [`backend/src/services/scheduleService.js`](https://github.com/guivconb/mandaily/blob/master/backend/src/services/scheduleService.js) (Schedule service), [`backend/src/services/medicationService.js`](https://github.com/guivconb/mandaily/blob/master/backend/src/services/medicationService.js) (Medication service), [`backend/src/routes/userRoutes.js`](https://github.com/guivconb/mandaily/blob/master/backend/src/routes/userRoutes.js) (User routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API ingress"]
  node_entry["Express server<br/>[index.js]"]
  node_dbconfig["DB configuration<br/>[dbConnection.js]"]
  node_userroute["User routes<br/>[userRoutes.js]"]
  node_medroute["Medication routes"]
  node_apptroute["Appointment routes"]
  node_schedroute["Schedule routes<br/>[scheduleRoutes.js]"]
end

subgraph group_accounts["User accounts"]
  node_userctrl["User controller<br/>[userController.js]"]
  node_usersvc["User service<br/>[userService.js]"]
  node_usermodel["User model<br/>[userModel.js]"]
end

subgraph group_care["Care records"]
  node_medctrl["Medication controller"]
  node_medsvc["Medication service"]
  node_medmodel["Medication model<br/>[medicationModel.js]"]
  node_apptctrl["Appointment controller"]
  node_apptsvc["Appointment service"]
  node_apptmodel["Appointment model"]
  node_notify["Notifications"]
end

subgraph group_schedule["Scheduling"]
  node_schedctrl["Schedule controller"]
  node_schedsvc["Schedule service<br/>[scheduleService.js]"]
  node_schedmodel["Schedule model<br/>[scheduleModel.js]"]
end

node_caller(("API caller"))

node_caller -.->|"sends requests"| node_entry
node_entry -->|"registers routes"| node_userroute
node_entry -->|"registers routes"| node_medroute
node_entry -->|"registers routes"| node_apptroute
node_entry -->|"registers routes"| node_schedroute
node_entry -->|"configures database"| node_dbconfig
node_userroute -->|"dispatches to"| node_userctrl
node_medroute -->|"dispatches to"| node_medctrl
node_apptroute -->|"dispatches to"| node_apptctrl
node_schedroute -->|"dispatches to"| node_schedctrl
node_userctrl -->|"calls"| node_usersvc
node_usersvc -->|"accesses"| node_usermodel
node_medctrl -->|"calls"| node_medsvc
node_medsvc -->|"accesses"| node_medmodel
node_medsvc -->|"uses"| node_notify
node_apptctrl -->|"calls"| node_apptsvc
node_apptsvc -->|"accesses"| node_apptmodel
node_schedctrl -->|"calls"| node_schedsvc
node_schedsvc -->|"accesses"| node_schedmodel
node_schedsvc -->|"checks user"| node_usermodel
node_schedsvc -->|"checks medication"| node_medmodel
node_schedsvc -->|"checks appointment"| node_apptmodel

click node_entry "https://github.com/guivconb/mandaily/blob/master/backend/src/index.js"
click node_dbconfig "https://github.com/guivconb/mandaily/blob/master/backend/src/config/dbConnection.js"
click node_userroute "https://github.com/guivconb/mandaily/blob/master/backend/src/routes/userRoutes.js"
click node_medroute "https://github.com/guivconb/mandaily/blob/master/backend/src/routes/medicationRoutes.js"
click node_apptroute "https://github.com/guivconb/mandaily/blob/master/backend/src/routes/appointmentRoutes.js"
click node_schedroute "https://github.com/guivconb/mandaily/blob/master/backend/src/routes/scheduleRoutes.js"
click node_userctrl "https://github.com/guivconb/mandaily/blob/master/backend/src/controllers/userController.js"
click node_usersvc "https://github.com/guivconb/mandaily/blob/master/backend/src/services/userService.js"
click node_usermodel "https://github.com/guivconb/mandaily/blob/master/backend/src/models/userModel.js"
click node_medctrl "https://github.com/guivconb/mandaily/blob/master/backend/src/controllers/medicationController.js"
click node_medsvc "https://github.com/guivconb/mandaily/blob/master/backend/src/services/medicationService.js"
click node_medmodel "https://github.com/guivconb/mandaily/blob/master/backend/src/models/medicationModel.js"
click node_apptctrl "https://github.com/guivconb/mandaily/blob/master/backend/src/controllers/appointmentController.js"
click node_apptsvc "https://github.com/guivconb/mandaily/blob/master/backend/src/services/appointmentService.js"
click node_apptmodel "https://github.com/guivconb/mandaily/blob/master/backend/src/models/appointmentModel.js"
click node_notify "https://github.com/guivconb/mandaily/blob/master/backend/src/services/notificationService.js"
click node_schedctrl "https://github.com/guivconb/mandaily/blob/master/backend/src/controllers/scheduleController.js"
click node_schedsvc "https://github.com/guivconb/mandaily/blob/master/backend/src/services/scheduleService.js"
click node_schedmodel "https://github.com/guivconb/mandaily/blob/master/backend/src/models/scheduleModel.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_entry,node_dbconfig,node_userroute,node_medroute,node_apptroute,node_schedroute toneBlue
class node_userctrl,node_usersvc,node_usermodel toneAmber
class node_medctrl,node_medsvc,node_medmodel,node_apptctrl,node_apptsvc,node_apptmodel,node_notify,node_caller toneMint
class node_schedctrl,node_schedsvc,node_schedmodel toneRose
```

## Components

### API ingress

- [Express server](https://github.com/guivconb/mandaily/blob/master/backend/src/index.js): `backend/src/index.js`
- [DB configuration](https://github.com/guivconb/mandaily/blob/master/backend/src/config/dbConnection.js): `backend/src/config/dbConnection.js`
- [User routes](https://github.com/guivconb/mandaily/blob/master/backend/src/routes/userRoutes.js): `backend/src/routes/userRoutes.js`
- [Medication routes](https://github.com/guivconb/mandaily/blob/master/backend/src/routes/medicationRoutes.js): `backend/src/routes/medicationRoutes.js`
- [Appointment routes](https://github.com/guivconb/mandaily/blob/master/backend/src/routes/appointmentRoutes.js): `backend/src/routes/appointmentRoutes.js`
- [Schedule routes](https://github.com/guivconb/mandaily/blob/master/backend/src/routes/scheduleRoutes.js): `backend/src/routes/scheduleRoutes.js`

### User accounts

- [User controller](https://github.com/guivconb/mandaily/blob/master/backend/src/controllers/userController.js): `backend/src/controllers/userController.js`
- [User service](https://github.com/guivconb/mandaily/blob/master/backend/src/services/userService.js): `backend/src/services/userService.js`
- [User model](https://github.com/guivconb/mandaily/blob/master/backend/src/models/userModel.js): `backend/src/models/userModel.js`

### Care records

- [Medication controller](https://github.com/guivconb/mandaily/blob/master/backend/src/controllers/medicationController.js): `backend/src/controllers/medicationController.js`
- [Medication service](https://github.com/guivconb/mandaily/blob/master/backend/src/services/medicationService.js): `backend/src/services/medicationService.js`
- [Medication model](https://github.com/guivconb/mandaily/blob/master/backend/src/models/medicationModel.js): `backend/src/models/medicationModel.js`
- [Appointment controller](https://github.com/guivconb/mandaily/blob/master/backend/src/controllers/appointmentController.js): `backend/src/controllers/appointmentController.js`
- [Appointment service](https://github.com/guivconb/mandaily/blob/master/backend/src/services/appointmentService.js): `backend/src/services/appointmentService.js`
- [Appointment model](https://github.com/guivconb/mandaily/blob/master/backend/src/models/appointmentModel.js): `backend/src/models/appointmentModel.js`
- [Notifications](https://github.com/guivconb/mandaily/blob/master/backend/src/services/notificationService.js): `backend/src/services/notificationService.js`

### Scheduling

- [Schedule controller](https://github.com/guivconb/mandaily/blob/master/backend/src/controllers/scheduleController.js): `backend/src/controllers/scheduleController.js`
- [Schedule service](https://github.com/guivconb/mandaily/blob/master/backend/src/services/scheduleService.js): `backend/src/services/scheduleService.js`
- [Schedule model](https://github.com/guivconb/mandaily/blob/master/backend/src/models/scheduleModel.js): `backend/src/models/scheduleModel.js`

### Other components

- **API caller**

## Connections

- API caller → Express server: sends requests
- Express server → User routes: registers routes (evidence: `backend/src/index.js`)
- Express server → Medication routes: registers routes (evidence: `backend/src/index.js`)
- Express server → Appointment routes: registers routes (evidence: `backend/src/index.js`)
- Express server → Schedule routes: registers routes (evidence: `backend/src/index.js`)
- Express server → DB configuration: configures database (evidence: `backend/src/index.js`)
- User routes → User controller: dispatches to (evidence: `backend/src/routes/userRoutes.js`)
- Medication routes → Medication controller: dispatches to (evidence: `backend/src/routes/medicationRoutes.js`)
- Appointment routes → Appointment controller: dispatches to (evidence: `backend/src/routes/appointmentRoutes.js`)
- Schedule routes → Schedule controller: dispatches to (evidence: `backend/src/routes/scheduleRoutes.js`)
- User controller → User service: calls (evidence: `backend/src/controllers/userController.js`)
- User service → User model: accesses (evidence: `backend/src/services/userService.js`)
- Medication controller → Medication service: calls (evidence: `backend/src/controllers/medicationController.js`)
- Medication service → Medication model: accesses (evidence: `backend/src/services/medicationService.js`)
- Medication service → Notifications: uses (evidence: `backend/src/services/medicationService.js`)
- Appointment controller → Appointment service: calls (evidence: `backend/src/controllers/appointmentController.js`)
- Appointment service → Appointment model: accesses (evidence: `backend/src/services/appointmentService.js`)
- Schedule controller → Schedule service: calls (evidence: `backend/src/controllers/scheduleController.js`)
- Schedule service → Schedule model: accesses (evidence: `backend/src/services/scheduleService.js`)
- Schedule service → User model: checks user (evidence: `backend/src/services/scheduleService.js`)
- Schedule service → Medication model: checks medication (evidence: `backend/src/services/scheduleService.js`)
- Schedule service → Appointment model: checks appointment (evidence: `backend/src/services/scheduleService.js`)
