A web application that helps you track your refrigerator inventory using manual entry or AI-powered image recognition via Google Cloud Vision API.
Note: This is a proof-of-concept project with known limitations:
- No filtering on image recognition - Google Vision API returns all detected labels (not just food items), so you may see non-food items added to your inventory
- Camera placement - Designed for a camera mounted inside a refrigerator, but currently uses webcam as a stand-in for demo purposes
- Recognition accuracy - Image recognition quality depends on lighting, image clarity, and Google Vision API's label detection capabilities
- User Authentication - Local signup/login with JWT + Google OAuth
- Inventory Management - View all food items in your fridge
- Add/Remove Food - Manually manage your inventory
- AI Food Scanning - Use your webcam to scan and detect food items automatically
- Ask Feature - Quick lookup to check if you have a specific item
- Node.js + Express.js
- MongoDB + Mongoose
- JWT Authentication
- Google Cloud Vision API
- bcrypt for password hashing
- React 18 + Vite
- Chakra UI
- Zustand (state management)
- Axios
- React Router
- react-webcam
- Node.js 18+
- MongoDB Atlas account (or local MongoDB)
- Google Cloud account with Vision API enabled
- Google OAuth credentials (for social login)
git clone https://github.com/charrmint/FoodRadar.git
cd FoodRadarnpm installOr install separately:
cd backend && npm install
cd ../frontend && npm installBackend (`backend/.env`):
PORT=5050
MONGO_URI=mongodb+srv://<username>:<password>@cluster.mongodb.net/foodradar
JWT_TOKEN=your_jwt_secret_key_here
GOOGLE_CLIENT_ID=your_google_oauth_client_id
GOOGLE_CLIENT_SECRET=your_google_oauth_client_secret
GOOGLE_CALLBACK_URL=http://localhost:5050/api/auth/google/callback
GOOGLE_CLOUD_API_KEY=your_google_cloud_vision_api_key
- Go to Google Cloud Console
- Create a new project or select existing
- Enable Cloud Vision API
- Go to APIs & Services → Credentials
- Create an API key for Vision API
- Create OAuth 2.0 credentials for Google Sign-In
- Authorized redirect URI: `http://localhost:5050/api/auth/google/callback\`
# Terminal 1 - Backend
cd backend
npm run dev
# Terminal 2 - Frontend
cd frontend
npm run dev- Backend: `http://localhost:5050\`
- Frontend: `http://localhost:5173\`
Food_Recognition-BCSHacks-2025/
├── backend/
│ ├── middleware/
│ │ └── authMiddleware.js
│ ├── models/
│ │ ├── User.js
│ │ └── Refrigerator.js
│ ├── routes/
│ │ ├── authRoutes.js
│ │ ├── refrigeratorRoutes.js
│ │ └── scanRoutes.js
│ ├── utils/
│ │ ├── generateToken.js
│ │ └── createRefrigeratorForUser.js
│ └── server.js
│
├── frontend/
│ ├── src/
│ │ ├── api/
│ │ ├── components/
│ │ ├── features/feature-sets/
│ │ │ ├── Auth/
│ │ │ ├── Dashboard/
│ │ │ ├── Inventory/
│ │ │ ├── AddFood/
│ │ │ ├── RemoveFood/
│ │ │ ├── ScanFood/
│ │ │ └── AskFood/
│ │ ├── store/
│ │ ├── App.jsx
│ │ └── main.jsx
│ └── vite.config.js
│
└── package.json
| Method | Endpoint | Description |
|---|---|---|
| POST | `/api/auth/signup` | Register new user |
| POST | `/api/auth/login` | Login with email/password |
| GET | `/api/auth/google` | Initiate Google OAuth |
| GET | `/api/auth/google/callback` | OAuth callback |
| GET | `/api/auth/me` | Get current user |
| Method | Endpoint | Description |
|---|---|---|
| POST | `/api/refrigerator` | Create refrigerator |
| GET | `/api/refrigerator/:id` | Get refrigerator |
| GET | `/api/refrigerator/:id/foodMap` | Get food inventory |
| POST | `/api/refrigerator/:id/addFood` | Add food item |
| DELETE | `/api/refrigerator/:id/removeFoods` | Remove food item |
| POST | `/api/refrigerator/:id/updateFoodMap` | Bulk update (from scan) |
| Method | Endpoint | Description |
|---|---|---|
| POST | `/api/scan` | Process image with Vision API |




