B2B Stock & Order Management for Ice Cream Distribution
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.
- 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
- 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
- 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
- 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
- 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
- Distributor KPIs β revenue, order volume, inventory metrics
- Real-time dashboard updates via Supabase channels
- Live inventory and order status propagation via Supabase Realtime
- Instant updates across all connected clients
- Firebase Cloud Messaging integration
- Local notification support via
flutter_local_notifications - Per-user notification preferences
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 |
| 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 |
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.
- Flutter SDK on the
mainchannel (Dart^3.12.0) - A Supabase project
- Firebase project (for push notifications)
- Google OAuth credentials (Web + iOS client IDs)
-
Clone the repository
git clone https://github.com/AmanSikarwar/flavyo.git cd flavyo -
Create a
.envfile 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
-
Install dependencies
flutter pub get
-
Run code generation
dart run build_runner build --delete-conflicting-outputs
-
Generate localization code (slang)
dart run slang
Localization source files live under
lib/i18n/*.i18n.jsonand are configured byslang.yaml. -
Apply database migrations Run the SQL files in
supabase/migrations/in order against your Supabase project. -
Run the app
flutter run
The repository now includes a production-ready GitHub Actions workflow at:
.github/workflows/flutter_ci_cd.yml
- Runs static analysis and tests on every push to
mainand every pull request targetingmain - 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.
- 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.
Set these repository secrets in Settings β Secrets and variables β Actions:
SUPABASE_URLSUPABASE_ANON_KEYGOOGLE_WEB_CLIENT_IDGOOGLE_IOS_CLIENT_ID
If secrets are not set, CI falls back to placeholder values so compile-only checks can still run.
git tag v0.1.0
git push origin v0.1.0This creates a GitHub Release with both Android and iOS build artifacts attached.
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
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
This project is proprietary software. All rights reserved.
Made with β€οΈ for Flavyo Ice Cream
