Complete User Guide β Admin Portal & Android App
GoldLeaf is a complete farm management platform with two interfaces that share the same data:
| Interface | URL / Access | Purpose | Who Uses It |
|---|---|---|---|
| Admin Portal | Web browser at https://api.goldleaflabs.co.ke/ | Manage all farmers, farms, crops, lab tests, blockchain, and system configuration | Farm managers, administrators, field officers, lab technicians |
| Android App | Install on farmer's Android device | Daily farm operations: crop tracking, planning, compliance, soil tests, weather, AI advisory | Farmers and field workers in the field |
Access at https://api.goldleaflabs.co.ke/. The admin portal has 16 sections accessible from the left sidebar.
Normal Login: Enter your email and password, then click Sign In. If 2FA is enabled, enter the OTP sent to your registered phone.
Demo Mode: Add ?demo=jonathan to the URL to bypass login and explore the portal with sample data. Example: https://api.goldleaflabs.co.ke/?demo=jonathan. A yellow banner at the top confirms Demo Mode is active.
The first page you see after login. It shows a wallet card for Ethereum blockchain integration:
Below the wallet, the dashboard used to display stats cards (Total Farmers, Total Farms, etc.) β these have been moved to the Statistics page.
Manage all registered farmers. This is the main tool for reviewing and approving farmer accounts.
What you see:
Review Button (Action column): Click to open the farmer review modal:
View all registered farms across all farmers.
What you see:
Farm Details Modal (comprehensive view):
Geographic visualization of all farms on an interactive Leaflet map.
The central catalog of all crop types that farmers can plant.
Manage field officers who oversee farms and verify data on the ground.
Two tabs under this section: Lab Tests and Batches.
Configure the crop growth pipeline stages. These define the stages a crop passes through from planning to harvest.
Visual kanban board showing all crops organized by their current pipeline stage. Drag-and-drop is not supported β click the Advance button to move a crop forward.
Track each batch's lifecycle through four blockchain-recorded stages:
View all seasonal plans created by farmers across all farms. Farmers create these from the Android app.
Filter card: Narrow down by:
Table: Title, Farmer, Farm, Event Type, Season, Start Date, Status (color badge), Last Synced
View all compliance checklist items created by farmers. Tracks regulatory and certification requirements.
Filter card:
Table: Item, Farmer, Farm, Category (badge), Status (color badge), Evidence (link button if URL provided), Due Date, Last Synced
View all soil test records synced from farmers' Android apps.
Filter card:
Table: Date, Farmer, Farm, Soil Type, pH, N (Nitrogen ppm), P (Phosphorus ppm), K (Potassium ppm), Lab Name
View farm subdivisions (plots/sections) created by farmers and their crop rotation history.
Filter card: Farmer, Farm, Search (plot name)
Table:
Aggregated statistics for the entire system:
Track crop deliveries from farmers. The admin confirms what was actually received versus what the farmer declared.
Flow:
Table columns: Date, Farmer, Declared, Confirmed, Reject (badge), Grade, Batch Code, Notes
Filters: Farmer dropdown
Record sales of product batches to buyers. This is how trade income is tracked for calculating farmer payments.
Record Sale:
Table columns: Date, Batch Code, Buyer, Qty Sold, Unit Price, Total, Notes
Rate calculation: When paying farmers, the system calculates: Rate = Total Sale Amount Γ· Total Declared Kg (across all farmers for that batch). Each farmer's gross pay = Their declared Kg Γ Rate.
Initiate M-PESA payments to farmers. The system calculates the payment based on declared harvest, sale rate, and deductions.
Table columns: Date, Farmer, Gross, Deductions, Net, M-PESA Phone, Status (badge), Transaction ID
Filters: Farmer dropdown, Status dropdown (All / Pending / Success / Failed)
.env file: MPESA_CONSUMER_KEY, MPESA_CONSUMER_SECRET, MPESA_SHORTCODE, MPESA_INITIATOR_NAME, and MPESA_INITIATOR_PASSWORD. Use the sandbox environment for testing.
The admin dashboard now shows actionable alerts and summary statistics at a glance.
Red badges appear next to sidebar links showing counts that need attention:
Badges auto-refresh every 60 seconds.
The mobile app is installed on the farmer's Android device. It works offline-first β all data is saved locally and syncs to the server.
The main screen after login. Contains:
Farm details (name, GPS location, soil type) can be edited from the farm details screen. Changes are synced to the server.
Inside Crop Details, a horizontal slider shows all pipeline stages with the current stage highlighted:
Plan your farming activities across seasons.
Track checklist items related to farm certifications, safety, environmental, and quality standards.
Record and view soil test history for your farm.
Divide your farm into named sections (plots) to track what's planted where and manage crop rotation.
Track farming inputs (seeds, fertilizer, pesticides) used for each crop.
AI-powered advisory dashboard with multiple tools.
POST /v1/sync/uploadGET /v1/sync/download| Data Type | Direction | Frequency |
|---|---|---|
| Farmers, Farms, Crops | Two-way | On every sync |
| Tasks, Growth Stages | Two-way | On every sync |
| Seasonal Plans | Android β Server (dedicated endpoint) | After each local change |
| Compliance Checklist | Android β Server (dedicated endpoint) | After each local change |
| Soil Tests | Android β Server (dedicated endpoint) | After each local change |
| Farm Plots | Android β Server (dedicated endpoint) | After each local change |
| Weather Data | Server β Android (read-only) | On demand |
| Pipeline Stages | Server β Android (read-only) | On app start |
| Blockchain Records | Server β Android (read-only) | On demand |
| Role | Who | Android Access | Admin Portal Access |
|---|---|---|---|
| Admin | Farm manager / system admin | β | Full access to all sections |
| Farmer | Basic account (newly registered) | Dashboard, My Crops, Weather, Advisory, Training, Profile | β |
| Verified Farmer | Approved farmer with additional features | All Farmer features + Farm Fencing, Pest/Disease Detection, Certification, Quality, Consumer Verification | β |
| Field Officer | Extension officer / field data collector | Limited (managed in Admin Portal) | View-only access to assigned data |
Or if rejected by admin: π΄ Rejected (cannot log in)
| Problem | Likely Cause | Solution |
|---|---|---|
| App shows "Malformed JSON" error | Server returned a non-JSON response (PHP error) | Check the admin portal API status. The server should return 200 with valid JSON. If this persists, contact support |
| "Account rejected" on login | Admin has set your status to Rejected | Contact your farm manager or admin to reinstate your account |
| "0 farms" on dashboard | No farms created yet, or sync hasn't completed | Add a farm from the dashboard, or check your internet connection and pull-to-refresh |
| Sync fails with "pending review" | Your account status is "Registered" | Wait for admin to approve your account (change to Active or Verified) |
| Location shows wrong place | GPS coordinates were incorrect when the farm was created | Edit the farm from the app and update the GPS location |
| Can't advance crop stage | No backward sliding β or crop is at terminal stage (Completed/Failed) | Only forward movement is allowed. Terminal stages cannot be advanced further |
| AI/Pest/Disease features not working | API keys for AI services not configured on the server | Ask admin to set up OpenAI, Gemini, or Plant.id API keys on the server |
| Problem | Likely Cause | Solution |
|---|---|---|
| Page does not load | Server error or PHP issue | Check the server error logs. Try ?demo=jonathan to verify the page itself works |
| Data not showing / empty tables | No data synced yet, or filter is active | Clear filters and try again. Verify farmers have synced data from the Android app |
| "Failed to load farmer details" | Server endpoint error | The admin API is returning an error. Check the browser console for the exact error message |
| Map shows markers in wrong location | Incorrect GPS coordinates stored for farms | The farmer needs to correct the farm location from their Android app |
| Can't see new Seasonal Plans / Compliance / Soil data | Farmers haven't synced yet, or filters are applied | Check the Last Synced column. Reset all filters and search |
| Error | Meaning | Fix |
|---|---|---|
Call to undefined method mysqli_stmt::get_result() | Server PHP has no mysqlnd extension | Install mysqlnd PHP extension, or upload the fixed controllers that use sqlFetchRow() instead |
Class "AfricasTalking..." not found | Missing Composer dependency | Run composer require africastalking/africastalking on the server |
Commands out of sync | MySQLi statements not closed before reusing | This was fixed in the latest code β upload the updated controller files |
GoldLeaf Farm Management Platform β User Guide v1.0
Last updated: June 2026