## Notes
The data in [[Restaurant Swipe Overview|Restaurant Swipe]] is obviously very important. At the time of writing, the MVP would consist of the following categories of data:
- User data
- Restaurant data
- Location data
- Profitability data
- Usage data
## User Data
I feel like User Data is pretty straightforward.
The only part not straightforward is friends and adding users. I think I would want to hide people from other people unless they are in a group
## Restaurant Data
Acquiring restaurant data is going to pose a fun problem to solve. The problem is that I'm starting from zero, and I need to provide restaurant data to users. Basically I'll be a restaurant data broker. I have several API options that I can use, but it looks like the [Uber Eats Scraper API - RapidAPI](https://rapidapi.com/border-line-border-line-default/api/uber-eats-scraper-api/pricing) will return all of the data that I need. For the MVP I am looking for the following minimum data:
- Restaurant name
- Address
- Categories
- Price
- Image
- Hours
### Uber Eats Scraper API
There are 4 plans:
- Free: 25 requests per month
- $25: 4.000 requests per month
- 1 request costs 0.625 cents
- $50: 10.000 requests per month
- 1 request costs 0.5 cents
- $130: 30.000 requests per month
- 1 request costs 0.433 cents
Additional detail at [[Uber Eats Scraper API]].
#### Architecture
If used together with *Restaurant Swipe*, I would probably send out the request to UES as soon as a game is created. The request parameters for UES is not as comprehensive as I would hope, so I would need to provide additional filtering based on the restrictions the end user provides.
I also want to store the UES request and response and add them to my own database.
Before sending a request to UES, I want to query my own geospatial database for restaurants already stored, or at least see if the query overlaps significantly with existing data.
I would also like to test how much data I can return from the UES in one query.
##### Structure
###### Restaurant Match Service
1. Front-end requests the matching to start with the user's provided request parameters
2. Store request parameters
3. Check existing DB for results if there is an *n%* similarity
1. If there isn't enough of a similarity
1. Request data from [[#UES Service]]
2. From UES data, apply filter criteria
3. Store filtered data and create relationship with match parameters
4. Return first restaurant
2. Else fetch existing data and set it back to the user
###### UES Service
1. Store UES request parameters and create a record for query metadata
2. Get results from UES and store metadata; also store actual results
3. Return data to Restaurant Match Service
### The Fork The Spoon
- Free: 500 requests per month, 5 requests per second
- $20: 10.000 requests per month, 5 requests per second
- 1 request costs 0.2 cents
- $50: 30.000 requests per month, 5 requests per second
- 1 request costs 0.1666 cents
- $300: unlimited, 5 requests per second
Doesn't seem to work
### Worldwide Restaurants on Zyla
[Worldwide Restaurants API - Zyla](https://zylalabs.com/api-marketplace/data/worldwide+restaurants+api/757)
### Yelp API
- $229: 5,000 requests per month (no photos)
- $5.91 per additional 1,000 API calls
- $299: 5,000 requests per month (limit 3 photos)
- $6.57 per additional 1,000 API calls
- $643: 5,000 requests per month
- $14.13 per additional 1,000 API calls
### Supabase Functions
Externally the mobile app would need APIs to do the following:
- Start restaurant swipe game
- Retrieve restaurant
- Register swipe for restaurant
Internally the API would need to do the following:
- Get list of restaurants when requested
- See if it exists in the database, otherwise get from Uber Eats
- If retrieved from Uber Eats, save the resulting restaurant data
- Figure out the next restaurant to show for a given match game
- Figure out if consensus has been reached and display the agreed upon restaurant
## Profitability Data
Profit can be calculated by the following:
Ad Revenue - Expenses = Profit
where
- Ad Revenue is the money earned from displaying ads
- Expenses are everything that the business pays for in order to keep the app running