UseFresh is a web application that helps users keep track of food in their pantry, reduce food waste, and utilize ingredients before they expire. The application is a combination of expiration monitoring, inventory tracking, recipe suggestions, and AI-assisted camera scanner in one place.
The purpose of UseFresh is to help users:
- Keep an organized record of the food items they have in their pantry
- Reduce unnecessary grocery waste
- See which items are expired or soon to be expired
- Have assistance in meal decision based on the ingredients already available
- Automate food entry with camera-based scanning tool
- Create a new account with username, email, and password
- Log in with either username/email and password
- Store the logged in user's ID so food items can be associated with the correct logged in user
- Add food items with a name, quantity, and expiration date
- View saved food items
- Edit food items
- Delete food items
- Search through food items in inventory
- Calculate how many days remain before an item expires
- Color code food items based on their expiration date
- Show recently added items on the home page
- Show soon to be expired and expired items on the home page
- Generate recipe ideas from first soon to be expired items and overall food items saved in the database
- Open the device camera from the View Items page
- Scan the product labels to detect the product name
- Scan the expiration date labels to detect the expiration of the product
- Save the scanned item information into the food inventory after completing the scan
- Passwords are hashed in the backend before being stored
- Input validation is included for user account creation, login, and food item entry
- React 19
- Vite (build tool)
- React Router DOM (routing)
- Axios (HTTP client)
- Bootstrap (styling)
- Node.js
- Express.js
- MongoDB with Mongoose
- bcrypt (password hashing)
- Nodemailer (email functionality)
- dotenv
- CORS
- Node.js
- Express.js
- Hugging Face Inference API
- Multer (file uploads)
- MongoDB
Figure 1: User authentication screen with login form
Figure 2: Main dashboard showing food inventory and quick actions
Figure 3: Main area showing color coded food inventory table and editing actions
Figure 4: Form for manually adding food items with expiration dates
Figure 5: Camera interface for scanning food product labels
Figure 6: AI-generated recipe suggestions based on expiring ingredients
Figure 7: Collection of user-saved favorite recipes
The project supports user account creation, login, password reset, food tracking, adding, editing, and deleting items, recipe suggestions, and camera based scanning.
- Node.js (v16 or higher)
- MongoDB database
- Hugging Face account and API token
-
Clone the repository
git clone <repository-url> cd UseFresh
-
Install root dependencies
npm install
-
Set up the backend
cd backend npm install -
Set up the frontend
cd ../frontend npm install -
Set up the AI component
cd ../AI_component npm install pip install -r requirements.txt # If Python dependencies are needed
UseFresh/
|--frontend/ (React)
|--backend/ (Express +MongoDB)
|--AI_component/ (HuggingFace)
|--README.md
Create .env files in the following directories:
MONGO_URI=mongodb://localhost:27017/usefresh
PORT=3001
# Add other environment variables as needed (e.g., email service credentials)
MONGO_URI=mongodb://localhost:27017/usefresh
HF_TOKEN=your_hugging_face_api_token
-
Start MongoDB (ensure it's running on your system)
-
Start the AI Component (in a separate terminal)
cd AI_component node Scanserver.jsThe AI service will run on
http://localhost:5000 -
Start the Backend (in a separate terminal)
cd backend npm startThe backend API will run on
http://localhost:3001 -
Start the Frontend (in a separate terminal)
cd frontend npm run devThe frontend will run on
http://localhost:5173(or similar Vite default port)
- Register/Login: Create an account or log in with existing credentials
- Add Food Items:
- Manually enter food items with expiration dates and quantities
- Use the camera scanner to scan product packaging
- View Inventory: See all your food items organized by expiration date
- Generate Recipes: Get AI-suggested recipes for breakfast, lunch, or dinner using your expiring ingredients
- Save Recipes: Keep track of your favorite recipes for later
POST /api/user/register- User registrationPOST /api/user/login- User loginPOST /api/user/forgot-password- Password reset requestPOST /api/user/reset-password- Password reset
GET /api/foods/all- Get all user's food itemsPOST /api/foods/add- Add new food itemPUT /api/foods/update/:id- Update food itemDELETE /api/foods/delete/:id- Delete food item
POST /api/recipes/generate- Generate recipe suggestionsGET /api/recipes/saved- Get saved recipesPOST /api/recipes/save- Save a recipeDELETE /api/recipes/delete/:id- Delete saved recipe
POST /suggest-recipes- Get recipe suggestions based on expiring food
-
/login : the user login
-
/register: the user account creation
-
/home: the dashboard that shows food insights
-
/items: inventory page with add, edit, delete, search, scan, and filter tools
-
/forgot_password: password reset request page
-
/reset_password/:token: password reset page
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the ISC License.
- Built as part of WSU-4110 course project
- Uses Hugging Face for AI-powered recipe suggestions
- Natalia Dycha
- Hamsini Gupta
- Gloria Llakmani
- Sanika Annadate
- Zainab Bazoun