An intelligent receipt analysis application that leverages Redis 8 and Redis Stack to provide advanced price comparison, vector-based item similarity search, and real-time analytics across different stores.
Project is live here: receiptsense.vercel.app
This Next.js application transforms receipt data into actionable insights using cutting-edge database technologies. By combining OCR processing with Redis Stack's advanced modules, it delivers:
- Smart Price Analysis: Compare prices across stores with statistical insights
- Vector Similarity Search: Find similar items using AI-powered embeddings
- Real-time Recommendations: Get instant savings suggestions
- Trend Analysis: Track price movements over time
- Store Performance: Analyze which stores offer the best deals
- Frontend: Next.js 15, React 19, Tailwind CSS 4
- Backend: Next.js API Routes with TypeScript
- Database: Redis Cloud 8.0 with Redis Stack
- OCR Engine: Tesseract.js for receipt text extraction
- Deployment: Vercel with serverless functions
- Code Quality: Husky, ESLint, TypeScript
- Receipt Upload → OCR Processing (Tesseract.js)
- Item Extraction → Vector Embedding Generation
- Redis Storage → JSON documents with vector indices
- Similarity Search → KNN search using cosine distance
- Price Analysis → Statistical comparison across stores
- Recommendations → Real-time insights and savings suggestions
- Node.js 18.18+ or 20+
- Redis Cloud account with Redis Stack enabled
git clone <repository-url>
npm install
# Redis Cloud with Redis Stack
REDIS_URL=redis://default:password@redis-xxxxx.c91.us-east-1-3.ec2.redns.redis-cloud.com:port
NODE_ENV=development
npm run dev # Start development server
npm run lint # Run ESLint
npm run build # Build for production
- 128-dimensional embeddings for item names
- Cosine similarity for finding related products
- KNN search with configurable result limits
- Automatic filtering of zero-price items
- Store comparison with statistical insights
- Price volatility detection (>30% variation alerts)
- Savings recommendations based on historical data
- Trend analysis using time series data
- Overpaid alerts (>15% above average)
- Good deal detection (>10% below average)
- Store recommendations based on price performance
- Alternative product suggestions with high similarity scores
- Connect repository to Vercel
- Configure environment variables
- Deploy with automatic Redis Stack detection
REDIS_URL
: Redis Cloud connection string with Redis StackNODE_ENV
: Production environment flag
- Vector search caching for frequently queried items
- Connection pooling with Redis client reuse
- Graceful fallbacks when Redis Stack unavailable
- Efficient embedding generation with normalized vectors
- Smart filtering to exclude invalid price data
Endpoint | Method | Description |
---|---|---|
/api/upload-receipt |
POST | Upload and OCR process receipts |
/api/receipts |
GET | Retrieve all stored receipts |
/api/receipts/[id] |
GET | Get specific receipt details |
/api/receipts/[id]/edit |
PUT | Update receipt information |
/api/price-comparison/[itemName] |
GET | Vector search and price analysis |
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature
) - Commit changes (
git commit -m 'Add amazing feature'
) - Push to branch (
git push origin feature/amazing-feature
) - Open Pull Request
MIT License - see LICENSE file for details
Built with ❤️ using Redis 8, Redis Stack, and Next.js