CoopFlow AI

Empowering farmers with AI-powered financial freedom.

Inspiration

CoopFlow AI began with a personal realization that the people who produce much of our food are often served by financial systems that have not evolved with their needs.

After spending more than 25 years in the ICT industry, I returned to my home community in Nyamira County, Kenya, where I established a dairy farming enterprise and joined a rural cooperative society as a smallholder farmer. I expected the cooperative to be a trusted institution that would connect farmers to markets, finance, and essential services.

Instead, I encountered manual record keeping, delayed payments, limited financial transparency, and governance practices that made it difficult for members to fully trust or benefit from the cooperative.

As I visited other cooperatives across Nyamira County, I discovered these challenges were not unique. Many cooperatives faced the same operational inefficiencies, compliance burdens, and limited access to affordable digital financial services.

That experience inspired me to envision CoopFlow AI—an AI-powered financial operating system that can help cooperatives become more transparent, efficient, and financially inclusive while reducing transaction costs for the farmers they serve.

What it does

CoopFlow AI is a proposed multi-tenant Cooperative Financial Operating System designed to modernize cooperative governance, payments, compliance, and member services through artificial intelligence.

The platform will combine Google Gemini AI, regulated digital wallet integration, and interoperable payment infrastructure to help cooperatives transition from paper-based operations to intelligent, digital-first organizations.

Planned capabilities include:

  • AI-assisted member onboarding and identity verification.
  • Regulated digital wallets for faster produce payments.
  • Automated loan management with AI-supported credit insights.
  • Real-time governance and compliance monitoring.
  • Digital audit trails for cooperative leaders and regulators.
  • Smart payment routing across banks and mobile money to reduce transaction costs.
  • AI-powered financial guidance delivered in English, Kiswahili, and local languages.

Rather than replacing banks and mobile money providers, CoopFlow AI will act as an intelligent orchestration layer that connects existing financial systems and makes them easier for cooperatives and farmers to use.

How we shall build it

CoopFlow AI is currently being designed as a Google Cloud-native architecture, with the goal of creating a scalable, secure, and AI-first platform suitable for thousands of cooperatives across East Africa.

The planned technology stack includes:

  • Flutter for Android-first mobile applications.
  • Firebase Authentication for secure member access.
  • Firestore for real-time operational data.
  • Cloud Run for serverless backend services.
  • Gemini AI for intelligent assistants, document analysis, compliance support, and financial recommendations.
  • Google Drive for secure document management.
  • BigQuery for analytics and reporting.
  • API Gateway for secure integration with banks, payment service providers, and future Interledger Protocol (ILP) connectors.

The decision to build the platform around Google's AI ecosystem reflects the opportunity to make AI a core part of every workflow—from onboarding and governance to payments and decision support—rather than adding AI as an afterthought.

Challenges we ran into

Designing CoopFlow AI has highlighted several important challenges that will shape its development.

The platform must:

  • Integrate with regulated banking and payment ecosystems while remaining compliant.
  • Reduce farmers' dependence on costly cash withdrawals through digital alternatives.
  • Work reliably in rural areas with intermittent internet connectivity.
  • Support users with different levels of digital literacy through simple interfaces and voice-based AI.
  • Balance AI automation with transparency, accountability, and human oversight.
  • Scale across different cooperative sizes, sectors, and regulatory environments.

These challenges have reinforced the importance of designing technology that fits the realities of rural communities instead of expecting communities to adapt to technology.

Accomplishments that we're proud of

Although CoopFlow AI is still in development, several milestones give us confidence in the direction we're taking.

We're proud to have:

  • Identified a widespread problem through firsthand experience as a cooperative member.
  • Validated that these challenges extend across multiple cooperatives.
  • Developed a clear vision for an AI-native cooperative financial platform.
  • Designed a scalable Google Cloud architecture capable of supporting thousands of cooperatives.
  • Reimagined how regulated digital wallets, AI, and interoperable payments can work together to reduce transaction costs for farmers.

Perhaps the most meaningful accomplishment is transforming lived experience into a solution designed with cooperative members at the center.

What we learned

The discovery phase has taught us that financial inclusion is about much more than digitizing paperwork.

We learned that farmers need systems they can trust—systems that provide transparency, timely payments, affordable financial services, and clear accountability.

We also learned that cooperatives already possess valuable operational and financial data. When combined with AI, that data can help improve governance, strengthen lending decisions, reduce fraud, simplify compliance, and deliver personalized financial guidance to members.

Most importantly, we've learned that solutions become stronger when they are designed alongside the communities they are intended to serve.

What's next for CoopFlow AI

The next phase is to build and validate the first production-ready version of CoopFlow AI with real cooperatives in Kenya.

Our roadmap includes:

Phase 1 – Foundation

  • Build the core cooperative management platform.
  • Launch AI-assisted member onboarding.
  • Integrate regulated digital wallet functionality.
  • Enable faster produce payments.

Phase 2 – Intelligent Finance

  • Introduce AI-supported loan recommendations.
  • Deploy fraud detection capabilities.
  • Launch multilingual AI financial assistants.
  • Expand merchant and supplier digital payments.

Phase 3 – Regional Scale

  • Connect banks and mobile money providers through intelligent payment orchestration.
  • Enable interoperable cross-border payments across Kenya, Uganda, and Tanzania.
  • Provide regulators with real-time compliance dashboards.
  • Scale the platform to serve thousands of cooperatives across East Africa.

Our long-term ambition is to make CoopFlow AI the AI Financial Operating System for African Cooperatives, enabling millions of farmers to receive faster payments, access affordable financial services, strengthen cooperative governance, and build greater financial resilience through trusted, AI-powered institutions.

Built With

  • and-decision-support-for-cooperative-societies.-the-platform-will-use-google's-scalable-cloud-infrastructure-to-securely-connect-farmers
  • antigravity
  • api
  • authentication
  • banks
  • bigquery
  • cloud
  • compliance-support
  • cooperatives
  • drive
  • financial-guidance
  • financial-inclusion
  • firebase
  • firestore
  • flutter
  • gateway
  • gemini
  • google
  • interledger
  • messaging
  • run
  • storage
  • with-gemini-ai-serving-as-the-intelligence-layer-that-powers-governance
Share this project:

Updates

posted an update —

# CoopFlow Platform — Implementation Progress Report

**Document ID:** CF-PR-2026-09-06
**Generated On:** September 6, 2026
**Platform Version:** v0.1.0 Cloud Enterprise
**Repository:** `coopflow`
**Target Environment:** Multi-Tenant Cooperative Society Management & Financial Inclusion Architecture

---

## Executive Summary

CoopFlow is an enterprise-grade, multi-tenant digital core platform purpose-built for primary cooperatives, SACCOs (Savings and Credit Cooperative Organizations), producer marketing unions, and apex federations. The platform provides unified operational, agricultural, and financial workflows underpinned by PostgreSQL with Row-Level Security (RLS), NestJS modular backend architecture, and a double-entry financial posting engine.

This progress report provides an audit of all completed capabilities, in-progress modules, and scheduled backlog initiatives across all engineering specifications.

---

## Technical Stack & Architecture

- **Runtime & Language:** Node.js 22 LTS, TypeScript 5.8, NestJS 11
- **Database & Data Isolation:** PostgreSQL 15+ with Prisma ORM 7.10, Row-Level Security (RLS) tenant isolation (`app.tenant_id`)
- **Shared Contracts:** `@coopflow/contracts` (Amortization schedules, Zod validation schemas, loan calculators)
- **Caching & Ephemeral Sessions:** Redis / ioredis
- **Event Sourcing & Accounting:** Double-entry immutable journal posting engine with audit verification
- **User Experience:** Responsive multi-portal web dashboard (Super Admin, Cooperative Admin, Staff, Posting Engine, Treasury/Cash, Savings, Shares, Loans, Procurement)

---

## 1. Features Fully Implemented

### 1.1 Multi-Tenant Core & Domain Data Model
- **Prisma Schema Architecture (`prisma/schema.prisma`, `apps/api/prisma/schema.prisma`):**
- Multi-tenant tenant segregation (`Tenant`, `TenantConfig`, `PlanTier`).
- Hierarchical organization structure (`Organization`, `OrganizationUnit`, `OrganizationMember`, `Cooperative`).
- Cooperative sector taxonomy: Dairy, Coffee, Tea, Grain, SACCO, Housing, Transport, and Multi-purpose.
- Multi-currency support (Default KES) and fiscal year lifecycle configurations.
- **Append-Only Governance & Audit Trail:**
- `AuditLog` table capturing actor ID, organization, IP address, user-agent, entity state diffs, and cryptographic timestamps.

### 1.2 Identity, Authentication & Role-Based Access Control (RBAC)
- **Authentication Engine (`apps/api/src/auth`):**
- JWT Access Token and Refresh Token rotation mechanism.
- PBKDF2/Bcrypt password hashing with per-user salt.
- Multi-Factor Authentication (MFA) provisioning fields (`mfaEnabled`, `mfaSecret`).
- Account state management (`Active`, `Pending`, `Suspended`) and terms acceptance enforcement.
- **Granular RBAC Engine:**
- Database-backed roles (`Role`, `Permission`, `RolePermissionAssignment`, `UserRoleAssignment`).
- Scoped role assignments bound to specific organizational units (branches, buying centers).
- Module permissions covering `tenant`, `organization`, `member`, `savings`, `loans`, `inventory`, `cash`, and `accounting`.

### 1.3 Inventory & Warehouse Management (`apps/api/src/inventory`)
- **Stock Master & Locations:**
- Item catalog with unique item codes, Units of Measure (UoM), reorder points, and valuation methods (Weighted Average Cost / FIFO).
- Multi-warehouse hierarchy (central warehouses, agrovet stores, branch depots).
- **Material Movements & Guardrails:**
- Goods Receipt Notes (GRN) with cost capture.
- Stock issues with strict negative inventory prevention checks.
- Inter-branch and warehouse stock transfers with transit tracking.
- Maker-checker approval gates preventing self-approvals on inventory adjustments and write-offs.
- Batch, lot, and expiration tracking with proactive expiry alerts.
- Physical stock count reconciliation and variance computation.

### 1.4 Cash Management & Treasury Operations (`apps/api/src/cash`)
- **Teller & Cashier Tills:**
- Till opening, float assignment, cash drawer limits, and end-of-day closing reconciliation.
- Vault and petty cash drawer transfers.
- Over/shortage dispute tracking and teller balancing audits.

### 1.5 Savings & Deposit Management (`apps/api/src/savings`)
- **Deposit Products:**
- Compulsory member savings, non-withdrawable contractual savings, and call deposits.
- Account ledger balance tracking, minimum balance enforcement, and transaction history.
- Interest accrual engine for contractual interest calculation.

### 1.6 Shares & Equity Capital (`apps/api/src/shares`)
- **Share Capital Ledger:**
- Member share capital accounts, minimum statutory share thresholds, and certificate numbering.
- Share transfers between active members with board resolution tracking.
- Prorated annual dividend calculation workflows.

### 1.7 Loan Lifecycle & Credit Calculations (`apps/api/src/loans`, `@coopflow/contracts`)
- **Amortization Calculation Engine:**
- Deterministic mathematical models for both Flat Rate and Reducing Balance (Equal Principal & Equal Installment).
- Daily, monthly, and custom repayment schedule generation.
- Guarantor eligibility validation and loan-to-savings multiplier rules.
- Multi-stage approval state machine (`Draft` → `Submitted` → `Appraised` → `Approved` → `Disbursed` → `Repaying` → `Closed`).

### 1.8 Financial Posting Engine & General Ledger (`apps/api/src/posting`)
- **Double-Entry Ledger Architecture:**
- Standardized Chart of Accounts (Assets, Liabilities, Equity, Revenue, Expenses).
- Event-driven journal entry generation triggered by operational movements.
- Mathematical debit-equal-credit invariants and immutable batch posting.

### 1.9 Operational Portals & User Interface (`apps/api/src/app.service.ts`)
- **Single-Engine Web Management Console:**
- Super Admin Portal (Tenant provisioning, subscription tiers, platform metrics).
- Cooperative Admin Portal (Policies, branches, staff roles, governance).
- Staff Operations Portal (Intake, member servicing, cashiering).
- Posting Engine Interactive Console (Real-time journal inspection).
- Dedicated interactive management interfaces for Cash, Savings, Shares, Loans, and Procurement.
- Schema & SQL DDL Explorer.

---

## 2. Features Pending Implementation (Roadmap)

### 2.1 Agri-Procurement: Dairy Collection Management (`specs/011`, `specs/014`)
- [ ] Hardware integration drivers for digital weighing scales (RS-232 / USB / Bluetooth).
- [ ] Milk quality analysis capture (Density, Alcohol test, Fat & SNF percentage grading).
- [ ] Mobile thermal printer integration for immediate farmer delivery receipts.
- [ ] Bi-weekly and monthly payment settlement runs with automated deduction matrices (store inputs, agrovet loans, advances).

### 2.2 Agri-Procurement: Crop Aggregation & Warehousing (`specs/012`)
- [ ] Produce moisture content, grading, and foreign matter inspection logging.
- [ ] Electronic Warehouse Receipt (e-WRS) issuance with cryptographic signatures.
- [ ] Inventory lien pledging for input credit and commercial trade financing.
- [ ] Bulk aggregation lotting and buyer dispatch tracking.

### 2.3 Procurement & Vendor Lifecycle (`specs/008`)
- [ ] Electronic Request for Quotation (RFQ) distribution to verified vendors.
- [ ] Comparative quotation analysis matrices with scoring rubric.
- [ ] Automated 3-way matching between Purchase Orders, Goods Receipt Notes, and Invoices.
- [ ] Vendor performance rating and automated payable scheduling.

### 2.4 Shared Equipment & Fixed Asset Management (`specs/009`, `specs/017`)
- [ ] Cooperative machinery reservation schedules (tractors, harvesters, processing plants).
- [ ] Operator dispatch, hourly billing, and fuel consumption telematics.
- [ ] Fixed asset depreciation engines (Straight Line and Reducing Balance).
- [ ] Preventative maintenance ticketing and lifecycle disposal logs.

### 2.5 Automated Payments Hub & Telecom Rail Integrations (`specs/016`)
- [ ] Direct M-Pesa B2C integration for automated bulk member payouts (milk/crop deliveries, dividends, loan disbursements).
- [ ] M-Pesa C2B and STK Push integration for instant loan repayments and savings deposits.
- [ ] Bank EFT/RTGS payment file generation (Pesalink / ISO 20022).
- [ ] Real-time webhook transaction reconciliation and idempotent transaction retry queues.

### 2.6 Offline-First PWA & Mobile Client Interfaces
- [ ] Offline-first Progressive Web App (PWA) with background sync (IndexedDB) for remote rural buying stations.
- [ ] Member self-service mobile application (Flutter / React Native) for balance inquiries, mini-statements, and loan requests.
- [ ] USSD / SMS gateway fallback for non-smartphone cooperative members.

---

## 3. Workstream Implementation Matrix

Workstream Code Domain Area Target Specification Status Completion %
**WS-000** Platform Multi-Tenancy & Base RLS `specs/000-platform-foundation` **Completed** 100%
**WS-001** Member Master & KYC Management `specs/001-member-management` **Substantial** 85%
**WS-002** RBAC, Roles & Permission Security `specs/002-role-permission-management` **Completed** 100%
**WS-003** Savings Products & Deposit Engine `specs/003-savings-management` **Substantial** 80%
**WS-004** Loan Products & Credit Operations `specs/004-loan-management` **Substantial** 80%
**WS-005** Share Capital & Equity Ledger `specs/005-shares-management` **Substantial** 80%
**WS-006** General Ledger & Chart of Accounts `specs/006-general-ledger` **Substantial** 85%
**WS-007** Double-Entry Event Posting Engine `specs/007-posting-engine` **Completed** 95%
**WS-008** Formal Requisitions & Procurement `specs/008-procurement-management` **In Progress** 50%
**WS-009** Shared Agricultural Equipment `specs/009-shared-equipment-management` **Pending** 15%
**WS-010** Inventory & Agrovet Warehouse Mgmt `specs/010-inventory-management` **Completed** 100%
**WS-011** Dairy Collection & Milk Procurement `specs/011-dairy-collection-procurement` **Pending** 15%
**WS-012** Crop Aggregation & e-WRS Receipts `specs/012-crop-aggregation-management` **Pending** 10%
**WS-013** Cashier Tills & Treasury Management `specs/013-cash-management` **Substantial** 85%
**WS-014** Dairy Settlements & Advance Deductions `specs/014-dairy-collection-payments` **Pending** 15%
**WS-015** Unified Farmer Settlement Engine `specs/015-settlement-management` **Pending** 20%
**WS-016** Payments Hub & M-Pesa / Bank Gateway `specs/016-payments-hub` **Pending** 15%
**WS-017** Fixed Assets & Depreciation Engine `specs/017-asset-management` **Pending** 15%

---

Log in or sign up for Devpost to join the conversation.

Submission history