System Architecture
To build a scalable platform for rural development, one must consider the flow of data from the end-user to the backend services. The following architecture provides a blueprint for managing user profiles, field projects, and communication channels.
Frontend (React + Vite)
↓
API Gateway (Base44 / Express)
↓
Auth Service | Listings Service | Chat Service
↓
Database (MongoDB)
Users | Projects | ChatRooms | Messages
Database Schema
Users Collection
| Field | Type | Description |
|---|---|---|
| String | Required, unique | |
| phone | String | For WhatsApp/SMS alerts |
| full_name | String | Required |
| user_type | Enum | farmer, sponsor, admin |
| language | Enum | pt, en |
| kyc_verified | Boolean | Default false |
| kyc_documents | Array | ID/verification uploads |
| rating | Number | Community-based score |
| online_status | Enum | online, away, offline |
| notification_prefs | Object | email, sms, whatsapp, push |
AgriculturalProjects Collection
| Field | Type | Description |
|---|---|---|
| user_id | ObjectId | Project owner |
| title | String | Project name or ID |
| status | Enum | draft, pending, active, completed |
| crop_type | Enum | maize, beans, groundnuts, soy, other |
| province | Enum | Zambezia, Nampula, etc |
| verification_status | Boolean | Verified by MBC |
| verification_docs | String | Receipt and photo metadata |
| area_hectares | Number | Land size cultivated |
| harvest_cycle | Date | Expected maturity date |
| community_fund_id | ObjectId | Reference to repayment pool |
| site_photos | Array | Image URLs from the field |
| description | String | Rich text detail |
| views | Number | Engagement metrics |
| impact_metrics | Number | Yield improvements documented |
ChatRooms Collection
| Field | Type | Description |
|---|---|---|
| project_id | ObjectId | Reference to specific project |
| sender_id | ObjectId | User ID |
| recipient_id | ObjectId | User ID |
| status | Enum | active, closed, archived |
| participants | Array | Multi-party support |
| last_message_at | Date | For sorting conversations |
| last_message_preview | String | First 100 characters |
| unread_count | Number | Badge counter |
| category | Enum | support, general, updates |
Messages Collection
| Field | Type | Description |
|---|---|---|
| chat_room_id | ObjectId | Reference to chat room |
| sender_id | ObjectId | User ID |
| type | Enum | text, file, image, voice, system |
| text | String | Message content |
| original_language | String | "pt", "en" |
| translations | Object | Auto-translated content |
| file_url | String | URL for document or image |
| file_name | String | Original filename |
| file_type | String | MIME type |
| voice_url | String | URL for audio messages |
| read_by | Array | User IDs who viewed message |
| deleted | Boolean | Soft delete support |
The Nature of the Harvest
Agriculture as the engine of wealth: ten great books on farming, land, seed, water, risk and innovation, and who funds agriculture in Mozambique.
PDF ebook, instant download. $5 of every copy buys seed for a farmer.
API Endpoints
Authentication
POST /api/auth/register # Create account
POST /api/auth/login # Login
POST /api/auth/verify-kyc # Upload documentation
GET /api/auth/me # Get profile
PUT /api/auth/me # Update profile
Agricultural Projects
GET /api/projects?crop_type=maize®ion=zambezia
GET /api/projects/:slug # Project details
POST /api/projects # Create listing
PUT /api/projects/:id # Update listing
DELETE /api/projects/:id # Delete
POST /api/projects/:id/verify # Admin: verify field location
POST /api/projects/:id/favorite # Add to watchlist
GET /api/projects/map # Geo-coordinates for map view
Chat Rooms
GET /api/chat/rooms # User's chat rooms
POST /api/chat/rooms # Create room
GET /api/chat/rooms/:id # Room details
PUT /api/chat/rooms/:id # Close/archive
POST /api/chat/rooms/:id/participants # Add field verifier
Messages
GET /api/chat/rooms/:id/messages?limit=50
POST /api/chat/rooms/:id/messages # Send message
PUT /api/chat/messages/:id # Edit message
DELETE /api/chat/messages/:id # Delete message
POST /api/chat/messages/:id/read # Mark read
POST /api/chat/messages/:id/translate # Translate
POST /api/chat/upload # Upload receipt/photo
Sponsorship Deals
GET /api/deals # List user's sponsorships
GET /api/deals/:id # Sponsorship details
POST /api/deals # Create from chat
PUT /api/deals/:id # Update status
POST /api/deals/:id/milestone # Complete verification
POST /api/deals/:id/confirm # Receipt confirmed
POST /api/deals/:id/rate # Rate experience
Impact on the Farmer's Season
For a smallholder farmer working with the COJAZ cooperative in Zambezia, these technical systems bridge the gap between their labor and international support. During the season, accurate digital logging ensures that funds reach the local seed and fertilizer shops exactly when needed. By tracking field verification and documentation through these endpoints, the farmer gains transparency, ensuring the integrity of the support system that helps them prepare their soil and secure a successful harvest.
Frequently asked questions
What is an API endpoint? An API endpoint is a specific digital location where an application sends requests to retrieve or update data, such as project listings or message histories.
Why is database schema important? It defines the structure of information, such as how user profiles and project details are organized, ensuring the platform runs reliably.
How does real-time messaging improve project management? Real-time communication allows for rapid coordination between stakeholders, ensuring that documents like field photos and receipts are shared and translated efficiently.
Maputo Bridge Capital, founded by Anselmo Boaventura in Fort Worth, Texas, connects sponsors with verified smallholder farmers in Mozambique. You can sponsor a farmer from just $25 at https://maputobridgecapital.com/sponsor-a-farmer-mozambique. Please note that sponsorships are gifts, not investments, and are not tax-deductible; 92% of your contribution goes directly to the farmer's local seed and fertilizer shop, while 8% covers verification and documentation.