# carilloandrei9264/team-idle architecture

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

- Interactive diagram: https://gitdiagram.com/carilloandrei9264/team-idle
- Repository: https://github.com/carilloandrei9264/team-idle

## Overview

TrustHome PH is a Philippine rental marketplace combining document-reviewed listings, bookings, trust and dispute accountability, and a curated bank-property catalog. The main user journey is browsing a listing, requesting a booking, completing the booking and rating it; owners submit listings for review, while admins verify listings and handle disputes. Bank-property data is maintained separately by a scraper and surfaced in the catalog. README documentation establishes several capabilities whose page implementations were not sampled, so their internal wiring is represented conservatively.

Main entry points: [`src/App.jsx`](https://github.com/carilloandrei9264/team-idle/blob/dev/src/App.jsx) (Route application), [`bank_scraper/worker.py`](https://github.com/carilloandrei9264/team-idle/blob/dev/bank_scraper/worker.py) (Scraper worker), [`src/admin/AdminListings.jsx`](https://github.com/carilloandrei9264/team-idle/blob/dev/src/admin/AdminListings.jsx) (Listing review), [`bank_scraper/scraper.py`](https://github.com/carilloandrei9264/team-idle/blob/dev/bank_scraper/scraper.py) (Bank scraper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Marketplace web app"]
  node_app["Route application<br/>[App.jsx]"]
  node_browse["Browse listings<br/>[Browse.jsx]"]
  node_listing["Listing details<br/>[ListingDetail.jsx]"]
  node_listing_manage["Listing management"]
  node_booking["Booking workflow"]
end

subgraph group_accountability["Verification and trust"]
  node_rating["Ratings and reviews<br/>[RatingForm.jsx]"]
  node_dispute["Dispute reporting<br/>[RaiseDispute.jsx]"]
  node_admin_review["Listing review<br/>[AdminListings.jsx]"]
  node_trust["Trust scoring<br/>[trustScore.js]"]
  node_profile["Public profiles<br/>[PublicProfile.jsx]"]
end

subgraph group_bank["Bank property catalog"]
  node_bank_catalog["Bank catalog<br/>[BankCatalog.jsx]"]
  node_bank_detail["Bank property details"]
  node_loan["Loan calculator<br/>[loanCalculator.js]"]
  node_scraper["Bank scraper<br/>[scraper.py]"]
  node_scraper_db["Scraper data access<br/>[database.py]"]
  node_worker["Scraper worker<br/>[worker.py]"]
end

subgraph group_backend["Firebase services"]
  node_auth_context["Authentication context<br/>[AuthContext.jsx]"]
  node_firebase_config["Firebase client setup<br/>[firebase.js]"]
  node_firestore[("Firestore")]
  node_firebase_auth(("Firebase Authentication"))
  node_scheduled_jobs["Scheduled booking and score jobs<br/>[index.js]"]
end

node_renter(("Renter or buyer"))
node_owner(("Homeowner"))
node_admin(("Administrator"))
node_cloudinary(("Cloudinary"))
node_bank_sites(("Bank property sources"))

node_renter -->|"opens marketplace"| node_app
node_owner -->|"opens marketplace"| node_app
node_admin -->|"opens admin"| node_app
node_app -->|"routes to"| node_browse
node_app -->|"routes to"| node_listing
node_app -->|"routes to"| node_listing_manage
node_app -->|"routes to"| node_booking
node_app -->|"routes to"| node_rating
node_app -->|"routes to"| node_dispute
node_app -->|"routes to"| node_bank_catalog
node_app -->|"routes to"| node_bank_detail
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_admin_review
node_browse -->|"reads listings"| node_firestore
node_booking -->|"manages bookings"| node_firestore
node_rating -->|"stores ratings"| node_firestore
node_dispute -->|"stores disputes"| node_firestore
node_admin_review -->|"updates review status"| node_firestore
node_admin_review -->|"writes notifications"| node_firestore
node_auth_context -->|"observes auth state"| node_firebase_auth
node_auth_context -->|"subscribes to profile"| node_firestore
node_firebase_config -->|"configures client"| node_firestore
node_firebase_config -->|"configures client"| node_firebase_auth
node_listing_manage -.->|"uploads documents"| node_cloudinary
node_bank_catalog -->|"reads catalog"| node_firestore
node_bank_detail -->|"calculates financing"| node_loan
node_bank_sites -.->|"provides listings"| node_scraper
node_scraper -->|"upserts properties"| node_scraper_db
node_scraper_db -->|"writes bank properties"| node_firestore
node_worker -->|"loads queued jobs"| node_scraper_db
node_worker -->|"runs bank scrapes"| node_scraper
node_worker -->|"recomputes scores"| node_trust
node_trust -->|"stores trust scores"| node_firestore
node_scheduled_jobs -.->|"updates expired bookings"| node_firestore
node_scheduled_jobs -.->|"recomputes trust scores"| node_firestore

click node_app "https://github.com/carilloandrei9264/team-idle/blob/dev/src/App.jsx"
click node_browse "https://github.com/carilloandrei9264/team-idle/blob/dev/src/pages/Browse.jsx"
click node_listing "https://github.com/carilloandrei9264/team-idle/blob/dev/src/pages/ListingDetail.jsx"
click node_listing_manage "https://github.com/carilloandrei9264/team-idle/tree/dev/src/pages"
click node_booking "https://github.com/carilloandrei9264/team-idle/tree/dev/src/pages"
click node_rating "https://github.com/carilloandrei9264/team-idle/blob/dev/src/pages/RatingForm.jsx"
click node_dispute "https://github.com/carilloandrei9264/team-idle/blob/dev/src/pages/RaiseDispute.jsx"
click node_admin_review "https://github.com/carilloandrei9264/team-idle/blob/dev/src/admin/AdminListings.jsx"
click node_trust "https://github.com/carilloandrei9264/team-idle/blob/dev/src/lib/trustScore.js"
click node_profile "https://github.com/carilloandrei9264/team-idle/blob/dev/src/pages/PublicProfile.jsx"
click node_bank_catalog "https://github.com/carilloandrei9264/team-idle/blob/dev/src/pages/BankCatalog.jsx"
click node_bank_detail "https://github.com/carilloandrei9264/team-idle/blob/dev/src/pages/BankPropertyDetail.jsx"
click node_loan "https://github.com/carilloandrei9264/team-idle/blob/dev/src/lib/loanCalculator.js"
click node_scraper "https://github.com/carilloandrei9264/team-idle/blob/dev/bank_scraper/scraper.py"
click node_scraper_db "https://github.com/carilloandrei9264/team-idle/blob/dev/bank_scraper/database.py"
click node_worker "https://github.com/carilloandrei9264/team-idle/blob/dev/bank_scraper/worker.py"
click node_auth_context "https://github.com/carilloandrei9264/team-idle/blob/dev/src/context/AuthContext.jsx"
click node_firebase_config "https://github.com/carilloandrei9264/team-idle/blob/dev/src/firebase.js"
click node_scheduled_jobs "https://github.com/carilloandrei9264/team-idle/blob/dev/functions/index.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_browse,node_listing,node_listing_manage,node_booking toneBlue
class node_rating,node_dispute,node_admin_review,node_trust,node_profile toneAmber
class node_bank_catalog,node_bank_detail,node_loan,node_scraper,node_scraper_db,node_worker toneMint
class node_auth_context,node_firebase_config,node_firestore,node_firebase_auth,node_scheduled_jobs toneRose
class node_renter,node_owner,node_admin,node_cloudinary,node_bank_sites toneIndigo
```

## Components

### Marketplace web app

- [Route application](https://github.com/carilloandrei9264/team-idle/blob/dev/src/App.jsx): `src/App.jsx`
- [Browse listings](https://github.com/carilloandrei9264/team-idle/blob/dev/src/pages/Browse.jsx): `src/pages/Browse.jsx`
- [Listing details](https://github.com/carilloandrei9264/team-idle/blob/dev/src/pages/ListingDetail.jsx): `src/pages/ListingDetail.jsx`
- [Listing management](https://github.com/carilloandrei9264/team-idle/tree/dev/src/pages): `src/pages`
- [Booking workflow](https://github.com/carilloandrei9264/team-idle/tree/dev/src/pages): `src/pages`

### Verification and trust

- [Ratings and reviews](https://github.com/carilloandrei9264/team-idle/blob/dev/src/pages/RatingForm.jsx): `src/pages/RatingForm.jsx`
- [Dispute reporting](https://github.com/carilloandrei9264/team-idle/blob/dev/src/pages/RaiseDispute.jsx): `src/pages/RaiseDispute.jsx`
- [Listing review](https://github.com/carilloandrei9264/team-idle/blob/dev/src/admin/AdminListings.jsx): `src/admin/AdminListings.jsx`
- [Trust scoring](https://github.com/carilloandrei9264/team-idle/blob/dev/src/lib/trustScore.js): `src/lib/trustScore.js`
- [Public profiles](https://github.com/carilloandrei9264/team-idle/blob/dev/src/pages/PublicProfile.jsx): `src/pages/PublicProfile.jsx`

### Bank property catalog

- [Bank catalog](https://github.com/carilloandrei9264/team-idle/blob/dev/src/pages/BankCatalog.jsx): `src/pages/BankCatalog.jsx`
- [Bank property details](https://github.com/carilloandrei9264/team-idle/blob/dev/src/pages/BankPropertyDetail.jsx): `src/pages/BankPropertyDetail.jsx`
- [Loan calculator](https://github.com/carilloandrei9264/team-idle/blob/dev/src/lib/loanCalculator.js): `src/lib/loanCalculator.js`
- [Bank scraper](https://github.com/carilloandrei9264/team-idle/blob/dev/bank_scraper/scraper.py): `bank_scraper/scraper.py`
- [Scraper data access](https://github.com/carilloandrei9264/team-idle/blob/dev/bank_scraper/database.py): `bank_scraper/database.py`
- [Scraper worker](https://github.com/carilloandrei9264/team-idle/blob/dev/bank_scraper/worker.py): `bank_scraper/worker.py`

### Firebase services

- [Authentication context](https://github.com/carilloandrei9264/team-idle/blob/dev/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Firebase client setup](https://github.com/carilloandrei9264/team-idle/blob/dev/src/firebase.js): `src/firebase.js`
- **Firestore**
- **Firebase Authentication**
- [Scheduled booking and score jobs](https://github.com/carilloandrei9264/team-idle/blob/dev/functions/index.js): `functions/index.js`

### Other components

- **Renter or buyer**
- **Homeowner**
- **Administrator**
- **Cloudinary**
- **Bank property sources**

## Connections

- Renter or buyer → Route application: opens marketplace
- Homeowner → Route application: opens marketplace
- Administrator → Route application: opens admin
- Route application → Browse listings: routes to
- Route application → Listing details: routes to
- Route application → Listing management: routes to
- Route application → Booking workflow: routes to
- Route application → Ratings and reviews: routes to
- Route application → Dispute reporting: routes to
- Route application → Bank catalog: routes to
- Route application → Bank property details: routes to
- Route application → Public profiles: routes to
- Route application → Listing review: routes to
- Browse listings → Firestore: reads listings
- Booking workflow → Firestore: manages bookings
- Ratings and reviews → Firestore: stores ratings
- Dispute reporting → Firestore: stores disputes
- Listing review → Firestore: updates review status
- Listing review → Firestore: writes notifications
- Authentication context → Firebase Authentication: observes auth state
- Authentication context → Firestore: subscribes to profile
- Firebase client setup → Firestore: configures client
- Firebase client setup → Firebase Authentication: configures client
- Listing management → Cloudinary: uploads documents
- Bank catalog → Firestore: reads catalog
- Bank property details → Loan calculator: calculates financing
- Bank property sources → Bank scraper: provides listings
- Bank scraper → Scraper data access: upserts properties
- Scraper data access → Firestore: writes bank properties
- Scraper worker → Scraper data access: loads queued jobs
- Scraper worker → Bank scraper: runs bank scrapes
- Scraper worker → Trust scoring: recomputes scores
- Trust scoring → Firestore: stores trust scores
- Scheduled booking and score jobs → Firestore: updates expired bookings
- Scheduled booking and score jobs → Firestore: recomputes trust scores
