System Architecture Specifications
A transparent examination of the architectural patterns, algorithmic guardrails, and data structures engineered by Asabiyyah Technologies Ltd.
Offline-First Edge Synchronization
In Nigerian commercial hubs and rural markets, cloud connectivity cannot be treated as an immutable constant. Network drops, high packet loss, and power intermittency are standard operating conditions. Our architecture ensures that application state persists locally first and syncs asynchronously.
Every mutation is written directly to an embedded SQLite database on the client device inside an ACID transaction. The user interface updates instantaneously with zero network round-trip latency.
Local actions append to an immutable change log tagged with monotonic sequence numbers. When network access is re-established, the sync worker transmits the delta packet to the central PostgreSQL server.
Financial transactions utilize append-only journal entries: because ledger entries are additive rather than in-place overwrites, concurrent offline transactions from multiple organizers resolve deterministically without data loss.
[FIELD OPERATOR / MOBILE CLIENT]
│
├──> (1) User Records Contribution (No Internet Required)
│ │
│ ▼
├──> [Embedded SQLite Database] (ACID Local Commit)
│ │
│ ├── Writes to: ledger_entries
│ └── Appends to: sync_queue (status='PENDING')
│
▼
[BACKGROUND SYNC WORKER]
│
├──> (2) Detects Cellular Connectivity (2G/3G/4G/WiFi)
├──> (3) Batches Delta Entries with Device Monotonic Sequence
│ │
│ ▼ HTTPS / TLS 1.3
▼
[ASABIYYAH INGESTION EDGE API]
│
├──> (4) Validates Cryptographic Device Token
├──> (5) Executes Idempotent Ingestion Transaction
│ │
│ ▼
├──> [Central PostgreSQL 16 Cluster]
│ │
│ └── Relational Constraint Check: SUM(debit) == SUM(credit)
│
▼
(6) Returns ACK Packet -> Mobile Client Clears sync_queue
# Strict Deterministic Uncertainty Abstention
def evaluate_claim_risk(claim_text: str, evidence_docs: List[Doc]) -> Verdict:
if not evidence_docs or len(evidence_docs) == 0:
# Never fabricate refutation without authoritative documents
return Verdict(
status="UNVERIFIED",
confidence=0.0,
advisory_en="Insufficient official evidence to verify or refute this claim.",
advisory_ha="Babu isassun shaidu na hukuma don tabbatarwa ko karyata wannan zance."
)
# Multi-pillar composite evaluation
text_risk = analyze_syntactic_patterns(claim_text)
url_risk = evaluate_rdap_and_dns_entropy(extract_urls(claim_text))
doc_overlap = compute_tsvector_bm25_score(claim_text, evidence_docs)
return synthesize_bilingual_advisory(text_risk, url_risk, doc_overlap)
Grounded AI & Strict Uncertainty Abstention
Generic Large Language Models (LLMs) hallucinate confident answers when encountering unverified rumors or niche regional events. In civic threat intelligence, false refutations can be as catastrophic as false rumors. Our AMANA SHIELD intelligence engine enforces strict epistemic humility.
Absence of authoritative evidence is never treated as proof of falsity. When our procedural RAG pipeline finds zero verified records in authoritative databases, the engine abstains with a transparent UNVERIFIED status.
We decouple text sentiment from structural indicators. A message claiming to be a "Federal Ministry of Humanitarian Affairs Grant" with a domain created 48 hours ago triggers an immediate phishing alert based on DNS/RDAP entropy, regardless of plausible wording.
Public WhatsApp bots are vulnerable to jailbreak and prompt-injection attacks. Every inbound message is isolated with random cryptographic session nonces that instruct the model parser to treat user input as raw untrusted data.
Relational Double-Entry Ledger Logic
Informal savings systems (Adashe, Esusu, Ajo) frequently fracture due to bookkeeping ambiguity, lost paper records, or disputed payout schedules. Dila implements a zero-dependency relational double-entry ledger that enforces mathematical balance at the database engine level.
Every financial event consists of at least two balanced entries: a debit and a credit. The sum of all debits must equal the sum of all credits. Any transaction violating this rule is rejected by database constraints.
Historical entries cannot be edited or deleted (UPDATE and DELETE are disabled via database triggers). Any bookkeeping adjustment requires an explicitly logged reversing entry.
Rotation sequences in rotating savings circles are locked algorithmically upon group activation. This eliminates human favoritism and dispute over payout turns.
-- Relational Double-Entry Enforcement Table
CREATE TABLE ledger_entries (
entry_id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
transaction_id UUID NOT NULL REFERENCES transactions(id),
account_id UUID NOT NULL REFERENCES accounts(id),
entry_type VARCHAR(6) NOT NULL CHECK (entry_type IN ('DEBIT', 'CREDIT')),
amount_kobo BIGINT NOT NULL CHECK (amount_kobo > 0),
currency VARCHAR(3) NOT NULL DEFAULT 'NGN',
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
-- Invariant Enforcement: Sum of debits == Sum of credits
CREATE OR REPLACE FUNCTION verify_transaction_balance()
RETURNS TRIGGER AS $$
DECLARE
debit_sum BIGINT;
credit_sum BIGINT;
BEGIN
SELECT COALESCE(SUM(amount_kobo), 0) INTO debit_sum
FROM ledger_entries WHERE transaction_id = NEW.transaction_id AND entry_type = 'DEBIT';
SELECT COALESCE(SUM(amount_kobo), 0) INTO credit_sum
FROM ledger_entries WHERE transaction_id = NEW.transaction_id AND entry_type = 'CREDIT';
IF debit_sum != credit_sum THEN
RAISE EXCEPTION 'Transaction imbalance: Debits (%) != Credits (%)', debit_sum, credit_sum;
END IF;
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
Production Technology Inventory
The programming languages, frameworks, database engines, and runtime environments deployed across Asabiyyah engineering projects.
Frontend & Client Systems
- React 18 & Next.js: Component architectures & statically generated portals
- TypeScript: Strict compile-time typing across web applications
- Tailwind CSS: Predictable, tokenized responsive styling system
- Flutter & Dart: Cross-platform native mobile clients (Android & iOS)
Backend APIs & Services
- FastAPI & Python 3: High-performance async microservices with OpenAPI schemas
- NestJS & Node.js: Enterprise modular backend service architectures
- Pydantic v2: Strict runtime payload validation and serialization
- Celery & Redis: Asynchronous task queues and sliding-window rate limiting
Applied AI & NLP
- Quantized LLMs (Qwen 2.5B): 4-bit local edge inference for resource-constrained setups
- PostgreSQL tsvector: Hybrid lexical and semantic retrieval pipelines
- N-ATLAS Speech NLP: Native Hausa speech-to-text recognition
- PyTorch & HuggingFace: Local model deployment and embedding generation
Databases & Persistence
- PostgreSQL 16: Primary relational storage with strict foreign key constraints
- SQLite 3: Embedded local client persistence with WAL mode enabled
- Alembic: Version-controlled, idempotent database schema migrations
- Redis: Session storage, cryptographic cache, and rate-limiting counters
Infrastructure & Edge
- Docker & Compose: Hardened, reproducible multi-stage container builds
- Caddy Server: Automated TLS certificate management via Let's Encrypt
- Cloudflare Pages & Edge: Global CDN distribution and edge serverless execution
- Systemd: Service supervision and automated failure recovery on Linux
Security & Governance
- HMAC-SHA256: Cryptographic webhook signature verification
- Automated PII Redaction: NDPR-compliant log scrubbing of sensitive user data
- Honeypot Bot Defense: Zero-friction behavioral bot mitigation
- Strict CSP: Content Security Policy headers preventing XSS vulnerabilities
Discuss Systems Architecture with Our Engineering Team
Whether you need an offline-first mobile app, a double-entry ledger integration, or a secure RAG pipeline, we are ready to review your technical specs.
Initiate Engineering Consultation