ClassGuard
We built an Android tablet client that blocks non-school apps and logs into video classes automatically.
10+ devices remain locked in the app without bypass vectors.
commands like locking or messaging take under 100ms.
System Bottlenecks
Primary school students get distracted during video classes by exiting the lesson app to play games or watch videos. Setting up peer-to-peer video calls was too complex for children to do without help.
Architectural Move
We wrote a Flutter app connected to a Kotlin background service. The service calls native Android LockTask APIs to lock the device window and block gestures. On the server side, we run a Hono API and Durable Objects on Cloudflare to coordinate WebRTC video calls and stream state updates over WebSockets.
Execution Path
Access Control: We set up session authorization for students, teachers, and parents using Better Auth.
Socket Connection: We connected client devices to persistent Durable Objects (`StudentSessionDO`) to stream status data.
Attention Tracking: We streamed camera gaze markers and hardware status through the socket to parent dashboards.
Video Coordination: We used Durable Objects and Cloudflare RealtimeKit to negotiate WebRTC connections automatically.
Android Lock: We wrote a Kotlin service that intercepts hardware buttons and locks the UI screen.
"The app keeps students inside the class screen. They cannot exit the lesson to browse other sites, and video feeds connect automatically."
— Haris Lodhi, Principal, Beaconhouse Academy
Project Gallery
Core Stack
- Dart (Flutter Framework & Riverpod)
- TypeScript (Cloudflare Workers & Hono)
- Cloudflare Durable Objects & D1 Database
- Cloudflare RealtimeKit (WebRTC SFU)
- Better Auth & Drizzle ORM
- Kotlin (Android Device Admin & LockTask APIs)
- Swift (iOS Profiles)
Under-the-hood Challenge
Sending remote lock commands and video feeds to hundreds of tablets without running a high-cost server cluster. We routed connection requests through Cloudflare Durable Objects. Each student device links to an isolated instance that processes WebSocket messages, falling back to a database queue when the device is offline. This delivers remote commands in under 100ms without idle server fees.
This project combines Android Device Administration with serverless edge databases. Offloading WebRTC coordination and telemetry queues to Cloudflare Workers keeps the app fast and removes the need to maintain dedicated socket servers.
