Skip to content

Latest commit

Β 

History

History
168 lines (110 loc) Β· 3.81 KB

File metadata and controls

168 lines (110 loc) Β· 3.81 KB

KMFI-Web

A web portal for the Kenya Miller Fortification Index (KMFI), developed and maintained by TechnoServe. This application facilitates self-assessments, score tracking, and data reporting for food fortification compliance across Kenya's milling sector.


🌐 Live Site

https://selfassessment.kmfi-ke.org


πŸ“¦ Repository

GitHub - TechnoServe/KMFI-Web


πŸš€ Features

  • Secure user authentication
  • Role-based access for admins, millers, and TNS reviewers
  • Dynamic SAT (Self-Assessment Tool) forms
  • Score computation and IVC data management
  • Commenting and approval workflows
  • Real-time updates via Firestore
  • Google Sheets integration (restricted to admin)

πŸ› οΈ Tech Stack

  • Frontend: React.js
  • Backend: Node.js 20 (Firebase Functions)
  • Functions Runtime: nodejs20
  • Database: Firestore (NoSQL)
  • Authentication: Firebase Auth
  • Storage: Firebase Cloud Storage
  • Email Service: Brevo SMTP
  • Deployment: Firebase Hosting

πŸ”„ Old vs Current Setup (KMFI)

Area Old Setup Current Setup
Functions Runtime nodejs18 nodejs20
Local Node Version Node 18.x Node 20.18.2
Firebase CLI Unpinned v15.4.0 (required)
Deployment Model Firebase Functions (Gen 1) Firebase Functions (Gen 1, upgraded runtime)
Architecture Shared legacy assumptions KMFI-isolated logic & database
Authentication Firebase Auth (basic roles) Firebase Auth (KMFI-specific access control)

This upgrade modernizes the KMFI platform, improves security and performance, and aligns it with Firebase’s supported runtimes while maintaining backward compatibility with existing Gen 1 Functions.


🧩 Architecture Overview

See the full architecture diagram below and in docs/architecture.

KMFI Architecture


πŸ“ Project Structure

KMFI-Web/
β”œβ”€β”€ frontend/          # React-based frontend
β”œβ”€β”€ functions/         # Firebase Functions backend (Node.js)
β”œβ”€β”€ docs/              # Architecture & technical documentation
β”œβ”€β”€ docs/architecture/ # Architecture diagrams
β”œβ”€β”€ .firebaserc        # Firebase project config
└── README.md

βš™οΈ Local Development

  1. Clone the repository:

    git clone https://github.com/TechnoServe/KMFI-Web.git
    cd KMFI-Web
  2. Install dependencies:

    • Frontend:

      cd frontend
      npm install
    • Backend:

      cd ../functions
      npm install
  3. Use correct Node version:

    nvm use 20.18.2

    Make sure you're using Firebase CLI version 15.4.0:

    firebase --version
    # If needed, install a specific version:
    npm install -g [email protected]
  4. Start development servers:

    • Frontend:

      firebase serve --only hosting
    • Backend (in root):

      firebase emulators:start

πŸ” Environment Setup

  • Create .env in both frontend/ and functions/ with necessary variables.
  • Important: Do not commit sensitive files like auth-google-sheets.json.

πŸ§ͺ Testing

To be implemented.


πŸ“„ Documentation

Formal PDF/Word exports are available for client handover.


πŸ“„ License

MIT License – see LICENSE file for details.


πŸ“ž Contact

For questions or support, reach out to the TechnoServe Digital team.