WeDonate
A fraud-resistant municipal charity platform for Adama City powered by an intelligent Google Gemini AI chatbot with role-scoped RAG retrieval, Kebele-scoped multi-tenancy, and anti-collusion governance.
Lead Systems Architect & Full-Stack Engineer
Production Architecture & Municipal Delivery
AI & RAG (Gemini) / pgvector / React 19 / Express / PostgreSQL
Zero Cross-Kebele Leakage / 3072-d pgvector RAG / Multi-Channel Bank Verification

Preventing Aid Fraud, Collusion, and Digital Exclusion
Municipal relief campaigns in Adama City relied on fragmented paper records and informal transfers, creating verification gaps, collusion risks, and barriers for citizens without smartphones.
Without separation of duties, local ward officers could both author and approve beneficiary appeals.
Elderly or under-connected residents lack devices or digital literacy to register and submit appeals alone.
Donations arrive via Chapa, Telebirr, and local banks, requiring consistent reference verification and receipts.
Role-Segregated Civic Platform with pgvector RAG
A React 19 + Express backend backed by PostgreSQL and pgvector. Kebele admins are query-scoped to their assigned district, assisted appeals escalate to City Admins, and Gemini RAG queries filter vector chunks by role in SQL.
English, Amharic, and Afaan Oromoo support with optimistic TanStack Query updates and printable receipts.
Kebele-scoped multi-tenancy, National ID / NGO verification, and programmatic blocking of self-approvals.
Automated gateway verification paired with receipt inspection for Telebirr, CBE, BOA, and Awash Bank.
3072-d cosine similarity search partitioned by RoleScope alongside live Prisma queue telemetry tools.
Key Challenges & Trade-offs
Blocking Self-Approval via Conflict-of-Interest Guards
Ward officers needed to assist citizens with submissions without being able to self-approve those requests.
Added runtime CoI checks in supportRequest.controller.ts returning 403 on self-approval and routing assisted requests to PENDING_CITY_APPROVAL.
Inspect snippet · wedonate-backend/src/controllers/supportRequest.controller.ts
// Enforce Conflict-of-Interest (CoI) invariant: author cannot approve own request
if (request.createdById === req.user.userId || request.userId === req.user.userId) {
return res.status(403).json({
success: false,
message: 'Conflict of Interest: You cannot approve or reject a request you created.',
});
}
// Assisted requests authored by Kebele officers escalate to City Administration
if (request.source === 'ASSISTED' && newStatus === 'APPROVED') {
if (req.user.role !== 'CITY_ADMIN' && req.user.role !== 'SYSTEM_ADMIN') {
return res.status(403).json({
success: false,
message: 'Assisted requests require central City Admin authorization.',
});
}
}Preventing Data Leakage in Vector RAG with SQL Role Partitions
A shared embedding index could surface internal admin verification protocols to public or citizen queries.
Tagged ingested chunks with RoleScope and enforced role filtering directly inside the pgvector SQL similarity query.
Inspect snippet · wedonate-backend/src/chatbot/rag/retrieval.service.ts
// Execute SQL-level role-partitioned cosine similarity search with pgvector
const results = await prisma.$queryRaw<Array<{ id: string; content: string; similarity: number }>>`
SELECT
id,
content,
1 - (embedding <=> ${vectorLiteral}::vector) AS similarity
FROM "KnowledgeChunk"
WHERE ("roleScope" = 'GENERAL' OR "roleScope" = ${userRole}::"RoleScope")
ORDER BY embedding <=> ${vectorLiteral}::vector ASC
LIMIT ${topK};
`;Supporting Offline Citizens via Assisted Proxy Snapshots
Residents without email or smartphones could not create user accounts to request emergency aid.
Stored an immutable beneficiary snapshot on assisted SupportRequest records while linking the creating Kebele officer for auditability.
Inspect snippet · wedonate-backend/src/controllers/supportRequest.controller.ts
// Author assisted proxy request with beneficiary snapshot (no user account required)
const supportRequest = await prisma.supportRequest.create({
data: {
title,
description,
category,
goalAmount: parseFloat(goalAmount),
source: 'ASSISTED',
status: 'PENDING_CITY_APPROVAL',
createdById: req.user.userId,
kebeleId: req.user.kebeleId,
beneficiaryName,
beneficiaryPhone,
beneficiaryNationalId,
beneficiaryFamilyCount: parseInt(beneficiaryFamilyCount, 10),
bankName,
accountNumber,
telebirrNumber,
},
});Auditable Municipal Relief Infrastructure
Delivered as production-ready civic software with Kebele multi-tenancy, multi-channel payment verification, and automated integration suites covering scoping and regression invariants.