StockFlow is a Flutter app for small distributors and sales teams that need a simple way to manage products, customers, orders, and on-hand stock from one mobile workflow. The app uses Supabase for authentication, data storage, and multi-company isolation.
- Shows a dashboard with today's sales, order count, recent orders, and low-stock alerts
- Tracks products, pricing, units, and low-stock thresholds
- Manages customer records with search and edit flows
- Creates and reviews orders with pending and delivered states
- Tracks inventory through stock transactions and manual stock adjustments
- Keeps company data isolated through Supabase row-level security
- Flutter
- Riverpod and
riverpod_generator - GoRouter
- Supabase
- Freezed and
json_serializable
lib/
app/ App shell, routing, theme, configuration
core/ Shared widgets, utilities, errors, extensions
features/ Feature modules: auth, dashboard, customers, products, inventory, orders, settings
shared/ Cross-feature providers
scripts/ Local scripts such as company provisioning
supabase/ Database schema and migration files
flutter pub getThe app reads Supabase credentials from Dart defines in lib/app/config/app_config.dart.
Required values:
SUPABASE_URLSUPABASE_ANON_KEY
Apply supabase/migrations/20240001000000_initial_schema.sql to your Supabase project before running the app. This migration creates:
- company, user, customer, product, order, order item, and stock transaction tables
- row-level security policies for company isolation
- an inventory view for aggregated stock
- a signup trigger that creates the matching
public.usersprofile row
flutter run \
--dart-define=SUPABASE_URL=https://your-project.supabase.co \
--dart-define=SUPABASE_ANON_KEY=your-anon-keyThe repository includes scripts/provision_company.dart to create:
- a company
- an owner auth user
- the matching
public.usersprofile
Example:
cd scripts
dart pub get
dart run provision_company.dart \
--url https://your-project.supabase.co \
--key your-service-role-key \
--company "Acme Distribution" \
--email owner@acme.com \
--name "Owner Name" \
--password changeme123flutter analyze
dart run build_runner build --delete-conflicting-outputs
flutter test