How shawaiz-project/agrismart-mobile-and-web-app-v1 works
AgriSmart is an agricultural management and commerce platform: farmers and buyers use the Expo app to manage farms and crops, monitor crop health and conditions, consult AMIS prices, and transact in the marketplace; administrators operate a permission-gated console. The mobile API client connects those workflows to the Express API, which owns authorization and PostgreSQL business data. Mobile SQLite supports offline caches and queued mutations. Major API dispatch is visible in app.js; detailed wiring for unsampled route modules and offline synchronization is not shown, so those links are kept at subsystem level.
Main entry points: app.js REST API router · _layout.jsx Mobile navigation · client.js API client · pool.js PostgreSQL
Components 24
Mobile app
- Mobile navigation
mobile/src/app/_layout.jsx - Sign-in and onboarding
mobile/src/app/(public)/login.jsx - Admin console
mobile/src/app/(admin)/_layout.jsx - API client
mobile/src/api/client.js
Farm intelligence
- Farm and crop screens
mobile/src/app/(app)/(tabs)/farms.jsx - Disease scanning
mobile/src/app/(app)/scan/index.jsx - Weather and prices
mobile/src/app/(app)/weather/index.jsx - Farms and crops
backend/src/routes/farms.js - AI crop analysis
backend/src/routes/ai.js - Weather and AMIS
backend/src/routes/market-prices.js
Marketplace and plans
- Marketplace and orders
mobile/src/app/(app)/marketplace/index.jsx - Subscriptions
mobile/src/app/(app)/subscription/index.jsx - Listings and orders
backend/src/routes/marketplace.js - Plans and entitlements
backend/src/routes/subscriptions.js
API and administration
- REST API router
backend/src/app.js - Identity and OTP
backend/src/routes/auth.js - Admin operations
backend/src/routes/admin.js
Platform state
- Offline cache and outbox
mobile/src/db/client.js - PostgreSQL
backend/src/db/pool.js
Other components
- Farmers and buyers
- Administrators
- AI provider
- Weather provider
- AMIS source
Connections 34
- Farmers and buyers → Mobile navigation: uses
- Administrators → Admin console: uses
- Mobile navigation → Sign-in and onboarding: navigates
- Mobile navigation → Farm and crop screens: navigates
- Mobile navigation → Disease scanning: navigates
- Mobile navigation → Weather and prices: navigates
- Mobile navigation → Marketplace and orders: navigates
- Mobile navigation → Subscriptions: navigates
- Sign-in and onboarding → API client: requests
- Farm and crop screens → API client: requests
- Disease scanning → API client: requests
- Weather and prices → API client: requests
- Marketplace and orders → API client: requests
- Subscriptions → API client: requests
- Admin console → API client: requests
- Farm and crop screens → Offline cache and outbox: caches offline
- Marketplace and orders → Offline cache and outbox: queues offline
- API client → REST API router: HTTP requests
- REST API router → Identity and OTP: dispatches
- REST API router → Farms and crops: dispatches
- REST API router → AI crop analysis: dispatches
- REST API router → Weather and AMIS: dispatches
- REST API router → Listings and orders: dispatches
- REST API router → Plans and entitlements: dispatches
- REST API router → Admin operations: dispatches
- Identity and OTP → PostgreSQL: queries
- Identity and OTP → AI provider: sends OTP email
- Farms and crops → PostgreSQL: stores records
- AI crop analysis → AI provider: requests analysis
- Weather and AMIS → Weather provider: gets forecasts
- Weather and AMIS → AMIS source: syncs prices
- Listings and orders → PostgreSQL: stores transactions
- Plans and entitlements → PostgreSQL: stores plans
- Admin operations → PostgreSQL: manages records