CookSmart is an Expo React Native app for ingredient scanning, recipe discovery, favorites, and meal-planning flows. The mobile app uses Firebase Auth and an Express API backed by MongoDB for saved favorites and activity history.
- Expo + React Native
- Firebase Authentication
- Express
- MongoDB Atlas + Mongoose
- Spoonacular API
- Install the mobile app dependencies:
npm install- Install the API dependencies:
npm --prefix server install- Set the mobile app environment variables in the root
.envfile:
EXPO_PUBLIC_API_URL=http://YOUR_LOCAL_IP:5000
EXPO_PUBLIC_SPOONACULAR_API_KEY=your_spoonacular_key
EXPO_PUBLIC_ANTHROPIC_KEY=your_anthropic_key- Set the API environment variables in
server/.env:
PORT=5000
MONGODB_URI=mongodb+srv://username:[email protected]/cooksmart?retryWrites=true&w=majority- Start the Mongo-backed API:
npm run server- Start Expo in a second terminal:
npm startThe Express API in server/src/index.js persists:
- favorites in server/src/models/favorite.js
- search and detail activity in server/src/models/history.js
The mobile app reads and writes that data through src/services/api.js.
To verify the API is connected, open http://localhost:5000/health. A healthy response now includes the MongoDB connection state.
- On a real phone,
EXPO_PUBLIC_API_URLmust use your computer's local network IP, notlocalhost. - Favorites are deduplicated per user and title to avoid duplicate saves from repeated taps.