https://github.com/mongodb-developer/atlas-search-soccer
https://github.com/mongodb-developer/atlas-search-soccer
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mongodb-developer/atlas-search-soccer
- Owner: mongodb-developer
- License: apache-2.0
- Archived: true
- Created: 2022-06-09T09:24:20.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-18T15:30:18.000Z (over 1 year ago)
- Last Synced: 2025-03-02T01:14:16.651Z (10 months ago)
- Language: JavaScript
- Size: 20.1 MB
- Stars: 16
- Watchers: 10
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Notice: Repository Deprecation
This repository is deprecated and no longer actively maintained. It contains outdated code examples or practices that do not align with current MongoDB best practices. While the repository remains accessible for reference purposes, we strongly discourage its use in production environments.
Users should be aware that this repository will not receive any further updates, bug fixes, or security patches. This code may expose you to security vulnerabilities, compatibility issues with current MongoDB versions, and potential performance problems. Any implementation based on this repository is at the user's own risk.
For up-to-date resources, please refer to the [MongoDB Developer Center](https://mongodb.com/developer).
Atlas Search Soccer
Build your Soccer Dream Team with MongoDB Atlas Search
Every four years, for the sake of blending in, I pretend to know soccer. When the World Cup is on, I’m overwhelmed by the exuberant fans with colorful soccer jerseys. Jerseys with unfamiliar names from far away places. I recognize Messi and Ronaldo, but the others …? Mkhitaryan, Szczęsny, Großkreutz? How can I look up their stats to feign familiarity when I have no idea how to spell their names?
Well, now there's this app for that. Atlas Search Soccer is an interactive Atlas Search tutorial and instant sports bar credibility builder.
Teaming up MongoDB Atlas Search with an extensive player dataset, you can scout across the over 22,000 players in the database based on a variety of search parameters and data types:
- player name
- player position
- nationality
- club
- skill level
- age
- salary
Equipped with only a search box, sliders and checkboxes, find the world's best players with the most impossible-to-spell names to build out your own Soccer Dream Team. Autocomplete, wildcard, and filters to find Ibrahimović, Błaszczykowski, and Szczęsny? No problem!
As you interact with the application, you'll see the `$search` operator in a MongoDB aggregation pipeline live in-action!
When you pick a footballer for your team, he is written to local storage on your device. That way, your Dream Team stays warmed up and on the pitch even after you close your browser.
Skills and Drills
- search operators:
- text
- wildcard
- autocomplete
- range
- fuzzy matching
- indexes and analyzers
- compound operator
- relevance based scoring
- custom score modifiers
- filters, facets and counts
So give it a shot, and you'll be an Atlas Search pro in no time!
www.atlassearchsoccer.com ⚽
Game Notes 📝
This application hosted entirely by MongoDB Atlas was created using:
- React
- Tailwind CSS
- Atlas App Services for backend HTTPs endpoints and webhooks
- A [FIFA22 player dataset](https://www.kaggle.com/datasets/bryanb/fifa-player-stats-database)
Currently this app is not suitable for mobile, but feel free to send a PR. 😊
Want to play in your own stadium? Here's how to build Atlas Search Soccer on your own free cluster.
Atlas Search Soccer runs on a very streamlined game plan where MongoDB Atlas is the MVP.
**No additional servers or software needed. No need to keep data in sync. Everything is done in MongoDB Atlas.**
Prerequisites
- A MongoDB Atlas account. Get one for free here.
- A recent version of Node.js and npm.
- Extensive worldwide player dataset (players22.json) provided in the data folder.
- (Recommended) MongoDB Compass - GUI
It is also included in this repo's data folder as
players22.json
---
To Run This Application....
1. Clone the repo.
2. Navigate inside `atlas-search-soccer` directory.
3. Run npm install .
4. Run npm start .
---
Prepare Data
Load data to Atlas cluster:
- database:
soccer - collection:
players22
React Components....

Using Atlas App Services as Your Serverless Backend....
AtlasSearchSoccer uses HTTP services in App Services to create 5 APIs to allow you to query for your player data over HTTP:
The data is queried from `useHomeFetch.js` in the `hooks` directory.
Here you'll find the endpoints for the backend search queries using the `$search` operator:
- `BasicSearchEndPoint`
- `WildcardEndPoint`
- `AutocompleteEndpoint`
- `AdvancedSearchEndPoint`
- `FacetsEndPoint`
Find the code for these webhooks in the AppServices folder.
If you have any questions or feedback about this repo, feel free to create an Issue or PR in this repo or reach out to me on Twitter @YouOldMaid.
Also please join our online MongoDB Community to interact with our product and engineering teams along with thousands of other MongoDB and Realm users.
Have fun and happy coding!
## Disclaimer
Use at your own risk; not a supported MongoDB product