This Flutter app connects to a Django REST API backend with PostgreSQL database.
-
Install Dependencies
flutter pub get
-
Configure API Base URL
- Update
lib/config/api_config.dart - Change
baseUrlto your Django backend URL - Example:
http://your-domain.com/apiorhttp://localhost:8000/api
- Update
-
Run the App
flutter run
lib/
├── config/ # API configuration
├── models/ # Data models
├── services/ # API service classes
├── providers/ # State management providers
├── screens/ # UI screens
└── main.dart # App entry point
- User registration and login
- JWT token-based authentication
- Password reset functionality
- Profile management
- Create and manage farms
- Upload farm documents
- Track farm statistics
- Location-based farm search
- Track crop planting and growth
- Log farming activities
- Disease detection integration
- Crop analytics and insights
- Browse and search products
- Create product listings (vendors)
- Product reviews and ratings
- Location-based product search
- Course enrollment and progress tracking
- Educational content management
- Discussion posts and comments
- Community interaction features
The app uses the following services:
ApiService: Core HTTP client with JWT authenticationAuthService: Authentication operationsFarmService: Farm management operationsCropService: Crop management operationsProductService: Product marketplace operations
Uses Provider pattern for state management:
AuthProvider: User authentication stateFarmProvider: Farm data and operationsCropProvider: Crop data and operationsProductProvider: Product data and operations
- Django REST Framework
- PostgreSQL database
- JWT authentication
- File upload support
- CORS enabled for Flutter app
-
Backend Setup
- Set up Django backend with PostgreSQL
- Configure API endpoints
- Set up authentication
-
Flutter Development
- Update API configuration
- Test API integration
- Implement UI screens
-
Backend Deployment
- Deploy Django app to server
- Configure PostgreSQL database
- Set up environment variables
-
Flutter Deployment
- Update API base URL for production
- Build and deploy Flutter app
- Test end-to-end functionality
This document outlines the comprehensive screen architecture for all user roles in the AgriConnect application.
Primary Functions:
- Farm management and monitoring
- Crop tracking and management
- Disease detection and treatment
- Weather monitoring and alerts
- Learning and courses
- Community forum participation
- Selling products
Key Screens:
- Dashboard with farm overview
- Farm management (add, edit, view farms)
- Crop management (planting, growth tracking, harvesting)
- Disease detection camera
- Weather forecast and alerts
- Learning center and courses
- Community forum
- Product listing and selling
- Orders and sales management
Primary Functions:
- Product catalog management
- Order processing and fulfillment
- Inventory management
- Customer communication
- Sales analytics and reporting
Key Screens:
- Dashboard with sales overview
- Product catalog management
- Order processing and tracking
- Inventory management
- Customer management
- Sales analytics and reports
- Profile and business settings
Primary Functions:
- Platform management and oversight
- User management and verification
- Content moderation
- Analytics and reporting
- System configuration
- Support and help desk
Key Screens:
- Admin dashboard with platform overview
- User management (farmers, vendors, buyers)
- Content moderation (forum, products, courses)
- Analytics and reporting
- System settings and configuration
- Support tickets and help desk
- Verification and approval workflows
Primary Functions:
- Browse and search products
- Place orders and make payments
- Track orders and deliveries
- Rate and review products
- Manage favorites and wishlist
- Customer support
Key Screens:
- Product browsing and search
- Product details and reviews
- Shopping cart and checkout
- Order tracking and history
- Payment and billing
- Favorites and wishlist
- Customer support and help
lib/screens/
├── auth/ # Authentication screens
│ ├── login_screen.dart
│ ├── register_screen.dart
│ ├── forgot_password_screen.dart
│ └── verify_email_screen.dart
├── farmer/ # Farmer-specific screens
│ ├── dashboard/
│ │ ├── farmer_dashboard.dart
│ │ └── farm_overview_card.dart
│ ├── farms/
│ │ ├── farms_list_screen.dart
│ │ ├── add_farm_screen.dart
│ │ ├── farm_details_screen.dart
│ │ └── edit_farm_screen.dart
│ ├── crops/
│ │ ├── crops_list_screen.dart
│ │ ├── add_crop_screen.dart
│ │ ├── crop_details_screen.dart
│ │ ├── crop_activities_screen.dart
│ │ └── harvest_screen.dart
│ ├── disease_detection/
│ │ ├── disease_detection_screen.dart
│ │ ├── camera_screen.dart
│ │ └── detection_results_screen.dart
│ ├── weather/
│ │ ├── weather_dashboard.dart
│ │ ├── weather_forecast_screen.dart
│ │ └── weather_alerts_screen.dart
│ ├── learning/
│ │ ├── learning_dashboard.dart
│ │ ├── courses_list_screen.dart
│ │ ├── course_details_screen.dart
│ │ └── my_progress_screen.dart
│ ├── forum/
│ │ ├── forum_home_screen.dart
│ │ ├── create_post_screen.dart
│ │ ├── post_details_screen.dart
│ │ └── my_posts_screen.dart
│ ├── products/
│ │ ├── my_products_screen.dart
│ │ ├── add_product_screen.dart
│ │ ├── edit_product_screen.dart
│ │ └── product_analytics_screen.dart
│ └── sales/
│ ├── sales_dashboard.dart
│ ├── orders_received_screen.dart
│ ├── order_details_screen.dart
│ └── sales_analytics_screen.dart
├── vendor/ # Vendor-specific screens
│ ├── dashboard/
│ │ ├── vendor_dashboard.dart
│ │ └── sales_overview_card.dart
│ ├── products/
│ │ ├── product_catalog_screen.dart
│ │ ├── add_product_screen.dart
│ │ ├── edit_product_screen.dart
│ │ ├── product_analytics_screen.dart
│ │ └── inventory_management_screen.dart
│ ├── orders/
│ │ ├── orders_dashboard.dart
│ │ ├── pending_orders_screen.dart
│ │ ├── processing_orders_screen.dart
│ │ ├── order_details_screen.dart
│ │ └── order_fulfillment_screen.dart
│ ├── customers/
│ │ ├── customers_list_screen.dart
│ │ ├── customer_details_screen.dart
│ │ └── customer_communication_screen.dart
│ ├── analytics/
│ │ ├── sales_analytics_screen.dart
│ │ ├── product_performance_screen.dart
│ │ └── customer_analytics_screen.dart
│ └── settings/
│ ├── vendor_profile_screen.dart
│ ├── business_settings_screen.dart
│ └── payment_settings_screen.dart
├── admin/ # Admin-specific screens
│ ├── dashboard/
│ │ ├── admin_dashboard.dart
│ │ └── platform_overview_card.dart
│ ├── users/
│ │ ├── users_management_screen.dart
│ │ ├── farmers_management_screen.dart
│ │ ├── vendors_management_screen.dart
│ │ ├── buyers_management_screen.dart
│ │ ├── user_details_screen.dart
│ │ └── user_verification_screen.dart
│ ├── content/
│ │ ├── content_moderation_screen.dart
│ │ ├── forum_moderation_screen.dart
│ │ ├── product_moderation_screen.dart
│ │ ├── course_moderation_screen.dart
│ │ └── reported_content_screen.dart
│ ├── analytics/
│ │ ├── platform_analytics_screen.dart
│ │ ├── user_analytics_screen.dart
│ │ ├── sales_analytics_screen.dart
│ │ └── engagement_analytics_screen.dart
│ ├── settings/
│ │ ├── system_settings_screen.dart
│ │ ├── feature_flags_screen.dart
│ │ └── notification_settings_screen.dart
│ └── support/
│ ├── support_dashboard.dart
│ ├── support_tickets_screen.dart
│ ├── ticket_details_screen.dart
│ └── help_desk_screen.dart
├── buyer/ # Buyer-specific screens
│ ├── dashboard/
│ │ ├── buyer_dashboard.dart
│ │ └── featured_products_card.dart
│ ├── products/
│ │ ├── products_browse_screen.dart
│ │ ├── product_search_screen.dart
│ │ ├── product_details_screen.dart
│ │ ├── product_reviews_screen.dart
│ │ └── category_products_screen.dart
│ ├── cart/
│ │ ├── shopping_cart_screen.dart
│ │ ├── checkout_screen.dart
│ │ └── payment_screen.dart
│ ├── orders/
│ │ ├── my_orders_screen.dart
│ │ ├── order_details_screen.dart
│ │ ├── order_tracking_screen.dart
│ │ └── order_history_screen.dart
│ ├── favorites/
│ │ ├── favorites_screen.dart
│ │ ├── wishlist_screen.dart
│ │ └── recently_viewed_screen.dart
│ ├── profile/
│ │ ├── buyer_profile_screen.dart
│ │ ├── address_management_screen.dart
│ │ └── payment_methods_screen.dart
│ └── support/
│ ├── customer_support_screen.dart
│ ├── help_center_screen.dart
│ └── contact_us_screen.dart
├── shared/ # Shared screens across user roles
│ ├── profile/
│ │ ├── profile_screen.dart
│ │ ├── edit_profile_screen.dart
│ │ ├── settings_screen.dart
│ │ └── notifications_settings_screen.dart
│ ├── notifications/
│ │ ├── notifications_screen.dart
│ │ └── notification_details_screen.dart
│ ├── help/
│ │ ├── help_center_screen.dart
│ │ ├── faq_screen.dart
│ │ ├── contact_support_screen.dart
│ │ └── about_screen.dart
│ ├── search/
│ │ ├── global_search_screen.dart
│ │ └── search_results_screen.dart
│ └── common/
│ ├── loading_screen.dart
│ ├── error_screen.dart
│ ├── empty_state_screen.dart
│ └── confirmation_dialog.dart
├── home/ # Home screens
│ ├── home_screen.dart
│ └── welcome_screen.dart
└── splash_screen.dart # Splash screen
- Dashboard (Farm Overview)
- Farms Management
- Crops Management
- Disease Detection
- Weather
- Learning
- Forum
- My Products
- Sales
- Profile
- Dashboard (Sales Overview)
- Product Catalog
- Orders Management
- Customers
- Analytics
- Settings
- Profile
- Dashboard (Platform Overview)
- User Management
- Content Moderation
- Analytics
- System Settings
- Support
- Profile
- Dashboard (Featured Products)
- Browse Products
- Shopping Cart
- My Orders
- Favorites
- Profile
- Support
- Farm registration and management
- Crop planting and tracking
- Disease detection with AI
- Weather monitoring and alerts
- Educational content and courses
- Community forum participation
- Product listing and selling
- Sales analytics
- Product catalog management
- Order processing and fulfillment
- Inventory tracking
- Customer relationship management
- Sales performance analytics
- Business profile management
- Payment and billing
- Platform oversight and management
- User verification and approval
- Content moderation and quality control
- System analytics and reporting
- Feature flag management
- Support ticket management
- Platform configuration
- Product discovery and search
- Shopping cart and checkout
- Order tracking and history
- Product reviews and ratings
- Favorites and wishlist
- Customer support
- Payment management
- Phase 1: Core authentication and basic screens
- Phase 2: Farmer functionality (farms, crops, disease detection)
- Phase 3: Vendor functionality (products, orders, analytics)
- Phase 4: Buyer functionality (shopping, orders, reviews)
- Phase 5: Admin functionality (management, moderation, analytics)
- Phase 6: Advanced features and optimizations
This architecture ensures that each user role has a tailored experience with screens and functionality specific to their needs while maintaining consistency in design and user experience across the platform.