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

GitHub | Release v0.1

NPO Orphan Care System (Kahatayn) v0.1 26-table 3NF schema, Tkinter desktop, and spreadsheet workflow showcase

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.

Pro-Bono Community Impact: Developed under the software volunteering track and released openly at arousi/npo-orphan-care-sys so any charitable organization can adopt and adapt it with zero licensing cost.

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.
Pragmatic Constraint: For small NPOs without dedicated sysadmins, a local SQLite + Tkinter system outperforms a cloud stack that breaks as soon as hosting renewals or network access lapse.

SDLC & Quality Practices

Volunteer and non-profit software still warrants disciplined engineering:

  1. Workflow-Aligned Design: Designed around real orphan-care NPO operational steps rather than generic CRUD templates.
  2. Data Safety & Portability: SQLite relational structure paired with spreadsheet interoperability prevents vendor lock-in and makes periodic offline backups straightforward.
  3. 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

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 by tools/build_forms_spec.py and schema-checked by tools/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 to exports/forms_spec.json.
  • Multi-backend Repository Pattern (mini_db/repo/): SQLiteRepository, XLSXRepository, and ODSRepository.
  • Application Services (mini_db/service/): PDF report generation (pdf_service.py via 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 by tools/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_dashboards analytics sheet with plain-value metrics, 4 embedded charts, operational alerts (orphans without sponsors, expiring sponsorships/documents, aging assessments, inactive donors), and followup drill-down + global search navigation.
    • Automatic cascade evaluation of assessments.is_accepted against eligibility_criteria and append-only audit_log entries.
  • Macro-Free Excel Workbook (kahatayn_forms.xlsx): Generated by tools/build_forms_xlsx.py with FK ID dropdown validations, read-only <fk>_name lookup columns, L_* reference tabs, and a bilingual Guide sheet.

5. Workbook Scanner & ERPNext Migration Pipeline (convert.py, tools/validate_data.py)

  • convert.py reads .ods and .xlsx workbooks via pandas, canonicalizes bilingual english | عربي headers/tabs, detects form blocks, infers FK relationships, and exports structured JSON artifacts (schema.json, forms.json, relationships.json, lookups.json, data/*.json) to exports/.
  • tools/validate_data.py verifies referential integrity across all 30 foreign keys, required fields from forms_spec.json, and unique business keys (family_code, donor_code, volunteer_code, national_id) prior to ERPNext v15 (frappe/non_profit) import (documented in NORMALIZATION_ERPNEXT_PLAN.md and README.md).

6. Document Storage (documents/)

  • Entity-mirrored directory hierarchy (Orphans/, Families/, Persons/, Sponsorships/, Assessments/, _Reference/, _System/) referenced via relative paths in documents.path.