# jhasabhishek17/petpaws architecture

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

- Interactive diagram: https://gitdiagram.com/jhasabhishek17/petpaws
- Repository: https://github.com/jhasabhishek17/petpaws

## Overview

PetPaws is a full-stack pet marketplace and care platform. Buyers browse and filter listings, inspect pet details, check out, and follow orders; sellers manage listings and stock, while veterinarians and pet owners use consultation, grooming, and support features. The React app selects these user-facing areas, and an Express REST API provides backend capabilities with MongoDB and JSON-file persistence. The README documents several product flows not visible in sampled UI code; links are limited to calls or relationships shown in the excerpts or explicitly documented there.

Main entry points: [`client/src/App.jsx`](https://github.com/jhasabhishek17/petpaws/blob/main/client/src/App.jsx) (App shell), [`server/server.js`](https://github.com/jhasabhishek17/petpaws/blob/main/server/server.js) (REST API), [`server/db.js`](https://github.com/jhasabhishek17/petpaws/blob/main/server/db.js) (JSON persistence), [`server/controllers/orderController.js`](https://github.com/jhasabhishek17/petpaws/blob/main/server/controllers/orderController.js) (Orders and tracking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client experience"]
  node_app["App shell<br/>[App.jsx]"]
  node_auth["Role authentication<br/>[AuthModal.jsx]"]
end

subgraph group_commerce["Marketplace and orders"]
  node_market["Pet marketplace<br/>[Marketplace.jsx]"]
  node_detail["Pet details<br/>[PetDetailModal.jsx]"]
  node_checkout["Checkout and payment<br/>[CheckoutModal.jsx]"]
  node_tracking["Order tracking<br/>[OrdersTracking.jsx]"]
  node_seller["Seller portal"]
end

subgraph group_care["Care and support"]
  node_vets["Vet consultations<br/>[VetSection.jsx]"]
  node_grooming["Grooming and training"]
  node_support["Customer support"]
end

subgraph group_backend["API capabilities"]
  node_api["REST API<br/>[server.js]"]
  node_authctl["Authentication<br/>[authController.js]"]
  node_petctl["Pet listings<br/>[petController.js]"]
  node_orderctl["Orders and tracking<br/>[orderController.js]"]
  node_vetctl["Vet scheduling<br/>[vetController.js]"]
  node_servicectl["Care services"]
  node_supportctl["Support tickets"]
end

subgraph group_persistence["Persistence"]
  node_userstore[("User records<br/>[User.js]")]
  node_petstore[("Pet records<br/>[Pet.js]")]
  node_orderstore[("Order records<br/>[Order.js]")]
  node_vetstore[("Vet records<br/>[VetProfile.js]")]
  node_appointmentstore[("Appointment records<br/>[VetAppointment.js]")]
  node_groomstore[("Grooming records<br/>[GroomingService.js]")]
  node_bookingstore[("Booking records<br/>[GroomingBooking.js]")]
  node_ticketstore[("Ticket records<br/>[SupportTicket.js]")]
  node_jsondb[("JSON persistence<br/>[db.js]")]
  node_mongodb[("MongoDB connection<br/>[db.js]")]
end

node_user(("PetPaws user"))

node_user -->|"uses"| node_app
node_app -->|"opens"| node_auth
node_app -->|"renders"| node_market
node_app -->|"renders"| node_detail
node_app -->|"renders"| node_checkout
node_app -->|"renders"| node_tracking
node_app -->|"renders"| node_seller
node_app -->|"renders"| node_vets
node_app -->|"renders"| node_grooming
node_app -->|"renders"| node_support
node_app -->|"fetches listings"| node_api
node_api -->|"routes auth"| node_authctl
node_api -->|"routes pets"| node_petctl
node_api -->|"routes orders"| node_orderctl
node_api -->|"routes vets"| node_vetctl
node_api -->|"routes services"| node_servicectl
node_api -->|"routes support"| node_supportctl
node_authctl -->|"reads and writes"| node_userstore
node_authctl -->|"uses fallback"| node_jsondb
node_petctl -->|"reads and writes"| node_petstore
node_petctl -->|"uses fallback"| node_jsondb
node_orderctl -->|"reads and writes"| node_orderstore
node_orderctl -->|"updates stock"| node_petstore
node_orderctl -->|"uses fallback"| node_jsondb
node_vetctl -->|"reads and writes"| node_vetstore
node_vetctl -->|"reads and writes"| node_appointmentstore
node_vetctl -->|"uses fallback"| node_jsondb
node_servicectl -->|"reads and writes"| node_groomstore
node_servicectl -->|"reads and writes"| node_bookingstore
node_servicectl -->|"uses fallback"| node_jsondb
node_supportctl -->|"reads and writes"| node_ticketstore
node_supportctl -->|"uses fallback"| node_jsondb
node_api -->|"connects database"| node_mongodb

click node_app "https://github.com/jhasabhishek17/petpaws/blob/main/client/src/App.jsx"
click node_auth "https://github.com/jhasabhishek17/petpaws/blob/main/client/src/components/AuthModal.jsx"
click node_market "https://github.com/jhasabhishek17/petpaws/blob/main/client/src/components/Marketplace.jsx"
click node_detail "https://github.com/jhasabhishek17/petpaws/blob/main/client/src/components/PetDetailModal.jsx"
click node_checkout "https://github.com/jhasabhishek17/petpaws/blob/main/client/src/components/CheckoutModal.jsx"
click node_tracking "https://github.com/jhasabhishek17/petpaws/blob/main/client/src/components/OrdersTracking.jsx"
click node_seller "https://github.com/jhasabhishek17/petpaws/blob/main/client/src/components/SellerDashboard.jsx"
click node_vets "https://github.com/jhasabhishek17/petpaws/blob/main/client/src/components/VetSection.jsx"
click node_grooming "https://github.com/jhasabhishek17/petpaws/blob/main/client/src/components/GroomingCareSection.jsx"
click node_support "https://github.com/jhasabhishek17/petpaws/blob/main/client/src/components/CustomerSupport.jsx"
click node_api "https://github.com/jhasabhishek17/petpaws/blob/main/server/server.js"
click node_authctl "https://github.com/jhasabhishek17/petpaws/blob/main/server/controllers/authController.js"
click node_petctl "https://github.com/jhasabhishek17/petpaws/blob/main/server/controllers/petController.js"
click node_orderctl "https://github.com/jhasabhishek17/petpaws/blob/main/server/controllers/orderController.js"
click node_vetctl "https://github.com/jhasabhishek17/petpaws/blob/main/server/controllers/vetController.js"
click node_servicectl "https://github.com/jhasabhishek17/petpaws/blob/main/server/controllers/serviceController.js"
click node_supportctl "https://github.com/jhasabhishek17/petpaws/blob/main/server/controllers/supportController.js"
click node_userstore "https://github.com/jhasabhishek17/petpaws/blob/main/server/models/User.js"
click node_petstore "https://github.com/jhasabhishek17/petpaws/blob/main/server/models/Pet.js"
click node_orderstore "https://github.com/jhasabhishek17/petpaws/blob/main/server/models/Order.js"
click node_vetstore "https://github.com/jhasabhishek17/petpaws/blob/main/server/models/VetProfile.js"
click node_appointmentstore "https://github.com/jhasabhishek17/petpaws/blob/main/server/models/VetAppointment.js"
click node_groomstore "https://github.com/jhasabhishek17/petpaws/blob/main/server/models/GroomingService.js"
click node_bookingstore "https://github.com/jhasabhishek17/petpaws/blob/main/server/models/GroomingBooking.js"
click node_ticketstore "https://github.com/jhasabhishek17/petpaws/blob/main/server/models/SupportTicket.js"
click node_jsondb "https://github.com/jhasabhishek17/petpaws/blob/main/server/db.js"
click node_mongodb "https://github.com/jhasabhishek17/petpaws/blob/main/server/config/db.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_app,node_auth,node_user toneBlue
class node_market,node_detail,node_checkout,node_tracking,node_seller toneAmber
class node_vets,node_grooming,node_support toneMint
class node_api,node_authctl,node_petctl,node_orderctl,node_vetctl,node_servicectl,node_supportctl toneRose
class node_userstore,node_petstore,node_orderstore,node_vetstore,node_appointmentstore,node_groomstore,node_bookingstore,node_ticketstore,node_jsondb,node_mongodb toneIndigo
```

## Components

### Client experience

- [App shell](https://github.com/jhasabhishek17/petpaws/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Role authentication](https://github.com/jhasabhishek17/petpaws/blob/main/client/src/components/AuthModal.jsx): `client/src/components/AuthModal.jsx`

### Marketplace and orders

- [Pet marketplace](https://github.com/jhasabhishek17/petpaws/blob/main/client/src/components/Marketplace.jsx): `client/src/components/Marketplace.jsx`
- [Pet details](https://github.com/jhasabhishek17/petpaws/blob/main/client/src/components/PetDetailModal.jsx): `client/src/components/PetDetailModal.jsx`
- [Checkout and payment](https://github.com/jhasabhishek17/petpaws/blob/main/client/src/components/CheckoutModal.jsx): `client/src/components/CheckoutModal.jsx`
- [Order tracking](https://github.com/jhasabhishek17/petpaws/blob/main/client/src/components/OrdersTracking.jsx): `client/src/components/OrdersTracking.jsx`
- [Seller portal](https://github.com/jhasabhishek17/petpaws/blob/main/client/src/components/SellerDashboard.jsx): `client/src/components/SellerDashboard.jsx`

### Care and support

- [Vet consultations](https://github.com/jhasabhishek17/petpaws/blob/main/client/src/components/VetSection.jsx): `client/src/components/VetSection.jsx`
- [Grooming and training](https://github.com/jhasabhishek17/petpaws/blob/main/client/src/components/GroomingCareSection.jsx): `client/src/components/GroomingCareSection.jsx`
- [Customer support](https://github.com/jhasabhishek17/petpaws/blob/main/client/src/components/CustomerSupport.jsx): `client/src/components/CustomerSupport.jsx`

### API capabilities

- [REST API](https://github.com/jhasabhishek17/petpaws/blob/main/server/server.js): `server/server.js`
- [Authentication](https://github.com/jhasabhishek17/petpaws/blob/main/server/controllers/authController.js): `server/controllers/authController.js`
- [Pet listings](https://github.com/jhasabhishek17/petpaws/blob/main/server/controllers/petController.js): `server/controllers/petController.js`
- [Orders and tracking](https://github.com/jhasabhishek17/petpaws/blob/main/server/controllers/orderController.js): `server/controllers/orderController.js`
- [Vet scheduling](https://github.com/jhasabhishek17/petpaws/blob/main/server/controllers/vetController.js): `server/controllers/vetController.js`
- [Care services](https://github.com/jhasabhishek17/petpaws/blob/main/server/controllers/serviceController.js): `server/controllers/serviceController.js`
- [Support tickets](https://github.com/jhasabhishek17/petpaws/blob/main/server/controllers/supportController.js): `server/controllers/supportController.js`

### Persistence

- [User records](https://github.com/jhasabhishek17/petpaws/blob/main/server/models/User.js): `server/models/User.js`
- [Pet records](https://github.com/jhasabhishek17/petpaws/blob/main/server/models/Pet.js): `server/models/Pet.js`
- [Order records](https://github.com/jhasabhishek17/petpaws/blob/main/server/models/Order.js): `server/models/Order.js`
- [Vet records](https://github.com/jhasabhishek17/petpaws/blob/main/server/models/VetProfile.js): `server/models/VetProfile.js`
- [Appointment records](https://github.com/jhasabhishek17/petpaws/blob/main/server/models/VetAppointment.js): `server/models/VetAppointment.js`
- [Grooming records](https://github.com/jhasabhishek17/petpaws/blob/main/server/models/GroomingService.js): `server/models/GroomingService.js`
- [Booking records](https://github.com/jhasabhishek17/petpaws/blob/main/server/models/GroomingBooking.js): `server/models/GroomingBooking.js`
- [Ticket records](https://github.com/jhasabhishek17/petpaws/blob/main/server/models/SupportTicket.js): `server/models/SupportTicket.js`
- [JSON persistence](https://github.com/jhasabhishek17/petpaws/blob/main/server/db.js): `server/db.js`
- [MongoDB connection](https://github.com/jhasabhishek17/petpaws/blob/main/server/config/db.js): `server/config/db.js`

### Other components

- **PetPaws user**

## Connections

- PetPaws user → App shell: uses (evidence: `README.md`)
- App shell → Role authentication: opens (evidence: `client/src/App.jsx`)
- App shell → Pet marketplace: renders (evidence: `client/src/App.jsx`)
- App shell → Pet details: renders (evidence: `client/src/App.jsx`)
- App shell → Checkout and payment: renders (evidence: `client/src/App.jsx`)
- App shell → Order tracking: renders (evidence: `client/src/App.jsx`)
- App shell → Seller portal: renders (evidence: `client/src/App.jsx`)
- App shell → Vet consultations: renders (evidence: `client/src/App.jsx`)
- App shell → Grooming and training: renders (evidence: `client/src/App.jsx`)
- App shell → Customer support: renders (evidence: `client/src/App.jsx`)
- App shell → REST API: fetches listings (evidence: `client/src/App.jsx`)
- REST API → Authentication: routes auth (evidence: `server/server.js`)
- REST API → Pet listings: routes pets (evidence: `server/server.js`)
- REST API → Orders and tracking: routes orders (evidence: `server/server.js`)
- REST API → Vet scheduling: routes vets (evidence: `server/server.js`)
- REST API → Care services: routes services (evidence: `server/server.js`)
- REST API → Support tickets: routes support (evidence: `server/server.js`)
- Authentication → User records: reads and writes (evidence: `server/controllers/authController.js`)
- Authentication → JSON persistence: uses fallback (evidence: `server/controllers/authController.js`)
- Pet listings → Pet records: reads and writes (evidence: `server/controllers/petController.js`)
- Pet listings → JSON persistence: uses fallback (evidence: `server/controllers/petController.js`)
- Orders and tracking → Order records: reads and writes (evidence: `server/controllers/orderController.js`)
- Orders and tracking → Pet records: updates stock (evidence: `server/controllers/orderController.js`)
- Orders and tracking → JSON persistence: uses fallback (evidence: `server/controllers/orderController.js`)
- Vet scheduling → Vet records: reads and writes (evidence: `server/controllers/vetController.js`)
- Vet scheduling → Appointment records: reads and writes (evidence: `server/controllers/vetController.js`)
- Vet scheduling → JSON persistence: uses fallback (evidence: `server/controllers/vetController.js`)
- Care services → Grooming records: reads and writes (evidence: `server/controllers/serviceController.js`)
- Care services → Booking records: reads and writes (evidence: `server/controllers/serviceController.js`)
- Care services → JSON persistence: uses fallback (evidence: `server/controllers/serviceController.js`)
- Support tickets → Ticket records: reads and writes (evidence: `server/controllers/supportController.js`)
- Support tickets → JSON persistence: uses fallback (evidence: `server/controllers/supportController.js`)
- REST API → MongoDB connection: connects database (evidence: `server/server.js`)
