Skip to content

artemadams/AtlasSearchStore

 
 

Repository files navigation

MongoStore Sample Application

MongoStore Hackathon

Hello! 👋 This e-commerce application allows you to search lightning fast through a wide variety of data types through a dataset of Amazon products.



MongoStore 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.

No additional servers or software needed. No need to keep data in sync. Everything is done in MongoDB Atlas.

Current features implemented in this e-commerce application include:

  • authentication and authorization
  • fuzzy matching
  • highlighting
  • autocomplete
  • relevance-based scoring
  • custom function scoring

Future Atlas Search features to implement can include:

  • range queries
  • facets
  • synonyms

This application was created using:

  • React
  • Tailwind CSS
  • MongoDB Realm for backend HTTPs endpoints and webhooks
  • A sample dataset of Amazon products

API Points of Integration

This application is hosted entirely on Realm and calls 2 API endpoints:
  • getProductsEndpoint in the Home.js page on line 24
  • Suggestions_AC_Endpoint, used for autocompleted product names, in the Header.js component on line 17.

Prerequisites

  • A MongoDB Atlas account. Get one for free here.
  • A recent version of Node.js and npm.
  • Amazon product sample dataset
  • (Recommended) MongoDB Compass - GUI

Instructions

In the project directory, you can run:

npm install

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.

Authentication and Authorization

Steps to reproduce the funcationality with Atlas App Services:

Activate email password authentication provider

1

Activate custom user data

2

Define the interceptor function condition

9

Create custom data interceptor function

5

Verify custom user data in the collection

4

Use Application Authentication for Functions modifying the collection data

6

Setup Rules for Functions modifying the collection data

8 7

GraphQL and MongoDB Atlas Search

Trigger Search queries with GraphQL:

Create a custom GraphQL resolver

1

Setup input and return types for GraphQL

1

Create a custom function for the GraphQL resolver

1

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 96.6%
  • HTML 2.7%
  • CSS 0.7%