TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/jacobsamo/buzztrip/llms.txt
Use this file to discover all available pages before exploring further.
places table is the canonical store for enriched location data in BuzzTrip. Every marker on a map links to a place record, which holds the coordinates, address, provider IDs, photos, ratings, and POI type information sourced from Google Maps, Mapbox, or Foursquare. Places are shared across maps — if two markers point to the same physical location, they reference the same place document.
How Places Work
When a marker is created, BuzzTrip checks whether a place already exists at the target coordinates using theby_place_lat_lng compound index. If a matching place is found, the new marker links to it directly. If no match exists, a new place record is created first.
On creation, two things happen automatically:
- Plus code generation — An Open Location Code is computed from the
lat/lngvalues using theopen-location-code-typescriptlibrary and stored inplus_code. - Geospatial indexing — The place is inserted into BuzzTrip’s
geospatialConvex component with its coordinates and metadata (placeTypes,plusCode,what3words), enabling efficient radius and bounding-box queries.
Plus codes are generated automatically — you do not need to provide them when creating a place. If the library fails to encode the coordinates (e.g., for out-of-range values),
plus_code will be undefined and the error is logged but does not prevent the place from being created.Place Schema
Human-readable name for the place (e.g. “Eiffel Tower”, “Blue Bottle Coffee”).
Latitude in decimal degrees.
Longitude in decimal degrees.
Bounding box for the place. Can be either a full
{ east, north, south, west } object or a simple { lat, lng } point.An icon identifier derived from the primary POI type. Used to render the marker pin on the map.
Aggregate rating (e.g. from Google Maps or Foursquare). Defaults to
0 if no rating is available.Optional freeform description of the place.
Formatted street address.
Google Maps place ID (e.g.
ChIJ...). Used to cross-reference data with the Google Maps Places API.Mapbox place ID. Used to cross-reference data with the Mapbox Geocoding API.
Foursquare place ID. Used to cross-reference data with the Foursquare Places API.
Open Location Code (Plus Code) auto-generated from
lat/lng. Example: 8FW4V75V+8Q. You do not need to supply this field.what3words address for the location (e.g.
filled.count.soap). Stored when available; not auto-generated.Array of photo URL strings, or
null/undefined if none are available. Initially populated from the provider (Google Maps, Foursquare). Additional user-submitted photos are stored separately in the place_photos table.Array of POI type tags (e.g.
['restaurant', 'food', 'point_of_interest']). Sourced from the map provider and used to derive the icon field.Official website URL for the place.
Phone number for the place.
Place Deduplication
Places are deduplicated using theby_place_lat_lng compound index on (lat, lng). Before inserting a new place, BuzzTrip queries this index to check for an exact coordinate match. If one is found, the existing place ID is used for the new marker.
This means a single place record can accumulate provider IDs over time — for example, a place first added via Google Maps might later have its mb_place_id or fq_place_id filled in when the same location is looked up via Mapbox or Foursquare.
Multiple Provider IDs
A single place document can hold IDs from all three supported map providers simultaneously:| Field | Provider |
|---|---|
gm_place_id | Google Maps Places API |
mb_place_id | Mapbox Geocoding API |
fq_place_id | Foursquare Places API |
createPlace (Internal Helper)
createPlace is an internal async helper function (not a public Convex mutation) called during marker creation. It handles the full place insertion flow:
- Generates a plus code from
lat/lngusingOpenLocationCode.encode() - Inserts the place document into the
placestable viactx.db.insert() - Registers the place in the geospatial index via
geospatial.insert()with:- Coordinates:
{ latitude, longitude } - Metadata:
{ placeTypes, plusCode, what3words }
- Coordinates:
Reviews and Photos
User-submitted content is stored in two separate tables linked to places byplace_id:
places_reviews
Stores user reviews for a place. Each review includes
author_name, author_url, profile_photo_url, rating, and a description. Linked to both places (via place_id) and users (via user_id).place_photos
Stores user-submitted photos for a place. Each photo record includes
photo_url, width, height, and a caption. Linked to both places (via place_id) and users (via user_id).places_reviews Schema
Reference to the parent place document.
Reference to the user who submitted the review.
Display name of the reviewer.
Link to the author’s profile (may be
null).URL of the reviewer’s avatar.
Numeric rating, or
null if not provided.Review body text.
place_photos Schema
Reference to the parent place document.
Reference to the user who submitted the photo.
URL of the uploaded photo.
Image width in pixels.
Image height in pixels.
Text caption for the photo.