```index.tsx import './index.css' import React from "react"; import { render } from "react-dom"; import { App } from "./App"; render(, document.getElementById("root")); ``` ```App.tsx import React from 'react' import { BrowserRouter as Router, Routes, Route } from 'react-router-dom' import LandingPage from './pages/LandingPage' import NGODashboard from './pages/NGODashboard' import HouseholdManagement from './pages/HouseholdManagement' import HouseholdProfile from './pages/HouseholdProfile' import InterventionsPage from './pages/InterventionsPage' import InterventionDetail from './pages/InterventionDetail' import BeneficiaryDashboard from './pages/BeneficiaryDashboard' import SearchDiscovery from './pages/SearchDiscovery' import ReportsPage from './pages/ReportsPage' export function App() { return ( } /> } /> } /> } /> } /> } /> } /> } /> } /> ) } ``` ```AppRouter.tsx import React from "react"; import { BrowserRouter, Routes, Route } from "react-router-dom"; import { App } from "./App"; export function AppRouter() { return ( } /> ); } ``` ```tailwind.config.js export default {} ``` ```index.css /* PLEASE NOTE: THESE TAILWIND IMPORTS SHOULD NEVER BE DELETED */ @import 'tailwindcss/base'; @import 'tailwindcss/components'; @import 'tailwindcss/utilities'; /* DO NOT DELETE THESE TAILWIND IMPORTS, OTHERWISE THE STYLING WILL NOT RENDER AT ALL */ ``` ```data/households.json [ { "id": "hh_NAI001", "code": "NAI001", "location": { "county": "Nairobi", "subCounty": "Kibera", "landmark": "Near Olympic Primary" }, "headOfHousehold": "ind_001", "incomeSources": ["informal labor"], "housingType": "semi-permanent", "verificationStatus": "verified", "memberIds": ["ind_001", "ind_002", "ind_003", "ind_004"] }, { "id": "hh_NAI002", "code": "NAI002", "location": { "county": "Nairobi", "subCounty": "Mathare", "landmark": "Near Mathare Hospital" }, "headOfHousehold": "ind_005", "incomeSources": ["small business"], "housingType": "temporary", "verificationStatus": "pending", "memberIds": ["ind_005", "ind_006", "ind_007"] }, { "id": "hh_MOM001", "code": "MOM001", "location": { "county": "Mombasa", "subCounty": "Likoni", "landmark": "Near Likoni Ferry" }, "headOfHousehold": "ind_008", "incomeSources": ["fishing"], "housingType": "permanent", "verificationStatus": "verified", "memberIds": ["ind_008", "ind_009", "ind_010"] } ] ``` ```data/individuals.json [ { "id": "ind_001", "householdId": "hh_NAI001", "name": "Ahmed Abdullahi", "age": 45, "gender": "M", "nationalId": "12345678", "education": "Primary", "skills": ["masonry"], "needs": ["stable income"] }, { "id": "ind_002", "householdId": "hh_NAI001", "name": "Fatima Mohamed", "age": 40, "gender": "F", "nationalId": "87654321", "education": "Secondary", "skills": ["tailoring"], "needs": ["sewing machine"] }, { "id": "ind_003", "householdId": "hh_NAI001", "name": "Juma Ahmed", "age": 18, "gender": "M", "nationalId": "11112222", "education": "Secondary graduate", "skills": ["plumbing"], "needs": ["plumbing training"] }, { "id": "ind_004", "householdId": "hh_NAI001", "name": "Amina Ahmed", "age": 12, "gender": "F", "birthCertificate": "BC-334455", "education": "Primary school", "skills": [], "needs": ["school fees"] }, { "id": "ind_005", "householdId": "hh_NAI002", "name": "Hassan Omar", "age": 50, "gender": "M", "nationalId": "23456789", "education": "None", "skills": ["carpentry"], "needs": ["tools"] }, { "id": "ind_006", "householdId": "hh_NAI002", "name": "Halima Hassan", "age": 45, "gender": "F", "nationalId": "34567890", "education": "Primary", "skills": ["cooking"], "needs": ["business startup"] }, { "id": "ind_007", "householdId": "hh_NAI002", "name": "Aisha Hassan", "age": 15, "gender": "F", "birthCertificate": "BC-445566", "education": "Secondary school", "skills": [], "needs": ["school fees"] }, { "id": "ind_008", "householdId": "hh_MOM001", "name": "Ibrahim Ali", "age": 55, "gender": "M", "nationalId": "45678901", "education": "Primary", "skills": ["fishing"], "needs": ["fishing equipment"] }, { "id": "ind_009", "householdId": "hh_MOM001", "name": "Maryam Ibrahim", "age": 50, "gender": "F", "nationalId": "56789012", "education": "None", "skills": ["fish processing"], "needs": ["business startup"] }, { "id": "ind_010", "householdId": "hh_MOM001", "name": "Yusuf Ibrahim", "age": 17, "gender": "M", "birthCertificate": "BC-556677", "education": "Secondary school", "skills": ["computer"], "needs": ["laptop"] } ] ``` ```data/interventions.json [ { "id": "int_001", "title": "Ramadan Food Pack – Kibera", "type": "initiative", "ngo": "Zakat Kenya", "location": "Nairobi-Kibera", "startDate": "2025-03-01", "endDate": "2025-03-30", "status": "completed", "targetBeneficiaries": 200 }, { "id": "int_002", "title": "Plumbing Skills Training – Nairobi", "type": "project", "ngo": "Murshidat", "location": "Nairobi", "startDate": "2025-06-01", "endDate": "2025-09-30", "status": "active", "targetBeneficiaries": 50 }, { "id": "int_003", "title": "School Fees Support – Likoni Secondary", "type": "program", "ngo": "MMRF", "location": "Mombasa-Likoni", "startDate": "2025-01-01", "status": "ongoing", "targetBeneficiaries": 100 }, { "id": "int_004", "title": "Business Startup Grants – Mathare", "type": "program", "ngo": "Islamic Relief", "location": "Nairobi-Mathare", "startDate": "2025-04-01", "endDate": "2025-12-31", "status": "active", "targetBeneficiaries": 75 }, { "id": "int_005", "title": "Fishing Equipment Support – Mombasa", "type": "initiative", "ngo": "Al-Khair Foundation", "location": "Mombasa", "startDate": "2025-05-15", "endDate": "2025-06-15", "status": "planned", "targetBeneficiaries": 30 } ] ``` ```data/aid_records.json [ { "id": "svc_001", "householdId": "hh_NAI001", "individualId": "ind_001", "interventionId": "int_001", "serviceType": "Food Relief", "providerNGO": "Zakat Kenya", "date": "2025-03-10", "valueKES": 3000 }, { "id": "svc_002", "householdId": "hh_NAI001", "individualId": "ind_003", "interventionId": "int_002", "serviceType": "Mentorship Session", "providerNGO": "Murshidat", "date": "2025-06-15", "valueKES": 0 }, { "id": "svc_003", "householdId": "hh_NAI001", "individualId": "ind_004", "interventionId": "int_003", "serviceType": "Education Grant", "providerNGO": "MMRF", "date": "2025-02-01", "valueKES": 5000 }, { "id": "svc_004", "householdId": "hh_NAI002", "individualId": "ind_006", "interventionId": "int_004", "serviceType": "Business Grant", "providerNGO": "Islamic Relief", "date": "2025-04-15", "valueKES": 10000 }, { "id": "svc_005", "householdId": "hh_NAI002", "individualId": "ind_007", "interventionId": "int_003", "serviceType": "Education Grant", "providerNGO": "MMRF", "date": "2025-02-10", "valueKES": 7000 }, { "id": "svc_006", "householdId": "hh_MOM001", "individualId": "ind_010", "interventionId": "int_003", "serviceType": "Education Grant", "providerNGO": "MMRF", "date": "2025-02-15", "valueKES": 8000 } ] ``` ```components/Sidebar.tsx import React from 'react' import { Link, useLocation } from 'react-router-dom' import { HomeIcon, UsersIcon, BuildingIcon, PackageIcon, SearchIcon, BarChart3Icon, } from 'lucide-react' const Sidebar = () => { const location = useLocation() const isActive = (path: string) => { return location.pathname === path ? 'bg-green-100 text-green-800' : 'hover:bg-gray-100' } return (
Athari Logo

Logged in as: NGO Admin

) } export default Sidebar ``` ```components/Layout.tsx import React from 'react' import Sidebar from './Sidebar' type LayoutProps = { children: ReactNode showSidebar?: boolean } const Layout = ({ children, showSidebar = true }: LayoutProps) => { return (
{showSidebar && }
{children}
) } export default Layout ``` ```components/StatusBadge.tsx import React from 'react' type StatusBadgeProps = { status: string } const StatusBadge = ({ status }: StatusBadgeProps) => { const getStatusColor = () => { switch (status.toLowerCase()) { case 'verified': case 'completed': case 'active': case 'ongoing': return 'bg-green-100 text-green-800' case 'pending': case 'planned': return 'bg-yellow-100 text-yellow-800' default: return 'bg-gray-100 text-gray-800' } } const getStatusIcon = () => { switch (status.toLowerCase()) { case 'verified': case 'completed': case 'active': case 'ongoing': return '🟢' case 'pending': case 'planned': return '🟡' default: return '⚪' } } return ( {getStatusIcon()} {status} ) } export default StatusBadge ``` ```pages/LandingPage.tsx import React from 'react' import { Link } from 'react-router-dom' const LandingPage = () => { return (
Athari Logo
Login

Athari Platform

Coordinating Muslim NGOs to empower households while preventing aid duplication.

Register as Organization Register as Beneficiary Login as Supporter

About Athari

Coordination for Greater Impact

Athari Platform helps Muslim NGOs coordinate their efforts, track interventions, and maximize the impact of aid distribution while ensuring no household is overlooked.

Household Management

Track household needs, demographics, and support history in one central location.

Intervention Tracking

Plan, execute, and monitor interventions with real-time updates and beneficiary linking.

Coordination & Impact

Prevent duplication, identify gaps, and collaborate with other NGOs for maximum impact.

© 2025 Athari Initiative. All rights reserved.

) } export default LandingPage ``` ```pages/NGODashboard.tsx import React from 'react' import Layout from '../components/Layout' import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, } from 'recharts' import { Link } from 'react-router-dom' import interventions from '../data/interventions.json' import households from '../data/households.json' import aidRecords from '../data/aid_records.json' const NGODashboard = () => { // Count interventions by type const interventionsByType = interventions.reduce( (acc, intervention) => { const type = intervention.type if (!acc[type]) { acc[type] = 0 } acc[type]++ return acc }, {} as Record, ) const chartData = Object.keys(interventionsByType).map((type) => ({ name: type.charAt(0).toUpperCase() + type.slice(1), count: interventionsByType[type], })) // Count active interventions const activeInterventions = interventions.filter( (i) => i.status === 'active' || i.status === 'ongoing', ).length // Calculate total support value const totalSupportValue = aidRecords.reduce( (sum, record) => sum + record.valueKES, 0, ) return (

NGO Dashboard

Welcome to your Athari Platform dashboard.

Active Interventions

{activeInterventions}

View all →

Registered Households

{households.length}

View all →

Pending Collaborations

3

View all →

Total Support Value

KES {totalSupportValue.toLocaleString()}

View reports →

Interventions by Type

Recent Activity

    {aidRecords.slice(0, 5).map((record, idx) => (
  • {idx !== 4 ? ( ) : null}

    {record.serviceType} {' '} provided to a beneficiary by{' '} {record.providerNGO}

  • ))}
) } export default NGODashboard ``` ```pages/HouseholdManagement.tsx import React, { useState } from 'react' import Layout from '../components/Layout' import { Link } from 'react-router-dom' import households from '../data/households.json' import individuals from '../data/individuals.json' import StatusBadge from '../components/StatusBadge' import { SearchIcon, FilterIcon } from 'lucide-react' const HouseholdManagement = () => { const [searchTerm, setSearchTerm] = useState('') const [filterStatus, setFilterStatus] = useState('all') // Find head of household name const getHeadOfHouseholdName = (headId: string) => { const head = individuals.find((ind) => ind.id === headId) return head ? head.name : 'Unknown' } // Count members const getMemberCount = (memberIds: string[]) => memberIds.length // Filter households const filteredHouseholds = households.filter((household) => { const matchesSearch = household.code.toLowerCase().includes(searchTerm.toLowerCase()) || getHeadOfHouseholdName(household.headOfHousehold) .toLowerCase() .includes(searchTerm.toLowerCase()) || household.location.county .toLowerCase() .includes(searchTerm.toLowerCase()) || household.location.subCounty .toLowerCase() .includes(searchTerm.toLowerCase()) const matchesFilter = filterStatus === 'all' || household.verificationStatus === filterStatus return matchesSearch && matchesFilter }) return (

Household Management

Manage and view all registered households.

setSearchTerm(e.target.value)} />
    {filteredHouseholds.length > 0 ? ( filteredHouseholds.map((household) => (
  • Household {household.code}

    {getMemberCount(household.memberIds)} members

    {getHeadOfHouseholdName(household.headOfHousehold)}

    {household.location.county},{' '} {household.location.subCounty}

    {household.housingType}
  • )) ) : (
  • No households found matching your search criteria.
  • )}
) } export default HouseholdManagement ``` ```pages/HouseholdProfile.tsx import React from 'react' import { useParams, Link } from 'react-router-dom' import Layout from '../components/Layout' import StatusBadge from '../components/StatusBadge' import households from '../data/households.json' import individuals from '../data/individuals.json' import aidRecords from '../data/aid_records.json' import interventions from '../data/interventions.json' import { ArrowLeftIcon } from 'lucide-react' const HouseholdProfile = () => { const { id } = useParams<{ id: string }>() const household = households.find((h) => h.id === id) if (!household) { return (

Household not found

The household you're looking for doesn't exist or has been removed.

Return to Households
) } const members = individuals.filter((ind) => household.memberIds.includes(ind.id), ) const headOfHousehold = individuals.find( (ind) => ind.id === household.headOfHousehold, ) // Get services for each household member const getMemberServices = (memberId: string) => { return aidRecords.filter((record) => record.individualId === memberId) } // Get intervention details for a service const getInterventionDetails = (interventionId: string) => { return interventions.find((int) => int.id === interventionId) } return (
Back to Households

Household Profile - {household.code}

Details and information about this household.

Head of Household
{headOfHousehold?.name || 'Unknown'}
Location
{household.location.county}, {household.location.subCounty} {household.location.landmark && ` (${household.location.landmark})`}
Housing Type
{household.housingType}
Income Sources
{household.incomeSources.map((source) => ( {source} ))}

Household Members

{members.length} members in this household.

{members.map((member) => { const services = getMemberServices(member.id) return ( ) })}
Name Age/Gender ID/Birth Certificate Education Skills Needs Services Received
{member.name} {member.id === household.headOfHousehold && ( Head )}
{member.age} / {member.gender}
{member.nationalId ? `ID: ${member.nationalId}` : member.birthCertificate ? `BC: ${member.birthCertificate}` : 'None'}
{member.education}
{member.skills.length > 0 ? ( member.skills.join(', ') ) : ( None )}
{member.needs.map((need) => ( {need} ))}
{services.length > 0 ? (
{services.map((service) => { const intervention = getInterventionDetails( service.interventionId, ) return (
{service.serviceType}
by {service.providerNGO} ({service.date} )
Value: KES{' '} {service.valueKES.toLocaleString()}
) })}
) : ( No services )}

Aid History Timeline

    {aidRecords .filter((record) => record.householdId === household.id) .sort( (a, b) => new Date(b.date).getTime() - new Date(a.date).getTime(), ) .map((record, idx, records) => { const member = individuals.find( (ind) => ind.id === record.individualId, ) const intervention = interventions.find( (int) => int.id === record.interventionId, ) return (
  • {idx !== records.length - 1 ? ( ) : null}

    {record.serviceType} {' '} provided to{' '} {member?.name} {' '} through{' '} {intervention?.title}

    Provider: {record.providerNGO} | Value: KES{' '} {record.valueKES.toLocaleString()}

  • ) })} {aidRecords.filter( (record) => record.householdId === household.id, ).length === 0 && (
  • No aid history recorded for this household.
  • )}
) } export default HouseholdProfile ``` ```pages/InterventionsPage.tsx import React, { useState } from 'react' import Layout from '../components/Layout' import { Link } from 'react-router-dom' import interventions from '../data/interventions.json' import StatusBadge from '../components/StatusBadge' import { SearchIcon, FilterIcon } from 'lucide-react' const InterventionsPage = () => { const [searchTerm, setSearchTerm] = useState('') const [filterStatus, setFilterStatus] = useState('all') const [filterType, setFilterType] = useState('all') // Get unique intervention types const interventionTypes = Array.from( new Set(interventions.map((int) => int.type)), ) // Filter interventions const filteredInterventions = interventions.filter((intervention) => { const matchesSearch = intervention.title.toLowerCase().includes(searchTerm.toLowerCase()) || intervention.ngo.toLowerCase().includes(searchTerm.toLowerCase()) || intervention.location.toLowerCase().includes(searchTerm.toLowerCase()) const matchesStatus = filterStatus === 'all' || intervention.status === filterStatus const matchesType = filterType === 'all' || intervention.type === filterType return matchesSearch && matchesStatus && matchesType }) return (

Interventions

Manage and view all interventions.

setSearchTerm(e.target.value)} />
    {filteredInterventions.length > 0 ? ( filteredInterventions.map((intervention) => (
  • {intervention.title}

    {intervention.type}

    {intervention.ngo}

    {intervention.location}

    {intervention.startDate} {intervention.endDate && ` to ${intervention.endDate}`}

  • )) ) : (
  • No interventions found matching your search criteria.
  • )}
) } export default InterventionsPage ``` ```pages/InterventionDetail.tsx import React, { useState } from 'react' import { useParams, Link } from 'react-router-dom' import Layout from '../components/Layout' import StatusBadge from '../components/StatusBadge' import interventions from '../data/interventions.json' import aidRecords from '../data/aid_records.json' import households from '../data/households.json' import individuals from '../data/individuals.json' import { ArrowLeftIcon, PlusIcon } from 'lucide-react' const InterventionDetail = () => { const { id } = useParams<{ id: string }>() const [showAddHouseholdModal, setShowAddHouseholdModal] = useState(false) const intervention = interventions.find((int) => int.id === id) if (!intervention) { return (

Intervention not found

The intervention you're looking for doesn't exist or has been removed.

Return to Interventions
) } // Get all records for this intervention const records = aidRecords.filter( (record) => record.interventionId === intervention.id, ) // Get unique household IDs from the records const uniqueHouseholdIds = Array.from( new Set(records.map((record) => record.householdId)), ) // Get household data for each unique household ID const linkedHouseholds = uniqueHouseholdIds.map((householdId) => { const household = households.find((h) => h.id === householdId) const householdRecords = records.filter( (record) => record.householdId === householdId, ) const memberIds = Array.from( new Set(householdRecords.map((record) => record.individualId)), ) const members = individuals .filter((ind) => memberIds.includes(ind.id)) .map((member) => { const memberServices = householdRecords.filter( (record) => record.individualId === member.id, ) return { ...member, services: memberServices, } }) return { household, members, } }) return (
Back to Interventions

{intervention.title}

{intervention.type.charAt(0).toUpperCase() + intervention.type.slice(1)}{' '} by {intervention.ngo}

Location
{intervention.location}
Timeline
{intervention.startDate} {intervention.endDate && ` to ${intervention.endDate}`}
Target Beneficiaries
{intervention.targetBeneficiaries}
Current Reach
{records.length} services provided to{' '} {uniqueHouseholdIds.length} households
Budget Utilization
KES{' '} {records .reduce((sum, record) => sum + record.valueKES, 0) .toLocaleString()}{' '} used 45% of budget

Beneficiaries Linked

Households and individuals receiving services through this intervention.

{linkedHouseholds.length > 0 ? (
{linkedHouseholds.map(({ household, members }) => (
Household {household?.code} {household?.location.county},{' '} {household?.location.subCounty}
{members.map((member) => member.services.map((service, idx) => ( {idx === 0 && ( <> )} )), )}
Name Age/Gender ID/BC Need Service Provided Date Value (KES)
{member.name}
{member.age} / {member.gender}
{member.nationalId ? `ID: ${member.nationalId}` : member.birthCertificate ? `BC: ${member.birthCertificate}` : 'None'}
{member.needs.map((need) => ( {need} ))}
{service.serviceType}
{service.date}
{service.valueKES.toLocaleString()}
))}
) : (
No households linked to this intervention yet.
)}
{/* Add Household Modal */} {showAddHouseholdModal && (

Add Household to Intervention

This is a prototype. In a real implementation, this would search for the household and allow you to select members to add to the intervention.

)}
) } export default InterventionDetail ``` ```pages/BeneficiaryDashboard.tsx import React, { useState } from 'react' import Layout from '../components/Layout' import { Link } from 'react-router-dom' import { Tab } from '@headlessui/react' import individuals from '../data/individuals.json' import households from '../data/households.json' import aidRecords from '../data/aid_records.json' import interventions from '../data/interventions.json' import StatusBadge from '../components/StatusBadge' // Mock current household ID for beneficiary view const CURRENT_HOUSEHOLD_ID = 'hh_NAI001' const BeneficiaryDashboard = () => { const household = households.find((h) => h.id === CURRENT_HOUSEHOLD_ID) const members = individuals.filter((ind) => household?.memberIds.includes(ind.id), ) const householdRecords = aidRecords.filter( (record) => record.householdId === CURRENT_HOUSEHOLD_ID, ) const [newNeed, setNewNeed] = useState('') const [selectedMember, setSelectedMember] = useState('') // Get member services const getMemberServices = (memberId: string) => { return aidRecords.filter((record) => record.individualId === memberId) } // Get intervention details for a service const getInterventionDetails = (interventionId: string) => { return interventions.find((int) => int.id === interventionId) } // Mock needs with statuses const mockNeeds = [ { id: 1, need: 'School fees for secondary school', member: 'Amina Ahmed', status: 'Matched', date: '2025-01-15', }, { id: 2, need: 'Sewing machine for home business', member: 'Fatima Mohamed', status: 'Fulfilled', date: '2025-02-10', }, { id: 3, need: 'Plumbing training and certification', member: 'Juma Ahmed', status: 'Matched', date: '2025-05-20', }, { id: 4, need: 'Stable employment opportunity', member: 'Ahmed Abdullahi', status: 'Submitted', date: '2025-06-01', }, ] // Mock matched interventions const matchedInterventions = interventions.filter( (int) => int.location.includes(household?.location.county || '') || householdRecords.some((record) => record.interventionId === int.id), ) // Mock contributions const mockContributions = [ { id: 1, type: 'Community cleanup', date: '2025-04-15', hours: 4, valueKES: 500, }, { id: 2, type: 'Volunteer teaching', date: '2025-05-10', hours: 6, valueKES: 1200, }, { id: 3, type: 'Mosque renovation help', date: '2025-05-25', hours: 8, valueKES: 1600, }, ] function classNames(...classes: string[]) { return classes.filter(Boolean).join(' ') } return (

Beneficiary Dashboard

Welcome, {household?.code}. Manage your household information and needs.

{[ 'My Household', 'My Needs', 'Matched Interventions', 'Aid History', 'My Contributions', ].map((category) => ( classNames( 'w-full py-2.5 text-sm font-medium leading-5 text-green-700 rounded-md', 'focus:outline-none focus:ring-2 ring-offset-2 ring-offset-green-50 ring-green-600', selected ? 'bg-white shadow' : 'text-green-800 hover:bg-green-100', ) } > {category} ))} {/* My Household Panel */}

Household Information

Household Code

{household?.code}

Location

{household?.location.county},{' '} {household?.location.subCounty}

Housing Type

{household?.housingType}

Verification Status

Household Members

{members.map((member) => { const services = getMemberServices(member.id) return ( ) })}
Name Age/Gender ID/Birth Certificate Education Skills Needs Services
{member.name} {member.id === household?.headOfHousehold && ( Head )}
{member.age} / {member.gender}
{member.nationalId ? `ID: ${member.nationalId}` : member.birthCertificate ? `BC: ${member.birthCertificate}` : 'None'}
{member.education}
{member.skills.length > 0 ? ( member.skills.join(', ') ) : ( None )}
{member.needs.map((need) => ( {need} ))}
{services.length > 0 ? (
{services.map((service) => { const intervention = getInterventionDetails( service.interventionId, ) return (
{service.serviceType}
{intervention?.title}
) })}
) : ( No services )}
{/* My Needs Panel */}

Submit a New Need

setNewNeed(e.target.value)} />

My Needs Status

{mockNeeds.map((need) => ( ))}
Need For Member Submission Date Status Actions
{need.need}
{need.member}
{need.date}
{need.status === 'Matched' ? 'View Match' : need.status === 'Fulfilled' ? 'View Details' : 'Edit'}
{/* Matched Interventions Panel */}

Interventions Matching Your Household Needs

These interventions may be relevant based on your location and needs.

{matchedInterventions.map((intervention) => (
{intervention.type.charAt(0).toUpperCase() + intervention.type.slice(1)}
{intervention.title}
{intervention.ngo}
Location:{' '} {intervention.location}
Timeline:{' '} {intervention.startDate} {intervention.endDate && ` to ${intervention.endDate}`}
View Details {intervention.status === 'active' || intervention.status === 'ongoing' ? ( ) : null}
))}
{/* Aid History Panel */}

Aid History Timeline

All services and support received by your household.

    {householdRecords .sort( (a, b) => new Date(b.date).getTime() - new Date(a.date).getTime(), ) .map((record, idx, records) => { const member = individuals.find( (ind) => ind.id === record.individualId, ) const intervention = interventions.find( (int) => int.id === record.interventionId, ) return (
  • {idx !== records.length - 1 ? ( ) : null}

    {record.serviceType} {' '} received by{' '} {member?.name} {' '} through{' '} {intervention?.title}

    Provider: {record.providerNGO} | Value: KES {record.valueKES.toLocaleString()}

  • ) })} {householdRecords.length === 0 && (
  • No aid history recorded for your household.
  • )}
{/* My Contributions Panel */}

Log a New Contribution

Record your volunteering or community service activities.

My Contribution History

{mockContributions.map((contribution) => ( ))}
Contribution Type Date Hours Estimated Value (KES)
{contribution.type}
{contribution.date}
{contribution.hours}
{contribution.valueKES.toLocaleString()}
Total Value: KES{' '} {mockContributions .reduce( (sum, contribution) => sum + contribution.valueKES, 0, ) .toLocaleString()}
) } export default BeneficiaryDashboard ``` ```pages/SearchDiscovery.tsx import React, { useState } from 'react' import Layout from '../components/Layout' import { Tab } from '@headlessui/react' import households from '../data/households.json' import interventions from '../data/interventions.json' import individuals from '../data/individuals.json' import StatusBadge from '../components/StatusBadge' import { SearchIcon, FilterIcon } from 'lucide-react' const SearchDiscovery = () => { const [searchTerm, setSearchTerm] = useState('') const [filterLocation, setFilterLocation] = useState('all') // Mock organizations data const organizations = [ { id: 1, name: 'Zakat Kenya', type: 'NGO', location: 'Nairobi', focus: 'Poverty Alleviation', }, { id: 2, name: 'Murshidat', type: 'CBO', location: 'Nairobi', focus: 'Women Empowerment', }, { id: 3, name: 'MMRF', type: 'Foundation', location: 'Mombasa', focus: 'Education', }, { id: 4, name: 'Islamic Relief', type: 'International NGO', location: 'Multiple', focus: 'Humanitarian Aid', }, { id: 5, name: 'Al-Khair Foundation', type: 'Foundation', location: 'Mombasa', focus: 'Sustainable Development', }, ] // Mock grants data const grants = [ { id: 1, title: 'Community Development Fund', provider: 'Kenya Muslim Foundation', amount: 5000000, deadline: '2025-08-15', eligibility: 'Registered NGOs', }, { id: 2, title: 'Women Empowerment Grant', provider: 'International Islamic Charity', amount: 3000000, deadline: '2025-07-01', eligibility: 'Women-focused organizations', }, { id: 3, title: 'Education Support Fund', provider: 'Gulf African Bank', amount: 2000000, deadline: '2025-09-30', eligibility: 'Education institutions', }, { id: 4, title: 'Micro-Business Startup Grant', provider: 'Takaful Africa', amount: 1000000, deadline: '2025-10-15', eligibility: 'Community groups', }, ] // Get unique locations const locations = Array.from( new Set([ ...households.map((h) => h.location.county), ...interventions.map((i) => i.location.split('-')[0]), ]), ) function classNames(...classes: string[]) { return classes.filter(Boolean).join(' ') } // Filter data based on search term and location filter const filteredHouseholds = households.filter((household) => { const matchesSearch = household.code.toLowerCase().includes(searchTerm.toLowerCase()) || household.location.county .toLowerCase() .includes(searchTerm.toLowerCase()) || household.location.subCounty .toLowerCase() .includes(searchTerm.toLowerCase()) const matchesLocation = filterLocation === 'all' || household.location.county === filterLocation return matchesSearch && matchesLocation }) const filteredOrganizations = organizations.filter((org) => { const matchesSearch = org.name.toLowerCase().includes(searchTerm.toLowerCase()) || org.focus.toLowerCase().includes(searchTerm.toLowerCase()) const matchesLocation = filterLocation === 'all' || org.location === filterLocation || org.location === 'Multiple' return matchesSearch && matchesLocation }) const filteredInterventions = interventions.filter((intervention) => { const matchesSearch = intervention.title.toLowerCase().includes(searchTerm.toLowerCase()) || intervention.ngo.toLowerCase().includes(searchTerm.toLowerCase()) || intervention.type.toLowerCase().includes(searchTerm.toLowerCase()) const matchesLocation = filterLocation === 'all' || intervention.location.includes(filterLocation) return matchesSearch && matchesLocation }) const filteredGrants = grants.filter((grant) => { const matchesSearch = grant.title.toLowerCase().includes(searchTerm.toLowerCase()) || grant.provider.toLowerCase().includes(searchTerm.toLowerCase()) || grant.eligibility.toLowerCase().includes(searchTerm.toLowerCase()) return matchesSearch }) return (

Search & Discovery

Find households, organizations, interventions, and grants.

setSearchTerm(e.target.value)} />
{['Households', 'Organizations', 'Interventions', 'Grants'].map( (category) => ( classNames( 'w-full py-2.5 text-sm font-medium leading-5 text-green-700 rounded-md', 'focus:outline-none focus:ring-2 ring-offset-2 ring-offset-green-50 ring-green-600', selected ? 'bg-white shadow' : 'text-green-800 hover:bg-green-100', ) } > {category} ), )} {/* Households Panel */}
{filteredHouseholds.map((household) => { const head = individuals.find( (ind) => ind.id === household.headOfHousehold, ) return ( ) })} {filteredHouseholds.length === 0 && ( )}
Code Location Head of Household Members Status Actions
{household.code}
{household.location.county},{' '} {household.location.subCounty}
{head?.name || 'Unknown'}
{household.memberIds.length}
View Request Info
No households found matching your search criteria.
{/* Organizations Panel */}
{filteredOrganizations.map((org) => ( ))} {filteredOrganizations.length === 0 && ( )}
Organization Type Location Focus Area Actions
{org.name}
{org.type}
{org.location}
{org.focus}
View Profile Request Collaboration
No organizations found matching your search criteria.
{/* Interventions Panel */}
{filteredInterventions.map((intervention) => ( ))} {filteredInterventions.length === 0 && ( )}
Title Type NGO Location Timeline Status Actions
{intervention.title}
{intervention.type}
{intervention.ngo}
{intervention.location}
{intervention.startDate} {intervention.endDate && ` to ${intervention.endDate}`}
View Request Partnership
No interventions found matching your search criteria.
{/* Grants Panel */}
{filteredGrants.map((grant) => ( ))} {filteredGrants.length === 0 && ( )}
Title Provider Amount (KES) Deadline Eligibility Actions
{grant.title}
{grant.provider}
{grant.amount.toLocaleString()}
{grant.deadline}
{grant.eligibility}
View Details Apply
No grants found matching your search criteria.
) } export default SearchDiscovery ``` ```pages/ReportsPage.tsx import React, { useState } from 'react' import Layout from '../components/Layout' import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer, PieChart, Pie, Cell, } from 'recharts' import interventions from '../data/interventions.json' import aidRecords from '../data/aid_records.json' import households from '../data/households.json' import { DownloadIcon } from 'lucide-react' const ReportsPage = () => { const [reportType, setReportType] = useState('interventionType') // Count interventions by type const interventionsByType = interventions.reduce( (acc, intervention) => { const type = intervention.type if (!acc[type]) { acc[type] = 0 } acc[type]++ return acc }, {} as Record, ) const interventionTypeData = Object.keys(interventionsByType).map((type) => ({ name: type.charAt(0).toUpperCase() + type.slice(1), count: interventionsByType[type], })) // Count households by county const householdsByCounty = households.reduce( (acc, household) => { const county = household.location.county if (!acc[county]) { acc[county] = 0 } acc[county]++ return acc }, {} as Record, ) const householdCountyData = Object.keys(householdsByCounty).map((county) => ({ name: county, count: householdsByCounty[county], })) // Sum aid values by service type const aidByServiceType = aidRecords.reduce( (acc, record) => { const serviceType = record.serviceType if (!acc[serviceType]) { acc[serviceType] = 0 } acc[serviceType] += record.valueKES return acc }, {} as Record, ) const aidServiceTypeData = Object.keys(aidByServiceType).map((type) => ({ name: type, value: aidByServiceType[type], })) // COLORS for pie chart const COLORS = ['#0088FE', '#00C49F', '#FFBB28', '#FF8042', '#8884d8'] const renderChart = () => { switch (reportType) { case 'interventionType': return (
) case 'householdCounty': return (
) case 'aidServiceType': return (
`${name}: KES ${value.toLocaleString()}` } outerRadius={120} fill="#8884d8" dataKey="value" > {aidServiceTypeData.map((entry, index) => ( ))} `KES ${Number(value).toLocaleString()}`} />
) default: return null } } return (

Reports

Analyze and visualize platform data.

{renderChart()}

Summary Statistics

Total Households

{households.length}

Total Interventions

{interventions.length}

Total Services Provided

{aidRecords.length}

Total Support Value

KES{' '} {aidRecords .reduce((sum, record) => sum + record.valueKES, 0) .toLocaleString()}

) } export default ReportsPage ```