A comprehensive Flutter application that connects customers with multiple food vendors for seamless food ordering and delivery management.
Dine is a sophisticated food delivery platform that supports multiple vendors, real-time order management, and comprehensive analytics. The app consists of two main interfaces:
- Customer App: Browse menus, place orders, and track delivery
- Vendor Dashboard: Manage orders, menu items, and view business analytics
- Multi-Vendor Browsing: Browse food items from multiple vendors in one app
- Smart Search: Search across vendors and menu items with unified results
- Category Filtering: Filter by food categories (meals, drinks, desserts, snacks)
- Shopping Cart: Add items from different vendors to cart
- Order Placement: Simple order form with delivery options
- Real-time Updates: Live order status updates
- Vendor Authentication: Secure code-based login system
- Menu Management: Add, edit, and manage menu items with images
- Order Management: View and update order statuses in real-time
- Business Analytics: Comprehensive dashboard with revenue tracking
- Order Statistics: Track pending, ready, and completed orders
- Popular Items: View top-selling menu items
- Live Updates: Supabase real-time subscriptions for instant updates
- Order Synchronization: All clients receive real-time order changes
- Status Updates: Instant order status changes across devices
- Frontend: Flutter (Dart)
- Backend: Supabase (PostgreSQL + Real-time)
- State Management: Riverpod with AsyncNotifier
- Image Storage: Supabase Storage
- Authentication: Custom vendor code system
lib/
βββ components/
β βββ store/ # Customer-facing screens
β β βββ views/ # Store, cart, order forms
β β βββ data/ # Models, repositories, data sources
β β βββ provider/ # Riverpod providers
β βββ vendor/ # Vendor dashboard
β βββ views/ # Analytics, orders, menu management
β βββ data/ # Vendor-specific data handling
βββ core/ # Core services and utilities
β βββ services/ # Storage, real-time, error handling
β βββ theme/ # App styling and colors
β βββ router/ # Navigation and routing
βββ main.dart # App entry point
UI Layer (Screens)
β
Provider Layer (Riverpod)
β
Repository Layer (Business Logic)
β
DataSource Layer (API Calls)
β
Supabase Backend
- Flutter SDK (3.0+)
- Dart SDK (3.0+)
- Supabase account and project
- Android Studio / VS Code
-
Clone the repository
git clone https://github.com/yourusername/dine.git cd dine -
Install dependencies
flutter pub get
-
Configure Supabase
- Create a new Supabase project
- Get your project URL and anon key
- Update
lib/core/constants.dartwith your credentials
-
Set up environment variables
// lib/core/constants.dart class SupabaseConstants { static const String url = 'YOUR_SUPABASE_URL'; static const String anonKey = 'YOUR_SUPABASE_ANON_KEY'; }
-
Run the app
flutter run
vendors (
id: uuid PRIMARY KEY,
name: text,
description: text,
location: text,
image_url: text,
is_open: boolean,
code: text UNIQUE,
tags: text[],
created_at: timestamp
)menu_items (
id: uuid PRIMARY KEY,
vendor_id: uuid REFERENCES vendors(id),
name: text,
description: text,
price: decimal,
category: text,
image_url: text,
is_available: boolean,
tags: text[],
created_at: timestamp
)orders (
id: uuid PRIMARY KEY,
order_number: text,
vendor_ids: uuid[],
customer_name: text,
customer_phone: text,
customer_location: text,
notes: text,
items: jsonb,
order_statuses: jsonb,
created_at: timestamp,
total: text,
delivery_option: text
)-
Enable Real-time
-- Enable real-time for all tables alter publication supabase_realtime add table vendors; alter publication supabase_realtime add table menuItems; alter publication supabase_realtime add table orders; -
Row Level Security (RLS)
-- Enable RLS alter table vendors enable row level security; alter table menuItems enable row level security; alter table orders enable row level security;
-
Storage Policies
-- Allow public read access to images create policy "Public read access" on storage.objects for select using (bucket_id = 'images');
// lib/core/constants.dart
class AppConfig {
static const bool isProduction = false;
static const String appName = 'Dine';
static const String appVersion = '1.0.0';
}- Browse: View available vendors and menu items
- Search: Find specific foods or vendors
- Filter: Narrow down by categories
- Add to Cart: Select items from multiple vendors
- Checkout: Fill order form with delivery details
- Confirm: Receive order confirmation and number
- Track: Monitor order status updates
- Login: Authenticate with vendor code
- Dashboard: View order overview and analytics
- Orders: Manage incoming orders and update statuses
- Menu: Add/edit menu items and manage availability
- Analytics: Monitor business performance and revenue
- Colors: Consistent color palette with primary orange theme
- Typography: Clear hierarchy with readable fonts
- Spacing: Consistent 8px grid system
- Shadows: Subtle elevation for depth
- Gradients: Modern gradient backgrounds for key sections
- FeaturedFoodCard: Hero food item display
- CategoryCard: Food category selection
- ItemCard: Individual menu item display
- OrderCard: Order information display
- StatCard: Analytics metric display
- Vendor Codes: Unique codes for vendor access
- No Customer Accounts: Simplified customer experience
- Secure API: Supabase RLS policies
- Input Validation: Server-side validation for all inputs
- SQL Injection Prevention: Parameterized queries
- Image Upload Security: File type and size validation
- Revenue Tracking: Accurate vendor-specific revenue calculation
- Order Statistics: Pending, ready, and completed order counts
- Popular Items: Top-selling menu items analysis
- Category Breakdown: Menu category distribution
- Recent Performance: Latest order activity
- Total Revenue: Sum of completed orders (vendor portion only)
- Average Order Value: Mean order value for vendor items
- Order Trends: Historical order data analysis
- Menu Performance: Item popularity and sales metrics
- Local Filtering: Client-side filtering for better performance
- Image Caching: Efficient image loading and caching
- Lazy Loading: Load data as needed
- Real-time Updates: Efficient subscription management
- Provider Architecture: Scalable state management
- Repository Pattern: Clean separation of concerns
- Async Operations: Non-blocking UI operations
- Error Handling: Graceful error recovery
- Unit Tests: Core business logic testing
- Widget Tests: UI component testing
- Integration Tests: End-to-end flow testing
# Run all tests
flutter test
# Run specific test file
flutter test test/widget_test.dart
# Run with coverage
flutter test --coverage# Build APK
flutter build apk --release
# Build App Bundle
flutter build appbundle --release# Build iOS app
flutter build ios --release# Build web version
flutter build web --release- AsyncNotifier: For async data operations
- StateProvider: For simple state management
- Provider: For computed values
- Family Provider: For parameterized providers
// Data providers
final menuItemProvider = AsyncNotifierProvider<MenuItemNotifier, List<MenuItem>>();
final vendorProvider = AsyncNotifierProvider<VendorNotifier, List<Vendor>>();
final orderProvider = AsyncNotifierProvider<OrderNotifier, List<Order>>();
// Computed providers
final filteredMenuItemsProvider = Provider<List<MenuItem>>();
final vendorOrdersProvider = Provider.family<List<Order>, String>();
final vendorOrderStatsProvider = Provider.family<Map<String, int>, String>();- Database: PostgreSQL with real-time subscriptions
- Storage: Image upload and management
- Auth: Custom vendor authentication system
- Real-time: Live data synchronization
- Fetch: Initial data loading from Supabase
- Subscribe: Real-time subscription setup
- Update: Local state updates on changes
- Sync: Automatic data synchronization
- Check Supabase real-time configuration
- Verify subscription setup in providers
- Ensure proper error handling
- Verify Supabase storage bucket configuration
- Check file size and type restrictions
- Ensure proper storage policies
- Verify vendor ID matching
- Check order status mapping
- Ensure proper state management
// Enable debug logging
if (kDebugMode) {
print('Debug information');
}- Push Notifications: Order status updates
- Payment Integration: Online payment processing
- Customer Accounts: Order history and preferences
- Driver App: Delivery tracking and management
- Advanced Analytics: Business intelligence dashboard
- Multi-language Support: Internationalization
- Offline Support: Local data caching
- Performance Monitoring: App performance analytics
- Automated Testing: CI/CD pipeline
- Code Generation: Build-time optimizations
- Code Style: Follow Dart/Flutter conventions
- Architecture: Maintain clean architecture principles
- Testing: Write tests for new features
- Documentation: Update docs for API changes
- Fork the repository
- Create feature branch
- Make changes with tests
- Submit pull request
- Code review and merge
This project is licensed under the MIT License - see the LICENSE file for details.
- Flutter Team: For the amazing framework
- Supabase: For the backend infrastructure
- Riverpod: For state management solutions
- Community: For feedback and contributions
For support and questions:
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: support@dineapp.com
Built with β€οΈ using Flutter and Supabase