PantryPilot is a local-first AI pantry assistant for turning receipt uploads into inventory, tracking freshness, and requesting practical dinner suggestions from what is already on hand.
The project is intentionally scoped as a personal/local MVP: SQLite persistence, a FastAPI backend, a Next.js dashboard, deterministic inventory rules, and a narrow AI provider boundary for receipt parsing, image OCR, and meal suggestions.
- Local-first product architecture with explicit post-MVP boundaries.
- Receipt import workflows for text files and receipt images.
- AI provider isolation instead of provider-specific logic leaking through the app.
- Inventory normalization, expiration estimates, and freshness states.
- A simple dashboard for upload, inventory review, and dinner suggestions.
- Focused backend and frontend tests around the main workflow.
backend/- API, persistence, receipt ingestion, inventory logic, and AI provider boundaries.frontend/- User interface for inventory, receipt upload, and meal suggestions.docs/- Short product, setup, and architecture notes.
- The MVP starts local-first.
- No production hosting is configured yet.
- No cloud backend is configured yet.
- No authentication is configured yet.
- Image receipt OCR sends uploaded images to the configured AI provider.
- Local receipt and inventory data are stored in the local SQLite database.
- Start the backend and frontend locally.
- Upload a
.txt,.jpg, or.pngreceipt. - Extract receipt text and parse grocery line items through the AI provider boundary.
- Append parsed groceries to local inventory with expiration estimates.
- Review inventory freshness and request one dinner suggestion.
Backend:
cd backend
python3 -m venv .venv
. .venv/bin/activate
python -m pip install -e .
cp .env.example .env
# Add a local OPENAI_API_KEY value to .env.
PYTHONPATH=src python -m pantry_pilotBackend tests:
cd backend
. .venv/bin/activate
PYTHONPATH=src python -m unittest discover -s testsCreate a database migration:
cd backend
. .venv/bin/activate
PYTHONPATH=src python -m alembic revision --autogenerate -m "describe change"Apply database migrations:
cd backend
. .venv/bin/activate
PYTHONPATH=src python -m alembic upgrade headReceipt import API:
POST /receipts/importsacceptsmultipart/form-datawith afileupload.- Supported upload types are
text/plain,image/jpeg, andimage/png. - Text receipts are extracted and parsed synchronously for the local MVP.
- Image receipts are sent to the configured AI provider for OCR text extraction.
GET /receipts/imports/{id}returns import status, safe error text, and parsed item count.- Completed imports append new inventory rows for each parsed item. The MVP does not merge duplicates yet; repeated receipts intentionally create separate inventory rows with
sourceset toreceipt_import:{id}. - Created inventory rows include deterministic expiration estimates and freshness status.
Frontend:
cd frontend
npm install
npm run devFrontend tests:
cd frontend
npm testFrontend lint/build check:
cd frontend
npm run lint- This is not a production-hosted app.
- There is no authentication, account system, cloud sync, or multi-user household model.
- Do not expose the development backend directly to the public internet.
- Do not commit
.env, local SQLite databases, or real receipt files. - Image OCR sends the uploaded image to the configured AI provider.