How abdullahsajidfr/seekho-sikhao works
1. Repository shape
- This is a two-app monorepo around the same learning-session backend:
- app/seekho-sikhao-woz: a React/Vite web prototype with multiple operator/student surfaces.
- seekho-student: a React Native/Expo mobile student app.
- Both are designed to run in a static demo mode with no credentials, or in a live Wizard-of-Oz mode when Firebase env vars are present.
2. Primary architectural boundary
- The key boundary is between presentation surfaces and a shared Firebase-driven session/logging backend.
- The apps do not appear to share a runtime package; instead they share:
- a common Firebase schema and event vocabulary,
- similar session/logging concepts,
- similar surface/route breakdowns,
- and a shared downstream analytics pipeline to Google Sheets.
3. Web prototype: single SPA with four surfaces
- app/seekho-sikhao-woz is a single-page React app that exposes:
- / room entry,
- /student child-facing learning experience,
- /wizard operator console,
- /teacher teacher-facing UI.
- The SPA is split by surface folders under src/surfaces/*, which makes the diagram naturally “one host app, many role-based UIs.”
4. Web student experience
- The student surface is further divided into screen-level states such as login, subject selection, chat, workbook, input mode, and past chat.
- Supporting components include chat bubbles, camera, drawing canvas, smileyometer overlay, top bar, and workbook question cards.
- This indicates a multimodal tutoring flow: the student can interact through text/chat, drawings, camera, and feedback widgets rather than only a linear form.
5. Operator surfaces: wizard, teacher, admin
- The wizard surface is the human-in-the-loop control plane: composing messages, quick responses, session controls, greetings, incoming messages, and session info.
- The teacher surface provides higher-level monitoring and oversight: class page, student profile, dashboard, login, and guardrails.
- The admin surface focuses on live operations and telemetry: event feed, live chat, manual events, task tracking, session control, and smileyometer delivery.
- In architecture terms, these are different control/observability planes over the same live session data.
6. Mobile student app
- seekho-student is the child-facing app, also split into entry and student surfaces with screens for login, subject selection, chat, workbook, and input mode.
- It mirrors the web student journey but is packaged for native mobile deployment via Expo.
- The mobile app appears intentionally narrower than the web app: it does not include wizard/teacher/admin UIs, only the learner-facing path.
7. Session and state management
- Both apps have Firebase helpers under src/firebase/* and session hooks such as useSession, suggesting that “session” is the main shared domain object.
- The repository’s structure implies a session flow that begins at room/entry, then drives student state, while wizard/teacher surfaces observe or steer that same session.
- The presence of demo.ts in both apps suggests an offline fixture path for the same screen flow when Firebase is unavailable.
8. Shared logging/analytics pipeline
- Event logging is a first-class subsystem, not an afterthought.
- Both apps route events through a shared logEvent style pipeline that writes to:
- Firebase Realtime Database for per-session logs,
- and Google Sheets via a deployed Apps Script endpoint for downstream analysis.
- Event records include timing, phase, source surface, and interaction metadata, so the architecture supports both real-time supervision and later usability analysis.
9. Auto-capture versus semantic events
- The web app mounts a global auto-logger that captures navigation, clicks, inputs, submits, and keydowns across all surfaces.
- The mobile app mirrors the same logging vocabulary using React Native-friendly event hooks and navigation state changes.
- In addition to auto-capture, important domain events like screen/task/smileyometer milestones are emitted explicitly, meaning the logs combine interaction telemetry and study instrumentation.
10. Backend services and infra
- Firebase is the shared live backend:
- Realtime Database stores session state and event logs,
- Storage supports student photo uploads,
- security rules live in repo-managed JSON files.
- The web prototype also has a serverless TTS endpoint at api/tts.ts, deployed through Vercel, which proxies text-to-speech and handles Roman Urdu to Urdu transliteration before synthesis.
- So the backend boundary is not a large custom API; it is mostly managed Firebase plus one small function.
11. Data flow summary
- Typical live flow:
1. Tester enters a room/session code.
2. Student app connects to the Firebase session.
3. Wizard/teacher/admin surfaces observe or update session data.
4. User actions are auto-logged and written to RTDB.
5. The same events are mirrored into Google Sheets for analysis.
6. Optional media uploads go to Firebase Storage.
7. Optional speech output routes through the TTS function.
- This is a loosely coupled, event-driven prototype rather than a tightly centralized API architecture.
12. Deployment and runtime split
- The web app is a browser SPA built with React 19, TypeScript, Vite, and CSS Modules.
- The mobile app is Expo/React Native/TypeScript.
- The TTS function is serverless and isolated from the client bundles.
- The repo therefore has three execution targets: browser SPA, mobile app, and serverless function, all converging on the same Firebase-backed study environment.
13. Important architectural implication
- This repo is optimized for HCI testing and live facilitation, not for production-scale backend complexity.
- The core design pattern is “shared study protocol, multiple surfaces, common event schema,” with demo mode allowing the whole system to run without credentials and live mode turning on real-time Firebase coordination.
Main entry points: App.tsx Web SPA · autolog.ts Event logging · StudentApp.tsx Student UX · config.ts Firebase core
Components 19
Web prototype
Browser SPA with multiple role-based surfaces.
- Web SPA · Single-page prototype hosting entry, student, wizard, teacher, and admin surfaces.
app/seekho-sikhao-woz/src/App.tsx - Room entry · Join flow for entering a study room or session code.
app/seekho-sikhao-woz/src/surfaces/entry/EntryPage.tsx - Student UX · Web student journey with multimodal tutoring states and screens.
app/seekho-sikhao-woz/src/surfaces/student/StudentApp.tsx - Wizard console · Human-in-the-loop control plane for composing and steering live sessions.
app/seekho-sikhao-woz/src/surfaces/wizard/WizardApp.tsx - Teacher view · Teacher-facing monitoring, class, profile, dashboard, and guardrail pages.
app/seekho-sikhao-woz/src/surfaces/teacher/TeacherApp.tsx - Admin ops · Live operations, event feed, manual events, task tracking, and delivery controls.
app/seekho-sikhao-woz/src/surfaces/admin/AdminApp.tsx - Student screens · Login, subject selection, chat, workbook, input mode, and past-chat states.
app/seekho-sikhao-woz/src/surfaces/student/screens/ChatScreen.tsx - Student widgets · Chat bubbles, camera, drawing canvas, workbook cards, top bar, and feedback overlays.
app/seekho-sikhao-woz/src/surfaces/student/components/ChatBubble.tsx - Wizard tools · Compose panel, quick responses, greetings, incoming messages, and session info controls.
app/seekho-sikhao-woz/src/surfaces/wizard/components/ComposePanel.tsx - Teacher pages · Login, class page, student profile, dashboard, and guardrails pages.
app/seekho-sikhao-woz/src/surfaces/teacher/screens/TeacherDashboard.tsx - Admin panels · Event log feed, live chat view, manual events, session control, task tracker, and smileyometer delivery.
app/seekho-sikhao-woz/src/surfaces/admin/components/EventLogFeed.tsx
Mobile app
Expo student app for the learner-only path.
- Mobile app · React Native learner app packaged for native deployment.
seekho-student/App.tsx - Mobile entry · Native join flow for entering a session on mobile.
seekho-student/src/surfaces/entry/EntryScreen.tsx - Mobile student · Mobile student journey mirroring the web learner path.
seekho-student/src/surfaces/student/StudentApp.tsx - Mobile screens · Login, subject selection, chat, workbook, and input mode screens.
seekho-student/src/surfaces/student/screens/ChatScreen.tsx
Shared backend
Firebase-backed session, logging, storage, and analysis integrations.
- Firebase core · Shared live backend for session state, event logs, and demo-vs-live switching.
app/seekho-sikhao-woz/src/firebase/config.ts - Event logging · Auto-capture and explicit domain events routed into session logs.
app/seekho-sikhao-woz/src/lib/autolog.ts - Media + TTS · Photo uploads in Firebase Storage and text-to-speech via the Vercel function.
app/seekho-sikhao-woz/src/firebase/storage.ts - Sheets export · Apps Script endpoint that mirrors study events into Google Sheets for analysis.
app/docs/google-apps-script.js
Connections 23
- Web SPA → Room entry: routes to · Top-level SPA dispatches to room entry.
- Web SPA → Student UX: routes to · Top-level SPA dispatches to learner experience.
- Web SPA → Wizard console: routes to · Top-level SPA dispatches to operator console.
- Web SPA → Teacher view: routes to · Top-level SPA dispatches to teacher view.
- Web SPA → Admin ops: routes to · Top-level SPA dispatches to admin operations.
- Student UX → Student screens: uses · Learner flow is organized into screen states.
- Student UX → Student widgets: uses · Learner flow is composed from interactive widgets.
- Wizard console → Wizard tools: uses · Wizard console is built from control widgets.
- Teacher view → Teacher pages: uses · Teacher view is split into oversight pages.
- Admin ops → Admin panels: uses · Admin surface is assembled from operational panels.
- Mobile app → Mobile entry: routes to · Native app begins with session entry.
- Mobile app → Mobile student: routes to · Native app enters the learner experience.
- Mobile student → Mobile screens: uses · Mobile learner flow is organized into screens.
- Web SPA → Firebase core: connects to · Web surfaces read/write live session state when credentials are present.
- Mobile app → Firebase core: connects to · Mobile surfaces read/write the same session backend.
- Student UX → Event logging: emits · Student interaction telemetry is auto-captured and logged.
- Wizard console → Event logging: emits · Wizard actions and controls are logged as session events.
- Admin ops → Event logging: emits · Admin operations feed the same event stream.
- Mobile student → Event logging: emits · Mobile navigation and interaction telemetry is logged.
- Event logging → Firebase core: writes to · Primary per-session event store in Realtime Database.
- Event logging → Sheets export: mirrors to · Analytics events are exported for later analysis.
- Student UX → Media + TTS: uses · Learner flow can upload media and trigger speech output.
- Firebase core → Media + TTS: supports · Firebase Storage is the shared media backend; TTS is adjacent serverless support.