Skip to content
AmanSikarwarPublic

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Flavyo Ice Cream

Flavyo

B2B Stock & Order Management for Ice Cream Distribution

Flutter Dart Supabase Platforms Architecture


Flavyo is a cross-platform B2B stock and order management app for Flavyo Ice Cream. The app connects distributors, vendors, and sales executives in one operational workflow. Distributors manage inventory, pricing, and order fulfillment, while vendors and sales teams place and track orders in real time.

Core Philosophy: Distributors and vendors should always see the same live order and inventory truth without manual refresh or coordination gaps.

Brand Context: Flavyo is known for 100% milk-based ice cream offerings across North India with segment-led products (Regular, Special, Real Fruit, Premium) and formats such as cups, cones, sticks, party packs, tubs, and ice cream cakes.


✨ Features

πŸ” Authentication & Security

  • Email/password sign-up & sign-in with OTP verification
  • Google Sign-In (OAuth) integration
  • Password recovery & reset flow
  • Deep-link based auth callback handling
  • Row-Level Security (RLS) across all database tables

πŸ‘€ Role-Based Access

  • Distributor β€” manage products, inventory, pricing, and fulfill orders
  • Vendor β€” browse catalog, place orders, track deliveries, and reorder
  • Sales Executive β€” place delegated orders for assigned vendor partners
  • Role-specific onboarding with business profile collection
  • Automatic route guards and tab-based navigation per role

πŸ“¦ Catalog & Inventory

  • Product CRUD with image uploads (multi-image support)
  • Taxonomy-backed categories using Flavyo segments (Regular, Special, Real Fruit, Premium)
  • Format and flavor-family taxonomy support for consistent SKU metadata
  • MRP and selling price management with validation
  • Real-time inventory tracking (on-hand vs reserved stock)
  • Availability engine with stock snapshot calculations

πŸ›’ Cart & Checkout

  • Persistent local cart with rehydration across sessions
  • Idempotent order submission to prevent duplicate orders
  • Contact and delivery address auto-population from profile
  • Order confirmation with summary details

πŸ“‹ Order Fulfillment

  • Full lifecycle management: pending β†’ confirmed β†’ packed β†’ shipped β†’ delivered
  • Distributor ops console with order detail views
  • Vendor order history with detailed tracking
  • One-tap reorder merge into active cart

πŸ“Š Analytics Dashboard

  • Distributor KPIs β€” revenue, order volume, inventory metrics
  • Real-time dashboard updates via Supabase channels

⚑ Real-Time Sync

  • Live inventory and order status propagation via Supabase Realtime
  • Instant updates across all connected clients

πŸ”” Notifications

  • Firebase Cloud Messaging integration
  • Local notification support via flutter_local_notifications
  • Per-user notification preferences

πŸ—οΈ Architecture

Flavyo follows a Clean Architecture pattern with strict separation of concerns:

lib/
β”œβ”€β”€ core/                      # Shared infrastructure
β”‚   β”œβ”€β”€ deep_link/             # Auth callback URI parsing
β”‚   β”œβ”€β”€ di/                    # Dependency injection (get_it + injectable)
β”‚   β”œβ”€β”€ env/                   # Compile-time env config (envied)
β”‚   β”œβ”€β”€ failure/               # Domain failure mapping
β”‚   β”œβ”€β”€ router/                # Typed go_router route definitions
β”‚   └── theme/                 # Material 3 theme system
β”‚
β”œβ”€β”€ features/
β”‚   β”œβ”€β”€ analytics/             # Distributor dashboard & KPIs
β”‚   β”œβ”€β”€ app/                   # Shell pages (home, splash, navigation)
β”‚   β”œβ”€β”€ auth/                  # Authentication & profile management
β”‚   β”œβ”€β”€ cart/                  # Shopping cart with local persistence
β”‚   β”œβ”€β”€ catalog/               # Product catalog & inventory
β”‚   β”œβ”€β”€ checkout/              # Order submission & confirmation
β”‚   β”œβ”€β”€ fulfillment/           # Order lifecycle & tracking
β”‚   β”œβ”€β”€ realtime/              # Supabase Realtime sync service
β”‚   └── reorder/               # Reorder-to-cart merge logic
β”‚
└── main.dart                  # App entry point

Each feature module follows the data β†’ domain β†’ presentation layering:

Layer Responsibility
Data Repository implementations, external API integration
Domain Business contracts, entities, failure types (Freezed unions)
Presentation Pages, widgets, BLoC state management

πŸ› οΈ Tech Stack

Category Technology
Framework Flutter (Android, iOS, Web)
Language Dart ^3.12.0
Backend Supabase (Auth, Postgres, Storage, Realtime)
State Management BLoC / flutter_bloc
Dependency Injection get_it + injectable
Routing go_router + go_router_builder (typed routes)
Code Generation build_runner, freezed, json_serializable, envied
Auth Providers Supabase Auth, Google Sign-In
Notifications Firebase Messaging + flutter_local_notifications
Theming Material 3 with custom deep-red brand palette
Typography Poppins app-wide + Covered By Your Grace for Flavyo wordmark only

πŸ—„οΈ Database Schema

The Supabase backend is structured across phased migrations (01 β†’ 15):

Phase Description
01 Identity, profiles & RLS baseline
02 Product catalog & inventory
03 Vendor-distributor assignment relationships
04 Cart & checkout with order submission
05 Fulfillment lifecycle & status transitions
06 Notification preferences
07 Analytics & KPI views
08 Access policy hardening
09-14 Realtime hardening, sales executive delegated ordering, and default distributor linking
15 Flavyo product taxonomy (segments, formats, flavor families)

All tables enforce Row-Level Security with role-scoped policies ensuring complete data isolation between tenants.


πŸš€ Getting Started

Prerequisites

  • Flutter SDK on the main channel (Dart ^3.12.0)
  • A Supabase project
  • Firebase project (for push notifications)
  • Google OAuth credentials (Web + iOS client IDs)

Setup

  1. Clone the repository

    git clone https://github.com/AmanSikarwar/flavyo.git
    cd flavyo
  2. Create a .env file in the project root:

    SUPABASE_URL=your_supabase_url
    SUPABASE_ANON_KEY=your_supabase_anon_key
    GOOGLE_WEB_CLIENT_ID=your_google_web_client_id
    GOOGLE_IOS_CLIENT_ID=your_google_ios_client_id
  3. Install dependencies

    flutter pub get
  4. Run code generation

    dart run build_runner build --delete-conflicting-outputs
  5. Generate localization code (slang)

    dart run slang

    Localization source files live under lib/i18n/*.i18n.json and are configured by slang.yaml.

  6. Apply database migrations Run the SQL files in supabase/migrations/ in order against your Supabase project.

  7. Run the app

    flutter run

πŸ”„ CI/CD (GitHub Actions)

The repository now includes a production-ready GitHub Actions workflow at:

  • .github/workflows/flutter_ci_cd.yml

What it does

  • Runs static analysis and tests on every push to main and every pull request targeting main
  • Builds Android split APK artifacts (app-armeabi-v7a-release.apk, app-arm64-v8a-release.apk, app-x86_64-release.apk)
  • Builds an iOS IPA artifact (flavyo-unsigned.ipa)
  • Builds Flutter Web in CI and deploys it to GitHub Pages on pushes to main
  • On version tags (v*.*.*), publishes split APKs and IPA artifacts to a GitHub Release

Note: the workflow creates an unsigned IPA suitable for artifact distribution and QA validation. App Store/TestFlight delivery requires an additional signed-export step with Apple signing credentials.

GitHub Pages Setup

  • In repository settings, set Pages β†’ Source to GitHub Actions.
  • The workflow builds web with --base-href "/flavyo/" (derived from repository name), which is correct for project Pages URLs.

Required GitHub Secrets

Set these repository secrets in Settings β†’ Secrets and variables β†’ Actions:

  • SUPABASE_URL
  • SUPABASE_ANON_KEY
  • GOOGLE_WEB_CLIENT_ID
  • GOOGLE_IOS_CLIENT_ID

If secrets are not set, CI falls back to placeholder values so compile-only checks can still run.

Trigger a release build

git tag v0.1.0
git push origin v0.1.0

This creates a GitHub Release with both Android and iOS build artifacts attached.


πŸ“ Project Structure

flavyo/
β”œβ”€β”€ assets/images/         # Brand assets (logo)
β”œβ”€β”€ lib/                   # Application source code
β”œβ”€β”€ supabase/migrations/   # Database schema migrations (phase 01 onward)
β”œβ”€β”€ android/               # Android platform config
β”œβ”€β”€ ios/                   # iOS platform config
β”œβ”€β”€ web/                   # Web platform config
β”œβ”€β”€ test/                  # Test suite
β”œβ”€β”€ pubspec.yaml           # Dependencies & metadata
└── analysis_options.yaml  # Lint configuration

🎨 Design System

Flavyo uses a Material 3 design system with a custom deep-red brand palette:

  • Primary: #C10614 (Flavyo Red)
  • Surface: Warm off-white backgrounds with red/amber accents
  • Dark Mode: Full dark theme with appropriate contrast
  • Typography: Poppins app-wide, Covered By Your Grace only for Flavyo branding wordmark
  • System Theme: Automatic light/dark switching based on platform preference

πŸ“„ License

This project is proprietary software. All rights reserved.


Made with ❀️ for Flavyo Ice Cream

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages