frontend
- ui compatibility
- translations
- fix poor contrast issues
- white screen
backend
-
百度千帆大模型
-
模型两种用处, prompt 我们设计 (含 active 的个人信息)
- 1 basic chat
- 2 条形码 -> 接口 https://www.tanshuapi.com/market/detail-77 -> 食品名称 -> USDA 数据库查询 https://fdc.nal.usda.gov/api-guide.html (https://app.swaggerhub.com/apis/fdcnal/food-data_central_api/1.0.1#/FDC/getFoodsList) -> 找到最接近的 n 结果 -> 让用户选择 -> 取出营养信息 -> 加到 ai 的 prompt
- 3 images: aws (awaiting name server propagation less tha 48 hrs) (vultr rate limited)
- food and health information (straight away)
- more information >
-
store + recover past chat conversations
-
-
password (sms verification doesnt really work)
-
存储个人信息
-
likes
-
yada's interface
-
live update articles
urgent:
- health information fill in form not disappearing after filling in
- new prompts
- remove usda, remove 3 user choices, just let chat gpt do it straight away
- the top 3 things (just do some regex for the 1. yap ... 2. yap ... 3. yap)
Based on the provided nutrient makeup information for PEANUTS and the user's health profile, here is the analysis for Mary:
**Allergen: Peanut**
* Peanut is listed as a potential allergen in the food profile.
* Mary has no reported allergy to peanuts, so there is no immediate allergen alert.
* However, it's always advisable to be cautious when consuming allergens, especially if not consumed regularly.
**Consumption: Excessive**
* No specific calorie information is provided for the peanuts.
* Based on Mary's BMI (calculated using weight and height), which falls under the healthy range, a general recommendation for calorie intake can be made.
* Peanuts are high in fat and energy, so excessive consumption could lead to increased calorie intake.
* Mary should monitor her portion sizes to ensure she doesn't exceed her recommended daily calorie intake.
**Health: Gluten Intolerance**
* Mary has reported gluten intolerance.
* Peanuts are naturally gluten-free, so they are safe for Mary to consume from a gluten intolerance perspective.
* However, Mary should always check labels for any added ingredients that may contain gluten.
No specific "Scientific" alerts apply to peanuts in general, as they are widely consumed and considered safe when eaten in moderation and without allergic reactions.
Based on the analysis, here are the three main health conditions in Category:Term format, along with detailed information:
1. **Allergen: Peanut**
* **Component Present**: Peanuts contain proteins that can trigger allergic reactions in sensitized individuals.
* **Danger**: Although Mary doesn't report a peanut allergy, unexpected reactions are possible, especially if she hasn't consumed peanuts recently.
* **Precautionary Measures**: Consume peanuts in small amounts initially to observe any potential reactions. Have anti-allergy medication on hand in case of an emergency.
2. **Consumption: Calorie Intake**
* **Component Present**: Peanuts are high in fat and energy.
* **Danger**: Excessive consumption can lead to increased calorie intake, potentially causing weight gain if not balanced with physical activity.
* **Precautionary Measures**: Portion control is key. Measure out servings and be mindful of total daily calorie intake.
3. **Health: Gluten Intolerance**
* **Component Present**: Peanuts are gluten-free.
* **Danger**: Although peanuts themselves are safe, cross-contamination with gluten-containing foods during processing or storage is possible.
* **Precautionary Measures**: Check labels for gluten-free certification. Store peanuts separately from gluten-containing foods. Be vigilant when eating out to ensure gluten-free options are truly gluten-free.
These health conditions, along with their explanations and precautionary measures, should help Mary make informed decisions when consuming peanuts.
- turn off comments
- passwords need to be hashed
- click a family member -> add family member -> fields r not cleared
- family title is not translated
- add family member -> 'sex' is not translated
- need to pair chatbot with personal information
[ ] PUBLISHING
future:
- sharing
- comments
- more descriptive chat history names
- gpt
- stream
- finetuning / training with pdfs
- local phone number logged in caching
- more scientific responses: use usda database / scientific stuff, not just llm output
- fix background for splash screen image
- add buffer / loading thingy
- do local async storage cache
- default, on the home screen, the info fill in field isnt shown
- forgot password
child_process
/Users/tarioyou/safeplate3/node_modules/detect-libc/
go to its package.json and add
"browser": {
"child_process": false
}
npx react-native start: start is not a command
sudo yarn
gem install bundler
bundler
idk:
sudo yarn
sudo pod install --allow-root
sudo bundle exec pod install --allow-root
Linker command failed with exit code 1 (use -v to see invocation)
remove -ObjC from all .xcconfig files
at least got me to launch the phone
ok and then
run
xcodebuild -workspace Safeplate.xcworkspace -configuration Debug -scheme Safeplate -destination id=10F12D25-B930-42AB-BF97-A60A8638E813 -verbose > build.log
and check the duplicate files / links
e.g.
duplicate symbol
'_OBJC_IVAR_$_GCDAsyncSocket.delegate' in:
/Users/tarioyou/Library/Developer/Xcode/DerivedData/Safeplate-ghlihzpxatlvtqdmvypppkiltnpu/Build/Products/Debug-iphonesimulator/CocoaAsyncSocket/libCocoaAsyncSocket.a[x86_64][3](GCDAsyncSocket.o)
/Users/tarioyou/Library/Developer/Xcode/DerivedData/Safeplate-ghlihzpxatlvtqdmvypppkiltnpu/Build/Products/Debug-iphonesimulator/TcpSockets/libTcpSockets.a[x86_64][2](GCDAsyncSocket.o)
Rapsssito/react-native-tcp-socket#61 (comment)
-> RCTAppDelegate::bundleURL not implemented
Command PhaseScriptExecution failed with a nonzero exit code
check the logs by double clicking this error in xcode, mine was a permisisons denied problem, so i fixed with:
sudo chown -R $(whoami) /Users/tarioyou/Safeplate
sudo chmod -R 755 /Users/tarioyou/Safeplate
lmao i wasn't even using flipper and that line was messing up the podfile, just remove the line
Unable to open base configuration reference file ...
cd ios
sudo pod install --allow-root
react native error: unknown command "start"
sudo npm install -g npm-check-updates --force
ncu -u
sudo npm install --force
roll back to previous push state (whatever's on github rn)
git fetch origin
git rest --hard origin/main
git clean -fd
viewproptypes will be removed from react native. migarte...
https://stackoverflow.com/a/73166444/13246089
main.jsbundle: No such file or directory
react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios' --assets-dest='./ios'
messed up node_modules
rm -rf node_modules/
npm install
or on windows
rmdir node_modules /s /q
messed up pods
cd ios
pod deintegrate
sudo pod install --allow-root
module install difficulties
use sudo npm i module --force
and sudo pod install --allow-root
buffer doesnt exist
add import { Buffer } from "buffer";
to the top of that file
or
var Buffer = require("buffer");
Failed to save 'file': Insufficient permissions. Select 'Retry as Sudo' to retry as superuser.
sudo chown -R username directory_name
clear npx cache
good technique to follow, always run app with: sudo npx react-native start --reset-cache
Project /Safeplate/ios/Safeplate.xcodeproj cannot be opened because it is missing its project.pbxproj file.
sudo chown -R username:staff ./*
os / fs / crypto / http / https / any core react native modules that should exist - could not be found
replace the name with the corresponding name in "react-native"
in package.json
tip: use cmd+shift+f to replace all in a specific problematic directory
also make sure to check for both single and double quotes, i.e. require('module') and require("module")
xcode download simulator slow / insists on installing simulator even though you already have them
just go download them here: https://developer.apple.com/download/all/
Cannot copy the image because the disk is almost full
multiple commands produce ... rct18nstrings pods > targets > delete "React-Core-RCTI18nStrings"
create virtual environment
python -m venv venv_name
activate venv
source venv_name/bin/activate
- if a listed terminal command doesn't work, try it with VPN on (connect to anywhere but China/HK/Taiwan) or off.
- if it still doesn't work, let it run for at least 10 minutes to see if it actually doesn't work.
- if it still doesn't work, search up the error message on Baidu and follow a tutorial on there
- else, contact me @taroxxx
-
homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- add to path (nano into "
/.zshrc" or "/.bashrc" depending on whicn one you are using, if you are not sure, do both)
nano ~/.zshrc # or ~/.bashrc
- go to the bottom, and add the following lines
export PATH="/opt/homebrew/sbin:$PATH"
export PATH="~/.local/bin:$PATH"
-
Ctrl + O
-
Enter
-
Ctrl + X
-
git, node, watchman
brew install git brew install node brew install watchman
-
install pod modules + gem
sudo gem install cocoapods
change directory
# for example, for me: cd /Users/tarioyou/SafePlate/ios
bundle install + pods
bundle install bundle exec pod install
make sure pods are updated
pod update
-
command line tools
xcode-select --install
-
java development kit
brew tap homebrew/cask-versions brew install --cask zulu17
-
install android studio
- menu bar > "Tools"
- "SDK Manager"
- "Languages & Frameworks" > "Android SDK" > "SDK Platforms" (see attached img)
- tick "Show Package Details"
- expand "Android 14.0 ("UpsideDownCake")"
- tick "Android SDK Platform 34"
- tick "Google APIs ARM 64 v8a System Image" (m1/m2 macs) or "Google APIs Intel x86_64 Atom System Image" (intel macs)
- leave anything else ticked as ticked
- click "Apply"
- wait for it to finish downloading
- click "Finish"
- click "OK"
-
add to path (nano into "
/.zshrc" or "/.bashrc" depending on whicn one you are using, if you are not sure, do both)nano ~/.zshrc # or ~/.bashrc
- go to the bottom, and add the following lines
export ANDROID_HOME=$HOME/Library/Android/sdk export PATH=$PATH:$ANDROID_HOME/emulator export PATH=$PATH:$ANDROID_HOME/platform-tools
- Ctrl + O
- Enter
- Ctrl + X
-
install react-native
npm i react-native
-
follow these instructions
-
install react-native
npm i react-native
-
clone our repository
git clone https://github.com/Lutashi/SafePlate
-
change directory to SafePlate
# for example, for me: cd /Users/tarioyou/SafePlate
-
check if all dependencies are installed
npx react-native doctor --verbose
make sure everything is green ticked, if not press f or e or search online for a solution or if finally nothing works, reach out to me in Discord @taroxxx
-
create a device + link emulator in Android Studio
-
start the app
npx react-native start --verbose
- press i to run on ios -> you should see Simulator (mac app) pop up
- cannot run ios on windows ONLY MAC
- press a to run on android -> you should see the emulator in AndroidStudio responding
- works on both windows and mac
takes around ~10-15 minutes for the first time, faster afterwards
- press i to run on ios -> you should see Simulator (mac app) pop up
Now that you have successfully run the app, let's modify it.
-
Open
App.tsx
in your text editor of choice and edit some lines. -
For Android: With the emulator in Android Studio in focus, press the R key twice
For iOS: With the Simulator in focus, hit Cmd ⌘ + R in your iOS Simulator to reload the app and see your changes!
alright, the website github is set up. here are the instructions
you should've been invited to a repo to collaborate, if not:
- reply to this message with your github email (set up an account if you haven't yet)
- i will invite you to collaborate on this repo, you will receive an invite
now, onto setting up ssh verification on your machine, here are the steps for macos (if you are on another operating system, figure something out):
-
type "git" in your terminal, if it's installed it will give you a bunch of instructions, if not a pop up will appear to install it (xcode select)
git
-
go to directory
cd /Users/yourusername/.ssh
-
generate key
ssh-keygen -t rsa -C "githubemailaddress@mail.com" Generating public/private rsa key pair Enter file in which to save the key (...) [just press enter here] Enter passphrase (...) [enter your github password] Enter same passphrase again: [enter it again] Your identification has been saved in /Users/username/.ssh/id_rsa ...
-
copy the key
cat id_rsa.pub | pbcopy
-
now your ssh key is in your clipboard, go to github.com > top right corner click on your profile > "settings" > on the left navigate to "ssh and gpg keys" > "new ssh key" > enter a title like "macbookair ssh key" > set the key type to "authentication key" > in the key field, paste in your clipboard > "add ssh key"
-
set up automatic passphrase
eval `ssh-agent -s
-
you should see something like "Agent pid xxxx"
ssh-add ~/.ssh/id_rsa enter passphrase for /Users/username/.ssh/id_rsa: [enter your github password] Identity added...
-
double check the automatic passphrase was set up
ssh-add -l xxxx SHAxxx:xxxxxx githubemail@mail.com (RSA)
-
everything's set up and you can work with the git repo now
- open up the repository in a code editor (recommended: visual studio code https://code.visualstudio.com/download)
- do whatever changes do the files
- add files, add a commit message, and push!
git add filename1.txt filename2.html
git commit -m "updated landing page (enter an appropriate, informative commit message)"
git push -u origin main
git pull origin main
if there is a merge conflict your terminal will say something like
CONFLICT (content): Merge conflict in filename.xxx
to resolve this:
(see picture)
- pull
- in your code editor, (on my end in visual studio code), you should see [see picture 2]
- in visual studio code you see the "resolve in merge editor" [see picture 3]
- this brings you to an interface to resolve the merge conflict [see picture 4]
- then once you are done, press "complete merge" [see picture 5]
- conflict resolved!