This guide provides step-by-step instructions to set up the BabyNest app for Android and iOS, addressing platform-specific dependencies and configurations.
Ensure you have the following installed:
- Node.js (Latest LTS version)
- React Native CLI
- Python 3.8+ (For Flask backend)
- SQLite (For local storage)
- ChromaDB (For vector search)
- Git (For version control)
git clone https://github.com/AOSSIE-Org/BabyNest.git
cd BabyNestcd Frontend
npm install- Install Android Studio and ensure the latest SDK versions are installed.
- Set up an Android Virtual Device (AVD) or connect a physical device.
- Ensure ANDROID_HOME is set in your environment variables.
Install dependencies:
npx react-native doctor
- If needed, install missing dependencies.
BabyNest uses SQLite for local storage: Ensure react-native-sqlite-storage is installed:
npm install react-native-sqlite-storageLink dependencies (if necessary):
npx pod-installnpx react-native start
npx react-native run-androidcd Frontend
npm install- Install Xcode from the Mac App Store.
Install CocoaPods (if not installed):
sudo gem install cocoapods
Install pods:
cd ios
pod install
cd ..- Set up a simulator or use a physical device.
BabyNest uses SQLite for local storage: Ensure react-native-sqlite-storage is installed:
npm install react-native-sqlite-storageLink dependencies:
npx pod-installnpx react-native start
npx react-native run-iosBabyNest includes an offline backend using Flask
cd Backend
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtcd BackendFor Development Mode:
python app.py --env developmentThis will start the API locally in development mode. In development mode, error messages are more detailed and verbose, making it easier to debug issues during development.
For Production Mode:
python app.py --env productionThis will start the API in production mode. In production mode, error messages are more general and details are minimized for security purposes.
BabyNest uses ChromaDB for offline vector search.
pip install chromadbpython -m chromadbThis starts the local vector database.
- If run-android fails, ensure:
- Emulator or physical device is connected.
- adb devices lists a device.
- npx react-native start is running.
- If you encounter a Java heap space error, increase heap size:
export NODE_OPTIONS=--max_old_space_size=4096 - If build fails with Gradle errors, try:
cd android ./gradlew clean cd ..
-
Try uninstalling any app in ios simulator and close the terminal and run all the commands again as mentioned here.
-
If the issues still persist and build fails, try:
cd ios pod install --verbose cd ..
-
Ensure Xcode command-line tools are installed:
sudo xcode-select --install
-
If the Metro bundler crashes, clear the cache:
npx react-native start --reset-cache
-
If CocoaPods fails with dependency issues, try:
cd ios pod repo update pod install --verbose cd ..
-
If you encounter Podfile.lock conflicts, remove and reinstall pods:
cd ios rm -rf Pods Podfile.lock pod install cd ..
-
If linking issues occur, ensure dependencies are correctly linked:
npx react-native link
- If Flask doesn’t start, check dependencies:
cd Backend python3 -m venv .venv source .venv/bin/activate pip install -r requirements.txt
- Ensure Python version is 3.8+.
- If Flask crashes with Address already in use, free the port:
lsof -i :5000 kill -9 <PID>
- If SQLite doesn’t initialize, ensure:
- The database file exists in the correct directory.
- Correct permissions are set:
chmod 777 database.db
Once both the frontend and backend are running, BabyNest will be fully functional. For any issues, check logs and ensure dependencies are correctly installed.