NearBuy is a shopping lists mobile app that sends location-based alerts when you're near stores that likely have items from your shopping list, with smart items recommendations based on community trends.
The system consists of three main components:
- Model Service: A machine learning API that recommends product and predicts item availability based on store data.
- Backend Service: A FastAPI application handling user lists, notifications, and integrating with Supabase.
- Frontend App: A React Native (Expo) client for users to manage lists and receive location alerts.
+------------+ +-------------+ +-------------+
| Frontend | <---> | Backend | <---> | Model API |
| (Expo) | | (FastAPI) | | (uvicorn) |
+------------+ +-------------+ +-------------+
| | |
v v v
Expo Go / Dev Supabase DB Model Weights
- The Frontend communicates with the Backend over HTTP.
- The Backend stores data in Supabase and calls the Model API for recommendations.
- The Model API loads a trained model and serves predictions.
- Node.js (v14+)
- Expo CLI:
npm install -g expo-cli - Python (v3.10+)
- pip or pipenv (for Python dependencies)
Navigate to the project’s root
pip install -r requirements.txt
Run this to get your local IP:
for /f "tokens=2 delims=:" %a in ('ipconfig ^| findstr "IPv4"') do @echo %ain NearbuyFE/utils.tsx, change the currentPath variable at the beginning of the file like so:
// choose current path to match the emulator (and change to your IP)
export const currentPath =
//'http://172.30.124.49:8001/' // for android emulator (remote IP)
// 'http://localhost:8001/' // for web
'http://<your_local_ip>:8001/' // for phone via USB / expo go app
;Paste the .env file in the root directory.
Also, paste the firebase-service-account.json file in the NearBuyFE directory.
This service loads the ML model and exposes endpoints for predicting item availability.
# Start the API
uvicorn ml_component.api.model_fastapi_server:app --reload --host 0.0.0.0 --port 8000The FastAPI backend handles list management, user profiles, and notifications.
# Start the app
cd NearbuyBE/app
uvicorn main:app --reload --host 0.0.0.0 --port 8001The React Native app built with Expo.
Notifications are currently available only in Expo Dev on Android due to cost restrictions.
# Navigate to frontend folder
cd NearBuyFE
# Install dependencies
npm install
# Start Expo
npm run android- Scan the QR code for phisical mobile or press
ato open in an emulator. - Ensure the Backend (
localhost:8001) and Model API (localhost:8000) are running.
- Model Service (port 8000)
- Backend Service (port 8001)
- Expo Frontend (Expo CLI)
In separate terminals or via a process manager (e.g., tmux, Docker, or pm2), start each component in order. Then open the Expo app and log in or sign up to begin.