Abd Alftah Salem
Hire me
←All case studies

Case study · Private project

Daw

An offline-first, multi-school learning platform — NestJS API, Next.js portals and a Flutter app — built for classrooms where the internet comes and goes.

01Problem

School software that assumes a connection

Daw was designed for schools in Gaza running in tents and shelters, where internet and power are unreliable. Typical e-learning tools stop working the moment the connection drops.

The goal: run a full school day — attendance, lessons, quizzes, grades, parent messages — offline, and sync whenever a connection appears.

02My role

Creator and lead developer

I own the product end to end: requirements, architecture, stack rules (NestJS + TypeORM + PostgreSQL, Flutter + Riverpod + drift, Arabic-first RTL) and the three repositories — backend, web, mobile — each with CI, module READMEs and tests.

03How it works

One API, two clients, an offline engine

One NestJS API serves five Next.js portals (platform, school, teacher, student, parent) and the Flutter app. Media processing, PDF report cards, nightly jobs and AI indexing run on BullMQ workers.

On the phone, drift (SQLite) is the source of truth: screens read only the local database, the network just fills it, and offline work waits in an outbox.

Daw architecture

Daw architectureStudents' phonesClassroom share · Wi-FiFlutter appdrift · outbox · syncWeb portalsNext.js · 5 rolesNestJS APIREST · Socket.IO · syncQueue workersBullMQPostgreSQL 16pgvector · change logRedisqueues · realtimeS3 storagepresigned media

04Screens

Screens (demo data)

05Key technical decisions

The choices that shaped it

Trigger-based change log for sync

Every syncable table has a PostgreSQL trigger appending to sync_changes under one seq cursor. The app bootstraps a role-scoped snapshot once, then pulls only what changed since its cursor.

Row-level multi-tenancy

One database, school_id on every school-owned table, and the school always taken from the access token — never the request body. A dedicated e2e suite proves cross-school isolation.

Offline writes go through the same rules

POST /sync/push replays offline work through the same services and permission checks as REST — no second, weaker code path.

06Hard parts solved

What made it more than a script

Conflicts and duplicate retries

Each mutation carries a clientMutationId and returns APPLIED, DUPLICATE, CONFLICT or REJECTED, so flaky retries are idempotent. Explicit rules settle conflicts: an admin's attendance edit beats a teacher's offline copy; lesson fields merge one by one.

Classroom share with no internet

The teacher's phone runs a token-protected HTTP server on local Wi-Fi with a QR code. Lessons stream in resumable 256 KB Range chunks verified by SHA-256; quizzes arrive without answer keys.

Arabic-aware grading and AI answers

Short answers are normalised (tashkeel, alef/hamza forms, Arabic-Indic digits) before grading. The study assistant runs RAG over each course's PDFs with pgvector (HNSW), scoped in SQL to the caller's school, and cites pages — or says the answer isn't in the materials.

07Outcome

Where it stands

All three apps pass their checks: zero lint/analyze warnings, reversible migrations, an Android build. It is a private project, not publicly deployed; screenshots use local demo seed data.

451automated tests
257API operations (OpenAPI)
27backend modules
3repos: API · web · mobile

Automated tests by suite

Backend unit173
Backend e2e107
Web (Vitest)87
Mobile (flutter_test)84

Source: test cases counted in each repo's main branch (Jest, Vitest, flutter_test).

Modules and features per codebase

Backend modules27
Web features24
Mobile features19

Source: folders under src/modules (backend), src/features (web), lib/features (mobile).

08Stack & links

Built with

Private project — no public demo, live link or source code.

© 2026 Abd Alftah Salem · Back to portfolio