Skip to content

About

πŸ” SafePass β€” Digital authorization platform for secure, flexible student pickup in Kenyan boarding schools. QR/OTP tokens, USSD/SMS fallback, and full audit trails replace forged letters and unverifiable phone calls.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 

Repository files navigation

SafePass

Digital authorization platform for flexible, verifiable student pickup in Kenyan boarding schools. Replaces handwritten letters and unverifiable phone calls with time-bound QR/OTP tokens, a pre-approved "Pickup Circle," USSD/SMS fallback for feature-phone users, and a full audit trail for administrators.

Problem

Boarding schools only release students to pre-listed guardians, but real life doesn't cooperate β€” sick parents, diaspora work, emergencies, trusted relatives stepping in. Today that's handled with forged-prone paper letters, teachers' personal WhatsApp, and unverifiable phone calls. No audit trail exists. Post-Endarasha, the Ministry of Education is pushing schools toward exactly this kind of accountability.

Actors

Actor Interface
Parent / Guardian Mobile app (+ USSD/SMS fallback)
Authorized Picker Mobile app / SMS OTP
Class Teacher / Gate Security Tablet "scan & verify" app
School Administrator Web dashboard
Ministry of Education (future) Export/reporting API

Architecture β€” 3-Tier Client-Server

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ TIER 1: CLIENTS ────────────────────────────┐
β”‚  Parent/Picker    Teacher/Gate       Admin Web        USSD/SMS          β”‚
β”‚  Mobile App       Tablet App         Dashboard        (feature phones)  β”‚
β”‚  (React Native)   (React Native)     (React SPA)       via gateway      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               HTTPS/TLS 1.3 (all client traffic, no exceptions)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    TIER 2: APPLICATION SERVER                          β”‚
β”‚  API Gateway β†’ Auth Rate-Limit WAF                                     β”‚
β”‚  β”œβ”€ Auth Service          (OTP issuance, JWT, session mgmt, RBAC)      β”‚
β”‚  β”œβ”€ Pickup Circle Service (guardian registration, ID verification)     β”‚
β”‚  β”œβ”€ Authorization Service (pickup requests, time-window validation)    β”‚
β”‚  β”œβ”€ Token Service          (QR + OTP generation, single-use, signed)   β”‚
β”‚  β”œβ”€ Gate Verification Svc  (offline-capable token validation)          β”‚
β”‚  β”œβ”€ Notification Service   (SMS/USSD gateway, push notifications)      β”‚
β”‚  β”œβ”€ Emergency Override Svc (admin-issued, fully logged)                β”‚
β”‚  └─ Audit/Reporting Service (tamper-evident event log, PDF/CSV export) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               encrypted connection, least-privilege DB user
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        TIER 3: DATA LAYER                               β”‚
β”‚  Primary DB (Postgres)         D1 Users Β· D2 Auth Records Β· D3 Tokens   β”‚
β”‚  Audit Store (append-only)     D4 Gate Verification Log                 β”‚
β”‚  Object Storage (encrypted)    ID photos, signed letters                β”‚
β”‚  Cache (Redis)                 active token lookups for offline sync    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Strict tier separation: clients never touch the database directly; every write goes through the application server's service layer, which is the only tier holding DB credentials.

Security (non-negotiable, designed in from day one)

This system touches child safety, national ID numbers, and location/timing of minors β€” treat it like a security-critical system, not a CRUD app.

  • Identity verification: National ID + selfie match at Pickup Circle enrollment; admin approval required before a picker is "live."
  • Tokens are single-use, short-lived, and cryptographically signed (JWT/HMAC) β€” not guessable, not reusable after redemption.
  • Zero plaintext secrets: OTPs delivered via SMS only, never logged in plaintext server-side; hashed at rest if persisted at all.
  • Transport security: TLS everywhere; certificate pinning on mobile clients.
  • RBAC, enforced server-side per role (parent / picker / teacher / admin) β€” never trust a client-side role flag.
  • Rate limiting & abuse protection on OTP requests, gate verification attempts, and USSD sessions (closing-day concurrency is a known load spike and a known attack window).
  • Tamper-evident audit log: append-only, every pickup event and every emergency override immutably timestamped with the acting admin's identity β€” this is the system's core value proposition, not an afterthought.
  • PII minimization & encryption at rest: National ID numbers and ID photos encrypted at rest (KMS-managed keys), access scoped and logged.
  • Emergency override accountability: every override requires a logged reason, is time-boxed (30 min), and notifies the parent in parallel β€” no silent overrides.
  • Offline gate verification: gate app must validate previously-synced tokens without live connectivity, without weakening signature checks (pre-fetch signed token batches, verify signature locally).
  • Secrets management: no secrets in source control β€” env vars / secrets manager only.
  • Regular dependency and OWASP Top 10 review, especially injection and broken-auth classes given the multiple entry points (app, web, USSD, SMS).

Suggested Tech Stack

Layer Choice Why
Mobile (parent/picker/teacher) React Native Single codebase, offline-first support
Admin web React + TypeScript Dashboard, reporting, export
API server Node.js (NestJS) or Python (FastAPI) Strong auth/middleware ecosystem
Database PostgreSQL Relational integrity for auth chains
Cache/session Redis Token lookups, rate limiting
SMS/USSD gateway Africa's Talking or Twilio Kenya-native SMS/USSD support
Push notifications Firebase Cloud Messaging Cross-platform
Auth JWT + short-lived refresh tokens Stateless, revocable
Infra Docker + CI/CD (GitHub Actions) Reproducible deploys

Development Flow

  1. Auth & Pickup Circle β€” registration, OTP login, National ID verification, admin approval queue.
  2. Authorization + Token Service β€” pickup request β†’ QR/OTP generation β†’ delivery.
  3. Gate Verification app β€” scan/enter, AUTHORIZED/DECLINED screen, offline validation, release logging.
  4. Notification layer β€” parent push/SMS confirmation on collection.
  5. Emergency Override β€” admin flow with mandatory reason + time-box.
  6. USSD/SMS fallback β€” feature-phone authorization path.
  7. Audit & Reporting dashboard β€” filterable logs, PDF/CSV export.
  8. Security hardening pass β€” pen-test, rate-limit tuning, load test for closing-day concurrency.
  9. Pilot β€” 2–3 schools, one term, real closing-day event.

UI Direction

Modern, high-contrast, mobile-first. Large touch targets and minimal text for the gate app (elderly/low-literacy users must be able to interpret AUTHORIZED/DECLINED at a glance β€” green/red is load-bearing, not decorative). Swahili + English throughout. Parent app should echo the M-Pesa OTP mental model users already trust.

Repo Structure (proposed)

safepass/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ mobile-parent-picker/
β”‚   β”œβ”€β”€ mobile-gate/
β”‚   └── admin-dashboard/
β”œβ”€β”€ services/
β”‚   β”œβ”€β”€ auth-service/
β”‚   β”œβ”€β”€ pickup-circle-service/
β”‚   β”œβ”€β”€ authorization-service/
β”‚   β”œβ”€β”€ token-service/
β”‚   β”œβ”€β”€ gate-verification-service/
β”‚   β”œβ”€β”€ notification-service/
β”‚   └── audit-service/
β”œβ”€β”€ infra/
β”‚   β”œβ”€β”€ docker/
β”‚   └── ci/
β”œβ”€β”€ docs/
β”‚   └── SafePass_INTE451_Report.docx
└── README.md

About

πŸ” SafePass β€” Digital authorization platform for secure, flexible student pickup in Kenyan boarding schools. QR/OTP tokens, USSD/SMS fallback, and full audit trails replace forged letters and unverifiable phone calls.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors