Project Info
Inspiration
As consumers in a market flooded with competing products and unfamiliar ingredient lists, we often find ourselves staring at labels full of names we've never seen before. Who is this really for? Our inspiration behind GrocerView was to cut through the noise and give people access to real, evidence-based information about what they're putting in their bodies, not influencer opinions, but actual scientific research.
What it does
GrocerView is a mobile app that lets users scan the barcode of any grocery item and instantly receive a breakdown of its ingredients backed by scientific literature. The app queries research databases like PubMed and OpenAlex, retrieves relevant papers on each ingredient, and presents AI-generated summaries along with direct quotes from peer-reviewed studies. Users can also flag specific ingredients they want to avoid and see parent company ownership information for products.
How we built it
Frontend: React Native with Expo for cross-platform iOS and Android support. We used Zustand for state management and MMKV for fast local caching. Backend: FastAPI (Python) serving REST endpoints for ingredient resolution and research retrieval. RAG Pipeline: We built a Retrieval-Augmented Generation system with multiple stages: Paper Discovery: Search PubMed and OpenAlex in parallel using resolved ingredient synonyms Full-Text Retrieval: Fetch open-access papers from PubMed Central (with license verification to ensure we can legally quote) Chunking & Embedding: Split papers into passages and store vectors in ChromaDB for semantic search Regulatory Data: Query authoritative sources (FDA GRAS status, WHO JECFA evaluations, NIH Office of Dietary Supplements) for official safety assessments Comprehensive Retrieval: Query three focus areas in parallel (safety, health, general) and deduplicate results Quote Verification: Ensure every quote in the LLM output actually exists in the retrieved evidence, ensuring no hallucinated citations Summary Generation: Claude (via OpenRouter) generates summaries with inline citations linking back to source papers Paper Discovery: Search PubMed and OpenAlex in parallel using resolved ingredient synonyms Full-Text Retrieval: Fetch open-access papers from PubMed Central (with license verification to ensure we can legally quote) Chunking & Embedding: Split papers into passages and store vectors in ChromaDB for semantic search Regulatory Data: Query authoritative sources (FDA GRAS status, WHO JECFA evaluations, NIH Office of Dietary Supplements) for official safety assessments Comprehensive Retrieval: Query three focus areas in parallel (safety, health, general) and deduplicate results Quote Verification: Ensure every quote in the LLM output actually exists in the retrieved evidence, ensuring no hallucinated citations Summary Generation: Claude (via OpenRouter) generates summaries with inline citations linking back to source papers Ingredient Resolution: Multi-source resolver querying PubChem, FoodOn, and Open Food Facts taxonomy in parallel to normalize ingredient names and find synonyms for better paper discovery. LLM Integration: OpenRouter API for generating summaries with citations, using Claude as the underlying model.
Challenges we ran into
Our biggest challenge was that the RAG system was technically demanding on its own: fetching full-text papers, parsing them into clean text, chunking appropriately, and ensuring the LLM citations actually matched source material required significant iteration. This complexity made it difficult to test and integrate with the rest of the system. We couldn't easily verify if the frontend was displaying data correctly when the backend pipeline itself was still being debugged. A user scanning a barcode triggers a chain reaction through five different systems, and if any link breaks, the whole experience falls apart. We also had to handle the reality that not every ingredient has extensive research, so we built fallback paths and caching to provide useful information even when papers are sparse.
Accomplishments we're proud of
We're most proud of building a working RAG system that cites real research papers. In an era where health information on social media often comes from unqualified influencers, GrocerView provides users with information they can actually verify. Every quote links back to its source paper on PubMed. We also built a robust multi-source ingredient resolver that can handle everything from "Red 40" to "E300" to "ascorbic acid" and understand they're related.
What we learned
We learned how to integrate AI as a core part of application functionality rather than just a feature. Building the RAG pipeline taught us about embeddings, vector databases, chunking strategies, and prompt engineering for accurate citations. Beyond the technical skills, we learned to work together under pressure, navigating the stress of a hackathon while keeping momentum going through sleepless nights.
What's next
Planned Features: Environmental metrics (plastic pollution, business practices, pesticides) Country of origin tracking (e.g., olive oil from multiple countries, products processed/packaged in different locations) Nutritional goal tracking (calorie/protein ratios, macro targets) Health agency guidance integration (FDA, HHS recommendations) Alternative product suggestions (e.g., glass vs plastic packaging) Scan history and favorites Social sentiment analysis from Reddit discussions about products Future Possibilities: Location-based grocery store finder with sale alerts Recipe recommendations based on scanned products Crowdsourced product data for items not in existing databases Smart grocery lists organized by store
GrocerView
A mobile app that scans food barcodes to analyze ingredients and provide evidence-based safety information using a RAG (Retrieval-Augmented Generation) pipeline powered by scientific literature.
Features
- Barcode Scanning: Scan product barcodes using your phone's camera
- Ingredient Analysis: Automatically parse and identify ingredients from product labels
- Safety Research: Query PubMed and OpenAlex for scientific papers on ingredient safety
- AI Summaries: Get LLM-generated summaries of research findings
- Evidence Citations: View direct quotes from scientific papers with source links
- Ingredient Flagging: Set custom unwanted ingredients to flag in scanned products
- Company Ownership: See parent company information for products
Tech Stack
Frontend (my-app/)
- React Native with Expo
- TypeScript
- Zustand for state management
- MMKV for local caching
- expo-camera for barcode scanning
Backend (backend/)
- FastAPI (Python)
- ChromaDB for vector storage
- PubMed & OpenAlex APIs for paper discovery
- OpenRouter for LLM summarization
- Multi-source ingredient resolution (PubChem, FoodOn, OFF Taxonomy)
Getting Started
Prerequisites
- Node.js 18+
- Python 3.10+
- Expo Go app on your mobile device
Frontend Setup
cd my-app
npm install
npx expo start
Backend Setup
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn app.main:app --reload --host 0.0.0.0
Environment Variables
Copy the example env file and fill in your keys:
cd backend
cp .env.example .env
Required variables:
| Variable | Description |
|---|---|
OPENROUTER_API_KEY | API key from OpenRouter |
OPENROUTER_DEFAULT_MODEL | LLM model to use (default: anthropic/claude-sonnet-4) |
OPEN_FOOD_FACTS_USER_AGENT | User agent for OFF API (default: GrocerView/1.0) |
NCBI_API_KEY | API key from NCBI for higher PubMed rate limits |
NCBI_CONTACT_EMAIL | Your email for NCBI API requests |
Project Structure
GrocerView/
├── my-app/ # React Native frontend
│ ├── app/ # Expo Router pages
│ ├── components/ # Reusable UI components
│ ├── store/ # Zustand state stores
│ └── data/ # Static data files
├── backend/ # FastAPI backend
│ ├── app/
│ │ ├── api/ # API routes
│ │ ├── services/ # External API integrations
│ │ └── rag/ # RAG pipeline components
│ ├── data/ # ChromaDB and cached data
│ └── cache/ # API response cache
└── README.md
API Endpoints
| Endpoint | Method | Description |
|---|---|---|
/api/v1/ingredient/{name}/summary | GET | Get AI summary for an ingredient |
/api/v1/ingredient/{name}/evidence | GET | Get research quotes with citations |
/api/v1/ingredient/resolve | GET | Resolve ingredient to canonical name |
/api/v1/ingredient/resolve/batch | POST | Batch resolve multiple ingredients |
Data Sources
- Open Food Facts: Product and ingredient data
- USDA FoodData Central: Nutritional information
- PubMed/PMC: Scientific literature
- OpenAlex: Academic paper metadata
- PubChem: Chemical compound data
- FoodOn: Food ontology
License
MIT License - see LICENSE for details.
Analysis
View
Metric
- 15
- 1
- 1
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- FastAPIIn code
- JavaScriptIn code
- PythonIn code
- ReactIn code
- TypeScriptIn code
5 of 5 appear in the indexed code.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
656 KB
Source files
66
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
NguyenEvan/GrocerView
294 files · 2.0 MB · @ 1701bf6
Structure
Interface
45 files · 15%Screens, components and styles rendered to the user.
API & routing
7 files · 2%Request entry points: routes, handlers and controllers.
Application logic
209 files · 71%Domain rules, services and shared utilities.
+1 moreData & schema
3 files · 1%Schema definitions, migrations and data access.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- Python90%
- TypeScript9%
- Markdown1%
- JavaScript0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
my-app/package.json
npm · 37- @expo-google-fonts/space-grotesk
- @expo/vector-icons
- @react-native-async-storage/async-storage
- @react-navigation/bottom-tabs
- @react-navigation/elements
- @react-navigation/native
- @react-navigation/native-stack
- expo
- expo-barcode-scanner
- expo-camera
- expo-constants
- expo-font
- expo-haptics
- expo-image
- expo-linking
- expo-router
- expo-splash-screen
- expo-status-bar
- +19 more
backend/requirements.txt
pypi · 6- fastapi
- httpx
- pydantic
- pydantic-settings
- python-dotenv
- uvicorn[standard]
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.