WhatsCooking
Restaurant Finder application for NYC demonstrating Atlas Search Features. Uses React and Tailwind.
What's Cooking implements many Atlas Search features from autocomplete to custom function scoring. Using the $search operator in a MongoDB aggregation pipeline, we can build fine-grained searches across text, numerics, and geospatial data. By building out What's Cooking, you'll learn all sorts of ways MongoDB allows you to build complex, fine-grained full-text searches on your Atlas data.
No additional servers or software needed. No need to keep data in sync. Everything is done in MongoDB Atlas.
- fuzzy matching
- highlighting
- autocomplete
- range queries
- geoqueries
- facets
- relevance-based scoring
- custom function scoring
Check out the video of the MongoDB .Live keynote to see a demonstration of all the features or visit the link below to play around with the finished application, hosted entirely in MongoDB Atlas:
www.atlassearchrestaurants.com
This application is hosted entirely by MongoDB Atlas was created using:
- React
- Tailwind CSS
- A modified sample dataset based on MongoDB's Atlas sample_restaurants dataset
Currently this app is not suitable for mobile, but feel free to send a PR. ?
Prerequisites
- A MongoDB Atlas account. Get one for free here.
- A recent version of Node.js and npm.
- Restaurant sample dataset.
- (Recommended) MongoDB Compass - GUI
You can read and download the dataset using the MongoDB Shell, any MongoDB driver, or my favorite MongoDB Compass using the following URI:
mongodb+srv://mongodb:[email protected]/whatscooking
It is also included in this repo's Supplemental Files branch as
whatscooking.json
To Run This Application....
- Clone the repo.
- Navigate inside
WhatsCooking
directory. - Run
npm install
. - Run
npm start
.
To Build This Application...
Prepare Data
- Load data to Atlas cluster:
- database:
whatscooking
- collection:
restaurants
- database:
- Create Search indexes. (Index definitions includes in `supplement-files` .)
React Components....
Using Realm as Your Serverless Backend....
What's Cooking uses HTTP services in Realm to create 2 APIs to allow you to query for your restaurant data over HTTP:
getRestaurants
called from theuseHomeFetch.js
hook.getRestaurantsAutocomplete
called from theAutosuggestions.js
component.
Find the Realm application and code for these webhooks in the supplement-files
branch in a folder called WhatsCookingRealm