Skip to content
ranehalPublic

About

Grocery Price Intelligence, Historical Transparency & AI Forecasting Engine for Bangladesh "Discounts are loud. History is honest."

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

ShopSathi (เฆถเฆชเฆธเฆพเฆฅเง€) ๐Ÿ›’๐Ÿ‡ง๐Ÿ‡ฉ

Grocery Price Intelligence, Historical Transparency & AI Forecasting Engine for Bangladesh
"Discounts are loud. History is honest."

Flutter Dart DuckDB Gemini AI Offline First License


๐Ÿ“– Overview

ShopSathi is an offline-first, high-performance grocery price intelligence and market transparency mobile application built for Bangladeshi shoppers. By tracking, indexing, and normalizing SKU data across 8 major supermarket chains in Dhaka and nationwide, ShopSathi exposes genuine price histories, unmasks deceptive discount claims, forecasts market trends, and delivers instant per-unit price comparisons across competing grocery retailers.

Powered by an embedded vectorized DuckDB analytics engine operating directly on compressed .parquet files, ShopSathi performs complex multi-variable aggregation, time-series forecasting, and cross-store candidate matching over 110,000+ products and 15.7M price points in under 50msโ€”completely on-device without requiring continuous cloud connectivity.


๐Ÿ“ธ Visual Showcase & Feature Walkthrough

1. Launch, Editorial Masthead & Supermarket Catalog

๐Ÿš€ Offline Parquet Engine Bootstrap ๐Ÿ  Editorial Home & Market Summary ๐Ÿฌ Supermarket Catalog Hub
Offline Engine Bootstrap Editorial Home Screen All-Time Lows and Store Hub
Embedded DuckDB Parquet initialization with sub-second bootstrap Editorial hero masthead, live store counters, and daily staple trends All-Time Low (ATL) records and 8 supermarket catalog entry points

2. Search, Smart Categorization & Taxonomy Tree

๐Ÿ” Deep Search & Unit Normalization ๐Ÿ—‚๏ธ Browse Categories Catalog ๐ŸŒณ Multi-Select Taxonomy Hierarchy
Deep Search and Filters Browse Categories Taxonomy Tree Drawer
Instant search by keyword, store, unit (kg/L/pc), and price trends Dual-mode catalog (Taxonomy vs By Store) with per-unit price ledger Expandable taxonomy tree with multi-select checkboxes & live counts

3. Market Intelligence, GenAI Forecasting & Navigation

๐Ÿค– Ask Sathi AI (Market Forecasting) ๐Ÿ“Š Market Pulse & Commodity Basket โ˜ฐ Navigation Drawer & Customization
Ask Sathi AI Chat Market Pulse Analytics Navigation Drawer
7D/30D price forecasting, supply chain factors & interactive item cards Commodity Basket Price Index area chart & store price share ranking Quick access drawer with macro pulse, store catalog links & theme dots

4. Superstore View & Engine Settings

๐Ÿช Supermarket Store Catalog โš™๏ธ Settings, Sync & Typography
Supermarket Store View Settings Screen
Shwapno store view with brand filters, sort controls, and ATL tag Daily sync manager, custom AI API keys, typeface & font scaling

โœจ Core Features & Technical Highlights

1. ๐Ÿค– Multi-Model GenAI Cascade & Price Forecasting

  • Multi-Tier Cascade Architecture: Tries active AI endpoints sequentially (gemini-flash-lite-latest โ†’ gemini-2.5-flash โ†’ groq โ†’ openrouter โ†’ custom openai-compatible) with zero user disruption.
  • Statistical Fallback Engine: If no API key is configured or offline, falls back to a deterministic multi-factor statistical model combining velocity, historical variance, and seasonal volatility.
  • Actionable Structured Insights: Produces clean, bulleted market summaries:
    • ๐Ÿ“Š Market Snapshot: Current price dispersion across retailers and cheapest supermarket.
    • ๐Ÿ”ฎ 7-Day & 30-Day Forecast: Directional predictions (Rising/Stable/Falling) with target price brackets.
    • ๐Ÿšš Key Supply Chain Factors: Transportation, seasonal harvest yields, and import tariffs.
    • ๐Ÿ›’ Shopper Strategy: Immediate buy recommendations vs wait strategies.
  • Interactive Referenced Item Cards: Chat responses automatically parse and render tappable product cards with live store logos, current prices, normalized rates, and direct product detail navigation.

2. โšก Embedded Vectorized DuckDB Analytics Engine

  • In-Process Columnar OLAP: Directly executes vectorized SQL against compressed .parquet datasets stored locally on the device.
  • Ultra-Fast Sub-50ms Execution: Full-text searching, store-level filtering, percentile calculation, and cross-store aggregation across 110k+ items without server roundtrips.
  • Incremental & Automated Daily Sync: Background delta synchronization keeps catalog records up to date automatically.

3. ๐Ÿฌ 8-Chain Supermarket Coverage & Normalization

  • Full Coverage of Major Supermarkets:
    • ๐Ÿ”ด Shwapno (เฆธเงเฆฌเฆชเงเฆจ)
    • ๐ŸŸก Chaldal (เฆšเฆพเฆฒเฆกเฆพเฆฒ)
    • ๐ŸŸข Meena Bazar (เฆฎเง€เฆจเฆพ เฆฌเฆพเฆœเฆพเฆฐ)
    • ๐ŸŸฃ Othoba (เฆ…เฆฅเฆฌเฆพ)
    • ๐Ÿ”ต Metromart (เฆฎเง‡เฆŸเงเฆฐเง‹เฆฎเฆพเฆฐเงเฆŸ)
    • ๐ŸŸข Unimart (เฆ‡เฆ‰เฆจเฆฟเฆฎเฆพเฆฐเงเฆŸ)
    • ๐Ÿฉต ShotejBazar (เฆธเฆคเง‡เฆœเฆฌเฆพเฆœเฆพเฆฐ)
    • ๐Ÿฉท Foodi (เฆซเงเฆกเฆฟ)
  • Per-Unit Rate Normalization: Standardizes diverse packaging into comparable units (เงณ/kg, เงณ/L, เงณ/piece), exposing true value across dissimilar product pack sizes.

4. ๐Ÿ”ฅ Strict Mathematical All-Time Low (ATL) Detection

  • Zero Fake Drop Protection: Strictly rejects 0% flat-line "promotions".
  • Rigorous Multi-Point Thresholds:
    • Requires $\ge 2$ distinct recorded price changes.
    • Peak historical price must be at least $5%$ higher than minimum.
    • Absolute drop must be $\ge เงณ1.00$.
    • Current price must reside within $0.1%$ of the all-time recorded lowest price.

5. ๐Ÿ“ˆ Continuous Bรฉzier Timeline Charts

  • Historical Anchor: Charts normalize and render price histories anchored back to February 2026 with uniform monthly checkpoints.
  • Interactive Scrub Cursor: Custom canvas painters provide scrub tooltips, ATH/ATL highlight rings, and high/low bounding bounds.
  • Data Parity: Product card sparklines and full-screen detail charts share 100% identical data models and trajectories.

6. ๐ŸŽจ Responsive Editorial Design & Typography

  • Overflow-Proof Responsive Layouts: Clean flex-box distribution engineered to render flawlessly across all standard smartphone screen sizes and font scales.
  • Theme Palette: Pure White (Paper), Noir (OLED Dark), Terminal Green, Sepia, Royal Indigo, and Rose Sunset.
  • Typography & Font Scaling: Seamless switching between Plus Jakarta Sans, Inter, Outfit, JetBrains Mono, and Space Mono with customizable DPI font scaling.

๐Ÿ—๏ธ Architecture & Codebase Map

ShopSathi/
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ lib/
โ”‚   โ”‚   โ”œโ”€โ”€ core/           # Design tokens, formatters, CustomPainters, receipt widgets
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ format.dart     # Currency formatting (เงณ), date parsers, string normalization
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ palette.dart    # Theme tokens (Paper, Ink, Accent, Good, Bad, Line)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ gge1.dart       # Encryption utilities (AES-256-GCM / PBKDF2)
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ widgets.dart    # StoreLogo, Sparkline, Card, Tag, PaginationBar
โ”‚   โ”‚   โ”œโ”€โ”€ data/           # Data layer, models, DuckDB repository & AI Service
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ai_service.dart # Multi-model GenAI cascade & statistical forecast engine
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ catalog.dart    # Supermarket definitions & category emoji mappings
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ downloader.dart # Mirror downloader & integrity verifier
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ models.dart     # Product, PricePoint, CategorySummary, Forecast models
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ repo.dart       # Vectorized DuckDB Parquet repository queries
โ”‚   โ”‚   โ”œโ”€โ”€ state/          # Riverpod state management & persistent providers
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ app_state.dart  # Navigation, comparison basket, AI config, sync state
โ”‚   โ”‚   โ””โ”€โ”€ ui/             # Screen presentations & layouts
โ”‚   โ”‚       โ”œโ”€โ”€ shell.dart      # Root navigation bar, drawer & global modal handlers
โ”‚   โ”‚       โ”œโ”€โ”€ screens/
โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ home.dart       # Editorial masthead, hero banner, ATL shelf, drops feed
โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ categories.dart # Taxonomy catalog, store filters & category tree drawer
โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ search.dart     # Deep search with multi-param filter chips & grid
โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ product.dart    # Detailed price chart, AI forecast card, competitor table
โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ store.dart      # Supermarket store catalog view & brand filters
โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ compare.dart    # Multi-product comparison graph & difference matrix
โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ chat.dart       # Ask Sathi AI chat interface with interactive item cards
โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ dashboard.dart  # Market Pulse, basket price index & store share rankings
โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ explore_feed.dart # Dedicated full-screen feed for drops and ATL records
โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ settings.dart   # Daily sync, AI API key manager, themes & typography
โ”‚   โ”‚       โ”‚   โ””โ”€โ”€ splash.dart     # Launch splash screen & offline engine bootstrap
โ”‚   โ”‚   โ””โ”€โ”€ main.dart       # App entrypoint, Riverpod ProviderScope & theme setup
โ”‚   โ””โ”€โ”€ test/               # Unit, repository, and widget test suite

Technology Matrix

Component Technology Role / Implementation
Framework Flutter 3.24+ / Dart 3.5+ Native cross-platform performance
Database Engine Embedded DuckDB In-process columnar OLAP querying on local Parquet files
AI Intelligence Google Gemini / Groq / OpenAI Dynamic multi-model cascade with statistical fallback
State Management Flutter Riverpod 2.6+ Compile-safe reactive state & dependency injection
Cryptography PointyCastle / Crypto AES-256-GCM authenticated encryption for archives
Typography Google Fonts Editorial Serif & Plus Jakarta Sans / JetBrains Mono
Image Caching CachedNetworkImage In-memory & on-disk disk LRU caching with shimmer

๐Ÿš€ Getting Started

Prerequisites

Installation & Run

  1. Clone the repository:

    git clone https://github.com/ranehal/ShopSathi-flutter.git
    cd ShopSathi-flutter/app
  2. Fetch dependencies:

    flutter pub get
  3. Run on connected device or desktop:

    # Run on connected Android phone / emulator
    flutter run
    
    # Or run on Windows Desktop
    flutter run -d windows
  4. Execute Static Analysis & Tests:

    flutter analyze
    flutter test

Building Release APK

flutter build apk --release

The optimized release APK will be located at: build/app/outputs/flutter-apk/app-release.apk


๐Ÿ”’ Security & Local Privacy

  • 100% On-Device Queries: Search queries, comparison lists, and bookmarks never leave your phone.
  • Client-Side Encrypted Archives: Full historical price archives use AES-256-GCM encryption with PBKDF2 key derivation.
  • Bring-Your-Own-Key (BYOK) AI: Users can optionally supply their own API keys stored safely inside local SharedPreferences without intermediary proxy servers.

๐Ÿ“„ License

Distributed under the MIT License. See LICENSE for more information.


Crafted with โค๏ธ by Ragib Ahnaf Nehal for Bangladeshi grocery shoppers.
เฆญเฆพเฆฒเง‹เฆฌเฆพเฆธเฆพ เฆ…เฆฌเฆฟเฆฐเฆพเฆฎ โ€” NEHAL ๐Ÿ’–

About

Grocery Price Intelligence, Historical Transparency & AI Forecasting Engine for Bangladesh "Discounts are loud. History is honest."

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages