OPAS (Online Place for Agricultural Services)
A role-based agricultural commerce platform that connects buyers, sellers, and administrators in one system. It streamlines product discovery, seller onboarding, regulated marketplace operations, and data-driven demand and price forecasting.
Core Objectives
Authentication & Onboarding
Phone-based sign up and login
Users create accounts and authenticate with a phone number and password instead of email-first credentials.
Role-based routing
After login, the app reads the stored role and sends the user to the buyer, seller, or admin experience automatically.
Seller upgrade application
Buyers can submit a seller application with farm and store details to begin the approval process.
Session persistence
Tokens and profile data are stored locally so the app can restore the user session after restart.
Buyer Marketplace & Orders
Category-first browsing
The home screen loads live agricultural categories so buyers can jump into vegetables, fruits, livestock, and more.
Featured product discovery
The app shows recent products in a curated grid so users can quickly spot active listings.
Search and filters
Buyers can search products and move into filtered product list screens for faster discovery.
Cart and checkout flow
Users can add items to a persistent cart and continue into the checkout workflow.
Order history tracking
Buyers can review past purchases and follow the status of their orders from one place.
Seller & Admin Operations
Seller dashboard and profile
Sellers get a dedicated layout for managing their store, profile, and operational tasks.
Product and stock management
Sellers can add listings, edit products, and update inventory levels when stock changes.
Forecast insights
Seller-side forecasting screens surface demand trends and stock recommendations based on historical data.
Seller approval and compliance
Admin tools handle pending sellers, document checks, price ceilings, and marketplace violations.
Notifications and audit trails
The platform keeps users informed through notifications while admin actions are recorded in immutable audit logs.
Architecture & Processing Flow
1. The user signs up or logs in through the Flutter client, which sends credentials to the Django authentication endpoints.
2. The backend validates the request, issues JWT tokens, and returns role and profile data for the account.
3. The Flutter app stores session data in SharedPreferences, initializes local storage and notifications, then routes the user based on role.
4. Buyer, seller, and admin screens call dedicated API services that talk to Django REST viewsets for products, orders, approvals, alerts, and analytics.
5. Django applies permissions, business rules, and model constraints before persisting data to PostgreSQL and serving cached or media-backed responses.
6. For forecasting, historical transactions are aggregated, cleaned, model-selected, forecasted, saved, and checked for stale or low-confidence results.
The front end is organized around thin role-specific shells rather than a single overloaded interface. main.dart bootstraps local storage, SQLite support, Firebase, and notifications before handing control to AuthWrapper, which keeps the initial route decision simple and deterministic. From there, separate layouts for buyers, sellers, and admins isolate user experiences while shared service classes keep network logic out of the widgets.
The backend uses a deliberately split data model to separate live marketplace activity from forecasting data. SellerProduct and OPASProduct serve different jobs, with the first representing active marketplace listings and the second representing OPAS-managed forecasting records. Forecast generation is robust by design: ForecastingService validates the data, ModelSelector chooses SARIMA, ARIMA, or SIMPLE based on sample size and variance, and fallback managers prevent the system from failing hard when a complex model cannot be trained.
Project Impact
OPAS revolutionizes agricultural commerce by directly resolving the chronic disconnect between local farmers, broadscale consumers, and regulatory oversight. By providing a unified, role-based digital marketplace, it circumvents exploitative middleman chains, allowing buyers to access fresh produce while giving sellers fairer pricing authority.
For marketplace administrators, the application serves as a robust regulatory utility equipped with sophisticated statistical foresight. Its built-in SARIMA/ARIMA forecasting models intelligently analyze transaction histories to predict demand spikes and stock depletion, preemptively alerting the community to major market shifts.
Ultimately, OPAS stabilizes the agricultural economy at a local level. By blending seamless mobile transactions with aggressive predictive planning and strict vendor governance, it ensures a resilient supply chain, empowering both farming livelihoods and consumer accessibility simultaneously.