## Use Case
There's been a huge problem with using all the ingredients you have in your kitchen. There's a high startup cost to writing out everything you have, and then using your memory and creativity to come up with a palatable recipe. On top of that, if you live with someone else, you'll have to cater to their tastes and wishes on top of your own!
## Solution
### Image-based Solution
1. #optional Take pictures of pantries and refrigerators to capture all ingredients and equipment
2. #optional Use pictures to identify everything that the user has available
3. Use given ingredients and equipment to come up with recipes that the person will like
4. Optionally also have info on their preferences
5. Keep track of history to also include diversity
### Work Goals
#### Create Sign-in Capabilities Locally
#### Create Sign-in Page
- [ ] New user sign up
- [ ] Supabase auth
- [ ] Face ID
- [ ] Email & password
- [ ] For mobile native (iOS and Android)
- [ ] Face ID
- [ ] Email confirmation
- [ ] Test email service locally
##### Examples
![[bofa-login.png]]
![[discover-login.png]]
##### Handle Password
- [ ] Use POST request
- [ ] Use HTTPS
Reference: [StackOverflow](https://stackoverflow.com/a/7562744)
I don't need to unit test/integration test this because [[Supabase]] already guarantees it, technically.
#### Create Account Table
#### Create Ability to save Kitchen Ingredients in account
- [ ] Typing them in
- [ ] Tapping on ingredients from a list
#### Ability to Chat with a Bot Locally
#### CRUD Conversations
#### CRUD Recipes
- [ ] Create
- [ ] Load
- [ ] Update
- [ ] Delete
#### Apple ID Auth
- [ ] Face ID (probably the last thing I do since it costs money)
## Sous Chef Chatbot
*Sous Chef Chatbot* is like [What The Fuck Should I Make For Dinner](https://whatthefuckshouldimakefordinner.com/), but like a superset of it and more tailored to what you have in your kitchen. Basically it's an AI assistant that you can teach to help you in the kitchen. It'll need knowledge of your kitchen, ingredients, equipment, and then it'll conversationally help users come up with and tweak recipes. You could ask the chatbot to make the recipe easier or accommodate for dietary restrictions. It's really up to the users to ask it to make modifications and see what the results are.
### Business Model
- Subscription would be best
- Freemium with ads
#### Dynamic Ad Display Timing
Omg with this idea I can dynamically get the app to pay for itself.
- Figure out how much money I get for an ad
- Write a function that times/estimates when to show an ad based on the usage, per person
- (opinion) I’d love to bill per person, per use, but I’ll have to mask it or something
- (Opinion) on release day or having limited number of users, use the user’s usage rates to
### Tech Model
- [[#Design 1 - Pinecone Llama 2 and System Prompts]]
## Design 1 - Pinecone Llama 2 and System Prompts
[Learn Llama 2 - Pinecone.io](https://www.pinecone.io/learn/llama-2/)
```text
transformers==4.31.0
accelerate==0.21.0
einops==0.6.1
langchain==0.0.240
xformers==0.0.20
bitsandbytes==0.41.0
```
## Design 2 - Ollama, UI, and Hub
Use the existing [docker compose - Ollama WebUI GitHub](https://github.com/ollama-webui/ollama-webui#using-docker-compose) to spin up both the backend and UI.
The existing *Modelfiles* are really interesting too!
## Design 3 - [[Supabase]] + [[LangChain]] + [[Quasar]]
I'm not really sure if or how this will work, but I want to create a conversational agent to help me come up with recipes.
### Resources
- [Local AI Stack - GitHub](https://github.com/ykhli/local-ai-stack)
- [[Supabase]] + [[Ollama]]/[[LangChain]] + [[NextJS]] = browser-based chatbot
- No auth
- [User Management in Vue 3 - Supabase](https://supabase.com/docs/guides/getting-started/tutorials/with-vue-3)
- [[VueJS]] app that uses [[Supabase]] auth functions
- Provides example for email sign-in (no email/pass or username/pass)
- `<q-page>` needs to be a child of `<q-layout>`
### Work Log
#### [[2024-01-23]]
- Refactor [Conversation.vue](https://github.com/WongSaang/chatgpt-ui/blob/main/components/Conversation.vue) to use my storage and handle any errors
#### [[2024-01-22]]
- Figure out how global auth guard and global [[Pinia]] storage will work
- [GitHub Discussion](https://github.com/quasarframework/quasar/discussions/15468)
#### [[2024-01-21]]
- Try to sign in with the created user
- Still need to understand [[Pinia]] to use defined *action*
- Got an error in the simulator but they're truncated--need to get a better log output
- Read logs
- Invalid email
- Idk what's happening
- The simulator content is like scrolling down slightly?
- The logs in XCode aren't really that helpful
- There are a lot
- `[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID`
- `[RTIInputSystemClient remoteTextInputSessionWithID:textSuggestionsChanged:] Can only set suggestions for an active session. sessionID = 147AC39E-0CF7-470A-8E3B-D2C834E983C4`
- Wow, it's a really old [StackOverflow](https://stackoverflow.com/questions/11664115/unable-to-simultaneously-satisfy-constraints-will-attempt-to-recover-by-breakin) thing
```text
"<NSLayoutConstraint:0x600002165ef0 'accessoryView.bottom' _UIRemoteKeyboardPlaceholderView:0x101f748c0.bottom == _UIKBCompatInputView:0x104106490.top (active)>"
"<NSLayoutConstraint:0x6000021683c0 'assistantHeight' SystemInputAssistantView.height == 45 (active, names: SystemInputAssistantView:0x101f0a650 )>"
"<NSLayoutConstraint:0x60000214bc00 'assistantView.bottom' SystemInputAssistantView.bottom == _UIKBCompatInputView:0x104106490.top (active, names: SystemInputAssistantView:0x101f0a650 )>"
"<NSLayoutConstraint:0x600002166120 'assistantView.top' V:[_UIRemoteKeyboardPlaceholderView:0x101f748c0]-(0)-[SystemInputAssistantView] (active, names: SystemInputAssistantView:0x101f0a650 )>"
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600002166120 'assistantView.top' V:[_UIRemoteKeyboardPlaceholderView:0x101f748c0]-(0)-[SystemInputAssistantView] (active, names: SystemInputAssistantView:0x101f0a650 )>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.**
```
- Breakdown of everything
- *<NSLayoutConstraint:0x600002165ef0 accessoryView.bottom UIRemoteKeyboardPlaceholderView: 0x101f748c0.bottom == UIKBCompatInputView:0x104106490.top *active)>
- Hunch: maybe the "Sous Chef" text is too large; learn to change the styles
- Tried using [Headings - Quasar Docs](https://quasar.dev/style/typography#headings) with success! `text-h5` in JS *class* works!
- Seemed to get rid of the keyboard log problem
- Just kidding, it didn't--it still comes up when clicking to edit the `<input>`
- Clicking Sign In button doesn't work
- No logs
- Logging inside the function in the component works, but the [[Pinia]] *action* doesn't get logged/fired
- Maybe the *async* [[Pinia]] *action* needs to be *await*ed
- No change, still got the same two messages:
- `perform input operation requires a valid sessionID`
- `Can only set suggestions for an active session. sessionID = 147AC39E-0CF7-470A-8E3B-D2C834E983C4`
- Look up [User Sessions - Supabase](https://supabase.com/docs/guides/auth/sessions)
- idk, too much extra information? I just want to know how to get user sign in to work
- Redirection after signing in doesn't happen because I don't do anything with the `session` value in the `AuthPage.vue` component
- Need some kind of routing pattern for the `SignInPage`
- Vue Router Auth Guard!
- Global auth guard and global Pinia
- There's an issue with Pinia being used outside of a `setup()` component
- Some kind of issue when passing password from Vue component to backend auth service
- It's because of references in [[VueJS]] being wrapped--needed to call `password.value` to get the actual value
#### [[2024-01-20]]
- Created [[#Work Goals]] to stay aligned with the MVP and to make it easy to remember what I need to develop next
- Figure out how to use Face ID in [[Capacitor]] and [[VueJS]]/[[Quasar]]
- Found [Quasar and Capacitor - Quasar Docs](https://quasar.dev/quasar-cli-vite/developing-capacitor-apps/introduction)
- Added [[Quasar]] to the project via `quasar mode add capacitor`
- Had to configure the Capacitor App ID to match `java` style with only characters, aka `com.eloquia.souschef` and not `com.eloquia.sous-chef`
- Start project locally via `quasar dev -m capacitor -T ios`
- Failed because of `DVTErrorPresenter: Unable to load simulator devices`
- `The version of the CoreSimulator framework installed on this Mac is out-of-date and not supported by this version of Xcode`
- `CoreSimulator is out of date. Current version (885.2.0) is older than build version (944.5.0)`
- Check version of [[CoreSimulator]] and what the hell it is
- [[CoreSimulator]] is a part of [[XCode]] so I should try and update it
- Updating [[XCode]]
- Seems to have gone well
- Open project in [[XCode]]
- It's `quasar-project/src-capacitor/ios/App`
- Run `quasar dev -m capacitor -T ios`
- Opens [[XCode]]
- Tried clicking the big "play" button in [[XCode]]
- Was successful and brought up a simulated iOS 15 and the *Sous Chef* app
- Black screen in iOS simulator
- Never mind, it just had to load
- Display login screen at the very beginning
- Learn [[Quasar]] components
- Used `<q-input>`
- Start [[Supabase]] locally
- `cd ./supabase`
- `supabase init`
- It's already running?!
- Use local auth
- Already works, ish. The [Use Auth Locally - Supabase Docs](https://supabase.com/docs/guides/cli/local-development#use-auth-locally) doesn't really help
- I need to enable it on the [[XCode]] side via [Enable Sign In with Apple - Apple](https://help.apple.com/xcode/mac/11.0/#/dev50571b902)
- *Enable Sign In with Apple* is an [[XCode]] config item
- Enabled by going into [[XCode]] and choosing my `dalecc13` personal *Team*
- Still need a *client ID* and *secret*
- Add "AutoFill Credential Provider" to [[XCode]]
- My Apple Developer license/account doesn't have it enabled
- Try to access [Developers - Apple](https://developer.apple.com/account/resources/)
- My account isn't configured correctly
- Need to download an Apple app from the Apple Store
- I have to pay $98.99 (for now)
- This will be the last thing that I do
- Mask password input
- use `<q-input type="password" .../>`
- Try to sign into local app with username and password
- Need to create a [[Supabase Account]]
- Create a new project in [[Supabase]]
- Got [[Supabase]]
#### [[2024-01-10]]
- Success using
- *Supabase*
- [[Quasar]]
- [[VueJS]]
- And the [Supabase + Vue3 Auth Tutorial](https://supabase.com/docs/guides/getting-started/tutorials/with-vue-3#get-the-api-keys)!
- Next
- Use Apple auth
### Design. 3.5 - Ollama Chef Modelfile
[[Ollama]] and many [[LLM]]s nowadays allow users to maintain some kind of context with chatbots. This solves an issue where LLMs would eventually lose the idea that they're supposed to act as some kind of assistant.
## Appendix - Ingredients
- roasted seaweed
- Chili oil
- Oyster sauce
- Soy sauce
- Dark soy sauce
- Light soy sauce
- Fish sauce
- Black vinegar
- Consommé de pollo
- 된장
- instant noodles
- Rice vinegar
- Shaoxing cooking wine
- Canned carrots
- Bumblebee tuna
- canned San Marzano tomatoes
- Maple syrup
- Almonds
- Walnuts
- 고춧가루
- Jar of marinara sauce
- Cheerios
- Canned pinto beans
- Uncooked lentils
- Uncooked split peas
- Uncooked blackeyed peas
- Canned white beans
- Canned sardines
- Sesame seeds
- Uncooked rice
- Honey
- craisins
- 소면
- uncooked lasagna noodles
- Uncooked macaroni noodles
- Uncooked spaghetti
- Uncooked shell pasta
- Uncooked bowtie pasta
- Uncooked Mostaccioli pasta
- Ritz crackers
- Uncooked wild rice
- Curry cubes
- Arborio rice
- uncooked vermicelli noodles
- Extra virgin olive oil
- Uncooked sweet rice
- Fresh sage
- Fresh thyme
- Blackberry jam
- Butter
- Ranch dressing
- Hot sauce
- Pickled red onions
- Barbecue sauce
- Pickled olives
- Dijon mustard
- Grain mustard
- Pepperoncinis
- Cornichons
- Sliced jalapenos
- pesto
- Pastry dough
- Phyllo dough
- Ham
- Kimchi
- Yogurt
- Eggs
- Onion
- Cooked rice
- Grapes
- Oat milk
- Grape tomatoes
- Cucumber
- Kielbasa
- Romaine lettuce
- Vodka
- Frozen mixed vegetables
- Frozen blueberries
- Frozen bacon
- Frozen dumplings
- Vegetable oil
- white vinegar
- Cumin
- Paprika
- Cardamom
- Red pepper flakes
- Black pepper
- Salt
- garlic powder
- Onion powder
- Ground coriander
- Curry powder
- Turmeric
- Ground ginger
- Dried oregano
- Dried parsley flakes
- Tajin
- celery seed
- Vanilla extract
- Sprinkles
- Whole black peppercorn
- Fenugreek
- Bay leaves
- Tapenade
- Sesame oil
- Red wine vinegar
- Balsamic reduction
- Panko breadcrumbs
- Oats
- Peanut butter
- Canned corn
- Dried chili arbol
- Dried chili guajillo
- Canned mackerel
- Canned oysters
- 00 flour
- All purpose flour
- Maseca
- Chicken stock
- white sugar
- Brown sugar
- Cane sugar
- Baking powder
- chocolate chips
- Instant yeast
- Baking soda
- Corn starch
- Cocoa powder
- Pancake mix
- Yams
- Potatoes
- Bananas
- Apple
- Pumpkin
- Instant coffee