Skip to main content

Listings, Reviews, And Favorites

Quick Answer

Listing features live in src/core/listing, reviews live in src/core/review, and saved-item state lives in src/core/favorites. These modules power real estate, marketplace, directory, vendor, appointment, and saved-item flows.

Use this page when working with item lists, category filters, saved listings, item detail screens, listing creation, approval workflows, or review submission.

Source Map

src/core/listing
|-- api/firebase
|-- api/local
`-- api/index.js

src/core/review
|-- api/firebase
|-- components/IMAddReviewModal
|-- hooks
`-- ui/IMVendorReviewScreen

src/core/favorites
`-- redux

Listing API Responsibilities

The Firebase listing API includes operations such as:

  • subscribe to listing categories;
  • subscribe to listings by user or category;
  • fetch a single listing;
  • save or unsave a listing;
  • add a listing;
  • edit a listing;
  • delete a listing;
  • filter listings;
  • read/write listing reviews when the app uses listing-specific reviews.

Collection names are app-specific. Check the app config before assuming the collection is called listings.

Favorites

Favorites are often represented as a per-user saved-item collection. The UI usually keeps an in-memory map of saved IDs for fast rendering.

Before release:

  • prevent users from writing favorites for another user;
  • avoid duplicate favorite records for the same item/user pair;
  • make the unsave flow idempotent;
  • verify favorites still work after app restart.

Reviews

Reviews may be tied to listings, vendors, products, bookings, or users depending on the app. Keep the review schema explicit:

  • reviewed object ID;
  • author ID;
  • rating;
  • comment;
  • created timestamp;
  • moderation status if reviews are public.

Reviews are user-generated content. Consider report/block moderation and profanity/spam handling for public review surfaces.

Verification Checklist

Test:

  • category list loads;
  • listing list loads;
  • empty state appears;
  • list filters work;
  • listing detail opens;
  • create listing if enabled;
  • edit/delete listing if enabled;
  • save/unsave listing;
  • review submit;
  • unauthorized writes are rejected by rules;
  • required Firestore indexes exist.

Troubleshooting

ProblemFix
Listing list is emptyCheck collection name, isApproved filters, category ID, and Firestore rules.
Favorites flicker or resetVerify the saved-item subscription and Redux state are hydrated before rendering.
User can edit another user's listingTighten rules around authorID and backend validation.
Reviews do not appearCheck object ID, collection name, ordering, and moderation filters.
Query requires an indexCreate the Firestore composite index suggested by Firebase.