A Firebase-powered web application built to support millers' self-assessment and nutrition tracking across organizations.
All technical documentation for the MFI platform is maintained in the /docs directory.
➡️ Start here: Documentation Index
This includes:
- Tech Training Manual
- Handover Technical Documentation
- Deployment Runbook
- Architecture diagrams and references
├── frontend # React-based frontend interface
├── functions # Firebase Cloud Functions (Node.js backend)
├── .husky # Git hooks (pre-commit linting)
├── package.json # Project metadata and scripts
- 🔐 Firebase Authentication
- ☁️ Firebase Functions for backend logic
- 🌐 React-based frontend
- ✅ Linting and formatting with ESLint + Prettier
- 🧪 Git hooks using Husky and Pretty-Quick
- 📤 One-step deployment to Firebase
- 🔐 Secure secrets management using Firebase Secrets
- 🗄️ Firestore (Native mode) for structured assessment data
| Script | Description |
|---|---|
npm run serve |
Serve Firebase locally in production mode |
npm run deploy |
Deploy app to Firebase |
npm run lint |
Run lint checks for frontend and functions |
npm run format |
Auto-format code with Prettier |
npm run husky:install |
Set up Git hooks |
npm run pull:deploy |
Pull from develop and deploy |
git clone https://github.com/TechnoServe/MFI-Web.git
cd MFI-main
npm installNote: This project requires Node.js v20.18.2. If you're using NVM:
nvm install 20.18.2
nvm use 20.18.2Firebase CLI Requirement: This project requires Firebase CLI v15.4.0.
Using npm (recommended):
npm install -g [email protected]Verify installation:
firebase --versionThe output should be:
15.4.0
⚠️ Using a different Firebase CLI version may result in deployment or emulator incompatibilities.
cd frontend && npm install
cd ../functions && npm installMake sure you’ve initialized Firebase with the correct project settings:
firebase login
firebase use --addThis project currently uses a .env file located in the functions/ directory to manage sensitive configuration values during deployment.
⚠️ Important: This is an intentional, transitional setup. While Firebase Secrets are supported and recommended long-term, the current MFI deployment relies on.envvalues being loaded at deploy/build time.
The following environment variables must be present in functions/.env before deploying Cloud Functions:
AUTH_FILE=path_to_service_account_json
PROJECT_ID=ignite-program
NODE_ENV=production
FRONTEND_URL=https://selfassessment.mfi-ng.org
TRANSACTIONAL_EMAIL_ADDRESS=[email protected]
SMTP_USERNAME=your_smtp_username
SMTP_PASSWORD=your_smtp_password
SMTP_ENDPOINT=your_smtp_host
REPLY_TO_EMAIL=[email protected]Variable notes:
AUTH_FILE— Path to the Google service account JSON used for admin accessPROJECT_ID— Google Cloud / Firebase project IDNODE_ENV— Deployment environment (productionordevelopment)FRONTEND_URL— Allowed frontend origin for CORSTRANSACTIONAL_EMAIL_ADDRESS— Sender address for system emailsSMTP_USERNAME/SMTP_PASSWORD— SMTP credentials for email deliverySMTP_ENDPOINT— SMTP server hostnameREPLY_TO_EMAIL— Reply-to address for outgoing emails
During deployment, these values are loaded into the Cloud Functions environment. Any deployment environment (local machine or CI/CD) must provide an identical .env file to ensure consistency.
🔐 Security Note: The
.envfile must never be committed to source control and should be securely shared with authorized personnel only.
To serve locally:
npm run serveLinting runs automatically before every commit using Husky:
npm run lintFigure: High-level architecture of the MFI Self-Assessment platform showing Firebase Hosting, Cloud Functions (Gen 1), Firestore (Native), Authentication, Storage, and Secrets integration.
MFI is built on Firebase and Google Cloud Platform using the following components:
- Frontend: React (Firebase Hosting)
- Backend: Firebase Cloud Functions (Node.js, Gen 1)
- Authentication: Firebase Authentication
- Authorization: Application-level logic using Firestore data (no custom claims)
- Database: Firestore (Native mode)
- Storage: Firebase Storage
- Configuration:
.env-based environment variables loaded at deploy time
The system is designed for scalability, security, and maintainability, and supports future multi-country extensions.
This section highlights the key runtime changes made to the MFI platform over time for clarity during handover and maintenance.
- Cloud Functions Runtime: Node.js 18 (
nodejs18) - Local Development Environment: Node.js 18
- Deployment Target: Firebase Cloud Functions (Gen 1)
- Cloud Functions Runtime: Node.js 20 (
nodejs20) - Local Development Environment: Node.js 20.18.2
- Deployment Target: Firebase Cloud Functions (Gen 1)
ℹ️ Note: While the Cloud Functions runtime has been upgraded to Node.js 20, the platform remains on 1st Gen Cloud Functions. No 2nd Gen migration has been performed.
https://selfassessment.mfi-ng.org
Production (Nigeria – MFI): https://selfassessment.mfi-ng.org
The architecture diagram is located at:
docs/architecture/mfi-architecture.png
This diagram should be updated whenever there are significant changes to the hosting, backend services, authentication flow, or database structure.
ISC License. See LICENSE for details.
Pull requests are welcome. Please open an issue first to discuss what you’d like to change.
Report issues here:
👉 https://github.com/TechnoServe/MFI-Web/issues
