How truganic/client-farmer works
Farmer App Client is a React Native app for farmer onboarding and farm-activity management. Users enter through login or account registration, register farm details, then use a dashboard to log planting, inputs, and harvests or review history; the app also offers farmer-ID QR display and scanning. Screens use a shared API layer, which adds stored JWTs to signed requests and handles one refresh-and-retry path. Screen-to-API links are dashed where excerpts show imports but not the call sites; unsampled screen behavior is not assumed.
Main entry points: AppNavigator.js Stack navigation · config.js API client · LoginScreen.js Login · UserRegistrationScreen.js User registration
Components 16
Onboarding
- Login
src/screens/LoginScreen.js - User registration
src/screens/UserRegistrationScreen.js - Farm registration
src/screens/FarmRegistrationScreen.js
Farm Activity
- Dashboard
src/screens/HomeScreen.js - Input log
src/screens/InputLogScreen.js - Planting log
src/screens/PlantingLogScreen.js - Harvest log
src/screens/HarvestLogScreen.js - Activity history
src/screens/HistoryScreen.js - QR scanner
src/screens/QRScannerScreen.js
App Flow
- App root
App.js - Stack navigation
src/navigation/AppNavigator.js
Service Layer
- API client
src/api/config.js - Signed requests
src/auth/signedClient.js - Token storage
Other components
- Farmer
- API gateway
Connections 27
- Farmer → Stack navigation: opens app
README.md - App root → Stack navigation: renders
App.js - Stack navigation → Login: routes to
src/navigation/AppNavigator.js - Stack navigation → User registration: routes to
src/navigation/AppNavigator.js - Stack navigation → Farm registration: routes to
src/navigation/AppNavigator.js - Stack navigation → Dashboard: routes to
src/navigation/AppNavigator.js - Stack navigation → Input log: routes to
src/navigation/AppNavigator.js - Stack navigation → Planting log: routes to
src/navigation/AppNavigator.js - Stack navigation → Harvest log: routes to
src/navigation/AppNavigator.js - Stack navigation → Activity history: routes to
src/navigation/AppNavigator.js - Stack navigation → QR scanner: routes to
src/navigation/AppNavigator.js - Farmer → Login: signs in
README.md - Farmer → User registration: creates account
README.md - Farmer → Farm registration: registers farm
README.md - Farm registration → API client: submits registration
src/screens/FarmRegistrationScreen.js - Login → API client: requests auth
src/screens/LoginScreen.js - User registration → API client: requests signup
- Dashboard → API client: loads activity
src/screens/HomeScreen.js - Input log → API client: saves input
src/screens/InputLogScreen.js - Planting log → API client: saves planting
src/screens/PlantingLogScreen.js - Harvest log → API client: saves harvest
src/screens/HarvestLogScreen.js - Activity history → API client: loads history
src/screens/HistoryScreen.js - API client → Signed requests: sends signed request
src/api/config.js - API client → Token storage: reads tokens
src/api/config.js - API client → Token storage: updates tokens
src/api/config.js - Signed requests → API gateway: sends HTTP request
src/auth/signedClient.js - Farmer → QR scanner: scans code