Skip to content

Yashwanth-R19/Plantry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plantry

A behavior-aware grocery planning assistant that learns from your household's shopping habits to suggest what you might forget.

Plantry helps users create smarter shopping lists by learning from their own purchase history instead of relying on generic recommendations. It combines lightweight machine learning models with a modern web application to identify frequently bought-together items, forgotten products, and recurring shopping patterns.


Features

  • Smart shopping list creation from natural language input
  • Frequently bought-together item suggestions
  • Forgotten item prediction using probability-based scoring
  • Recurring item reminders based on purchase history
  • User feedback to improve future recommendations
  • Shopping history and household insights
  • Secure authentication with Firebase Authentication

Architecture

                React + TypeScript Frontend
                           │
                           ▼
                 Express.js Backend API
                           │
        ┌──────────────────┼──────────────────┐
        ▼                  ▼                  ▼
 Firebase Auth      Firestore Database    ML Models
                                          • Association Mining
                                          • Bayesian Scoring
                                          • Temporal Patterns

Machine Learning

Plantry generates recommendations by combining three lightweight and explainable models:

Model Purpose
Association Mining Suggests items frequently bought together
Bayesian Scoring Predicts items commonly forgotten
Temporal Heuristics Identifies items due for repurchase

Models are trained per household, making recommendations personalized rather than based on global shopping trends.


Tech Stack

Category Technologies
Frontend React, TypeScript, Vite, Tailwind CSS
Backend Node.js, Express
Database Firebase Firestore
Authentication Firebase Authentication
AI Google Gemini (optional natural-language parsing)
Analytics Looker Studio

Project Structure

Plantry/
│
├── backend/
│   ├── jobs/              # Scheduled background jobs
│   ├── middleware/        # Authentication & error handling
│   ├── routes/            # REST API endpoints
│   ├── services/          # Business logic
│   ├── utils/
│   ├── firebaseAdmin.js
│   └── index.js
│
├── frontend/
│   ├── src/
│   │   ├── components/    # Reusable UI components
│   │   ├── context/       # Authentication context
│   │   ├── lib/           # Firebase configuration
│   │   ├── pages/         # Application pages
│   │   ├── services/      # API client
│   │   ├── App.tsx
│   │   └── main.tsx
│   └── vite.config.ts
│
├── ml-training/
│   ├── models/            # ML models
│   ├── trainAll.js        # Train all recommendation models
│   ├── testInference.js   # Test inference pipeline
│   └── fetchData.js
│
├── firestore.rules
├── render.yaml
├── package.json
└── README.md

Installation

Clone the repository:

git clone <repository-url>
cd Plantry

Install dependencies:

npm install

Create the required .env files from the provided .env.example files and configure your Firebase credentials.


Running the Project

Start the backend:

npm run dev:backend

Start the frontend:

npm run dev:frontend

The application will be available locally after both services are running.


Training the Models

After generating shopping history through the application, retrain the recommendation models:

cd ml-training
node trainAll.js <firebase-user-uid>

To test model predictions:

node testInference.js <firebase-user-uid> milk bread

Security

  • Firebase Authentication for user sign-in
  • Backend verifies every Firebase ID token
  • Firestore is accessed only through the backend
  • Each user's data is isolated using their Firebase UID

Future Improvements

  • Multi-user household support
  • Automatic model retraining
  • Better seasonal and contextual recommendations
  • Cross-household pattern learning while preserving privacy
  • Smarter natural language understanding

Note: In the deployed webstite, the Looker Studio Visualisation in the Insights page is done from the Data used to Train and Test the ML Models for one particular household

Deployment:

About

Plantry is a behavior-aware grocery planning assistant that leverages personalized shopping history and lightweight machine learning to recommend forgotten items, recurring purchases, and frequently bought-together products. Visit the below link to access the deployment (Wait for around 50 seconds for the backend to load back from sleep)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors