OSS · OPEN SOURCE · 2026
NPO Orphan Care System (Kahatayn)
Python Tkinter + SQLite mini-system and structured spreadsheet workflow for orphan-care NPOs
Python · SQLite · Tkinter

Overview / Engineering Problem
Non-profit organizations dedicated to orphan care often operate on constrained budgets, limited IT support, and intermittent connectivity. Requiring them to maintain cloud servers, paid SaaS subscriptions, or complex database administration creates operational fragility rather than relief.
Built as a pro-bono open-source initiative (Kahatayn), npo-orphan-care-sys delivers a self-contained Python Tkinter + SQLite desktop mini-system paired with a structured spreadsheet workflow tailored specifically to the daily administrative reality of orphan-care NPOs.
Architecture & Technical Decisions
Every architectural choice prioritized zero operational overhead, offline reliability, and data portability:
- Zero-Server Desktop UI (Python Tkinter): Uses Python's built-in Tkinter GUI toolkit so staff can run the system locally on standard computers without installing web servers, Docker engines, or external UI runtimes.
- Single-File Relational Storage (SQLite): Stores organizational records in an embedded SQLite database, providing transactional integrity while keeping backups as simple as copying a single database file.
- Structured Spreadsheet Workflow: Complements the desktop application with a disciplined spreadsheet workflow so non-technical staff can exchange, review, and reconcile records smoothly in familiar formats.
- Minimal Dependency Footprint: Relying strictly on standard Python tooling eliminates fragile package chains for volunteer-maintained environments.
SDLC & Quality Practices
Volunteer and non-profit software still warrants disciplined engineering:
- Workflow-Aligned Design: Designed around real orphan-care NPO operational steps rather than generic CRUD templates.
- Data Safety & Portability: SQLite relational structure paired with spreadsheet interoperability prevents vendor lock-in and makes periodic offline backups straightforward.
- Open-Source Stewardship: Maintained publicly on GitHub so charitable organizations and community contributors can inspect, verify, and extend the codebase.
Stack & Deliverables
| Layer | Technology / Artifact | Role in System |
|---|---|---|
| Desktop Interface | Python & Tkinter | Lightweight local GUI with zero external runtime setup |
| Embedded Database | SQLite | Single-file ACID storage for simple backup and portability |
| Operational Workflow | Structured Spreadsheets | Familiar reporting and administrative reconciliation format |
| Source Repository | GitHub (arousi/npo-orphan-care-sys) |
Open-source release for orphan-care NPOs |
Latest Release: v0.1 — Orphan Care Management System & Spreadsheet Workflow (v0.1)
Overview
Initial v0.1 release of the NPO Orphan Care System (Kahatayn) — an orphan family, sponsorship, financial assessment, and document management platform combining a canonical 3NF data model, a Python + Tkinter + SQLite/XLSX/ODS desktop application, bilingual spreadsheet workflows (main.ods & kahatayn_forms.xlsx), and an ERPNext v15 Non-Profit export pipeline.
Core Architecture
1. Canonical 3NF Data Model (tools/canonical_schema.py, mini_db/models/models.py)
- 26 tables (8 lookup tables + 18 entity/link tables) and 30 foreign-key relationships modeled consistently across SQLAlchemy 2.0 ORM classes and spreadsheet tabs:
- Lookups:
cities,schools,banks,bank_branches,deposit_types,document_types,sponsorship_types,eligibility_criteria - People & Households:
persons,contacts,bank_accounts,families,representatives,family_members,orphans - Operations & Finance:
donors,volunteers,volunteer_activities,employees,system_users,sponsorships,donations,disbursements,assessments,documents,audit_log
- Lookups:
2. Spec-Driven Bilingual Forms (exports/forms_spec.json)
- 13 EN/AR form definitions (
person,contact,bank_account,family,representative,orphan,donor,volunteer,donation,sponsorship,disbursement,assessment,document) generated bytools/build_forms_spec.pyand schema-checked bytools/check_forms.py. - Shared across all three front-ends so field order, required flags, dropdown options, and foreign-key targets stay synchronized.
3. Desktop Application (mini_db/)
- Tkinter GUI with role-based access control for Manager, Volunteer, and Staff (
mini_db/service/auth.py,mini_db/ui/dashboards.py). - Dynamic spec-driven forms (
mini_db/ui/spec_forms.py) wired toexports/forms_spec.json. - Multi-backend Repository Pattern (
mini_db/repo/):SQLiteRepository,XLSXRepository, andODSRepository. - Application Services (
mini_db/service/): PDF report generation (pdf_service.pyvia ReportLab), bilingual English/Arabic localization (i18n.py), automated multi-format backups (backup_service.py), export (export_service.py), and structured logging (logging_service.py).
4. Kahatayn Spreadsheet Workflow (main.ods, kahatayn_forms.xlsx, FORMS.md)
- LibreOffice Calc App (
main.ods): Self-contained RTL Arabic-first interface driven by the embedded Basic engine (KahataynForms.Engine, built bytools/build_input_forms.py— no APSO or external runtime required):- 4 workflow-grouped input sheets (
input_dashboards,input_Family-الأسرة,input_Donor-التبرع,input_Utility-المرفقات) with shape-based Load / Save / Clear / Delete actions, FK resolution by ID/code/name, and FK-delete protection. view_dashboardsanalytics sheet with plain-value metrics, 4 embedded charts, operational alerts (orphans without sponsors, expiring sponsorships/documents, aging assessments, inactive donors), andfollowupdrill-down + globalsearchnavigation.- Automatic cascade evaluation of
assessments.is_acceptedagainsteligibility_criteriaand append-onlyaudit_logentries.
- 4 workflow-grouped input sheets (
- Macro-Free Excel Workbook (
kahatayn_forms.xlsx): Generated bytools/build_forms_xlsx.pywith FK ID dropdown validations, read-only<fk>_namelookup columns,L_*reference tabs, and a bilingual Guide sheet.
5. Workbook Scanner & ERPNext Migration Pipeline (convert.py, tools/validate_data.py)
convert.pyreads.odsand.xlsxworkbooks viapandas, canonicalizes bilingualenglish | عربيheaders/tabs, detects form blocks, infers FK relationships, and exports structured JSON artifacts (schema.json,forms.json,relationships.json,lookups.json,data/*.json) toexports/.tools/validate_data.pyverifies referential integrity across all 30 foreign keys, required fields fromforms_spec.json, and unique business keys (family_code,donor_code,volunteer_code,national_id) prior to ERPNext v15 (frappe/non_profit) import (documented inNORMALIZATION_ERPNEXT_PLAN.mdandREADME.md).
6. Document Storage (documents/)
- Entity-mirrored directory hierarchy (
Orphans/,Families/,Persons/,Sponsorships/,Assessments/,_Reference/,_System/) referenced via relative paths indocuments.path.