# chhaychanboromey/petpulse architecture

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

- Interactive diagram: https://gitdiagram.com/chhaychanboromey/petpulse
- Repository: https://github.com/chhaychanboromey/petpulse

## Overview

PetPulse is a set of Express microservices for pet-care administration: identity, pet profiles, appointments, prescriptions, and invoicing. The sampled services accept REST requests, apply domain checks, and persist records through Mongoose connections. Registration also hashes passwords and uses a User model. The tree includes an API Gateway and Login service, but their behavior and routing are not shown in the excerpts; no gateway-to-service workflow is asserted. MongoDB connection relationships are shown where the sampled connector code calls Mongoose.

Main entry points: [`Registration/index.js`](https://github.com/chhaychanboromey/petpulse/blob/main/Registration/index.js) (Registration API), [`Registration/db-connect.js`](https://github.com/chhaychanboromey/petpulse/blob/main/Registration/db-connect.js) (Registration DB connector), [`Login/db-connect.js`](https://github.com/chhaychanboromey/petpulse/blob/main/Login/db-connect.js) (Login DB connector), [`Pet_Profile/db-connect.js`](https://github.com/chhaychanboromey/petpulse/blob/main/Pet_Profile/db-connect.js) (Pet DB connector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_edge["Gateway"]
  node_gateway["API Gateway<br/>[api-gateway.js]"]
end

subgraph group_identity["Identity"]
  node_registration["Registration API<br/>[index.js]"]
  node_user_model["User model<br/>[User.js]"]
  node_registration_db["Registration DB connector<br/>[db-connect.js]"]
  node_login["Login service<br/>[index.js]"]
  node_login_db["Login DB connector<br/>[db-connect.js]"]
end

subgraph group_care["Pet Care"]
  node_pet_profile["Pet profiles<br/>[index.js]"]
  node_pet_db["Pet DB connector<br/>[db-connect.js]"]
  node_appointments["Appointments<br/>[index.js]"]
  node_appointment_db["Appointment DB connector<br/>[db-connect.js]"]
  node_prescriptions["Prescriptions<br/>[index.js]"]
  node_prescription_db["Prescription DB connector<br/>[db-connect.js]"]
end

subgraph group_finance["Billing"]
  node_billing["Invoices<br/>[index.js]"]
  node_billing_db["Billing DB connector<br/>[db-connect.js]"]
end

node_client(("API caller"))
node_mongodb[("MongoDB")]

node_registration -->|"uses model"| node_user_model
node_registration -->|"connects via"| node_registration_db
node_registration_db -->|"connects"| node_mongodb
node_login -->|"connects via"| node_login_db
node_login_db -->|"connects"| node_mongodb
node_pet_profile -->|"connects via"| node_pet_db
node_pet_db -->|"connects"| node_mongodb
node_appointments -->|"connects via"| node_appointment_db
node_appointment_db -->|"connects"| node_mongodb
node_prescriptions -->|"connects via"| node_prescription_db
node_prescription_db -->|"connects"| node_mongodb
node_billing -->|"connects via"| node_billing_db
node_billing_db -->|"connects"| node_mongodb

click node_gateway "https://github.com/chhaychanboromey/petpulse/blob/main/API-Gateway/api-gateway.js"
click node_registration "https://github.com/chhaychanboromey/petpulse/blob/main/Registration/index.js"
click node_user_model "https://github.com/chhaychanboromey/petpulse/blob/main/Registration/User.js"
click node_registration_db "https://github.com/chhaychanboromey/petpulse/blob/main/Registration/db-connect.js"
click node_login "https://github.com/chhaychanboromey/petpulse/blob/main/Login/index.js"
click node_login_db "https://github.com/chhaychanboromey/petpulse/blob/main/Login/db-connect.js"
click node_pet_profile "https://github.com/chhaychanboromey/petpulse/blob/main/Pet_Profile/index.js"
click node_pet_db "https://github.com/chhaychanboromey/petpulse/blob/main/Pet_Profile/db-connect.js"
click node_appointments "https://github.com/chhaychanboromey/petpulse/blob/main/Appointment/index.js"
click node_appointment_db "https://github.com/chhaychanboromey/petpulse/blob/main/Appointment/db-connect.js"
click node_prescriptions "https://github.com/chhaychanboromey/petpulse/blob/main/Prescription/index.js"
click node_prescription_db "https://github.com/chhaychanboromey/petpulse/blob/main/Prescription/db-connect.js"
click node_billing "https://github.com/chhaychanboromey/petpulse/blob/main/Billing/index.js"
click node_billing_db "https://github.com/chhaychanboromey/petpulse/blob/main/Billing/db-connect.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_gateway toneBlue
class node_registration,node_user_model,node_registration_db,node_login,node_login_db,node_mongodb toneAmber
class node_pet_profile,node_pet_db,node_appointments,node_appointment_db,node_prescriptions,node_prescription_db,node_client toneMint
class node_billing,node_billing_db toneRose
```

## Components

### Gateway

- [API Gateway](https://github.com/chhaychanboromey/petpulse/blob/main/API-Gateway/api-gateway.js): `API-Gateway/api-gateway.js`

### Identity

- [Registration API](https://github.com/chhaychanboromey/petpulse/blob/main/Registration/index.js): `Registration/index.js`
- [User model](https://github.com/chhaychanboromey/petpulse/blob/main/Registration/User.js): `Registration/User.js`
- [Registration DB connector](https://github.com/chhaychanboromey/petpulse/blob/main/Registration/db-connect.js): `Registration/db-connect.js`
- [Login service](https://github.com/chhaychanboromey/petpulse/blob/main/Login/index.js): `Login/index.js`
- [Login DB connector](https://github.com/chhaychanboromey/petpulse/blob/main/Login/db-connect.js): `Login/db-connect.js`

### Pet Care

- [Pet profiles](https://github.com/chhaychanboromey/petpulse/blob/main/Pet_Profile/index.js): `Pet_Profile/index.js`
- [Pet DB connector](https://github.com/chhaychanboromey/petpulse/blob/main/Pet_Profile/db-connect.js): `Pet_Profile/db-connect.js`
- [Appointments](https://github.com/chhaychanboromey/petpulse/blob/main/Appointment/index.js): `Appointment/index.js`
- [Appointment DB connector](https://github.com/chhaychanboromey/petpulse/blob/main/Appointment/db-connect.js): `Appointment/db-connect.js`
- [Prescriptions](https://github.com/chhaychanboromey/petpulse/blob/main/Prescription/index.js): `Prescription/index.js`
- [Prescription DB connector](https://github.com/chhaychanboromey/petpulse/blob/main/Prescription/db-connect.js): `Prescription/db-connect.js`

### Billing

- [Invoices](https://github.com/chhaychanboromey/petpulse/blob/main/Billing/index.js): `Billing/index.js`
- [Billing DB connector](https://github.com/chhaychanboromey/petpulse/blob/main/Billing/db-connect.js): `Billing/db-connect.js`

### Other components

- **API caller**
- **MongoDB**

## Connections

- Registration API → User model: uses model (evidence: `Registration/index.js`)
- Registration API → Registration DB connector: connects via (evidence: `Registration/index.js`)
- Registration DB connector → MongoDB: connects (evidence: `Registration/db-connect.js`)
- Login service → Login DB connector: connects via (evidence: `Login/index.js`)
- Login DB connector → MongoDB: connects (evidence: `Login/db-connect.js`)
- Pet profiles → Pet DB connector: connects via (evidence: `Pet_Profile/index.js`)
- Pet DB connector → MongoDB: connects (evidence: `Pet_Profile/db-connect.js`)
- Appointments → Appointment DB connector: connects via (evidence: `Appointment/index.js`)
- Appointment DB connector → MongoDB: connects (evidence: `Appointment/db-connect.js`)
- Prescriptions → Prescription DB connector: connects via (evidence: `Prescription/index.js`)
- Prescription DB connector → MongoDB: connects (evidence: `Prescription/db-connect.js`)
- Invoices → Billing DB connector: connects via (evidence: `Billing/index.js`)
- Billing DB connector → MongoDB: connects (evidence: `Billing/db-connect.js`)
