Back

2026

Under development

Lyven

Live classroom platform for teachers · built by Vikrant Kumar

A live classroom platform where a teacher runs a shared whiteboard, polls and lecture slides for the whole class from one dashboard, and AI grades handwritten homework in the background.

Still being built, so some features may be unfinished.

ReactViteTailwind CSSFramer MotionThree.jsNode.jsExpressMongoDBMongooseSocket.ioRedisBullMQGemini APIDockerKubernetes
Live siteSource is private. Happy to walk through the code in an interview.

The problem

Teachers juggle a projector, a paper register, a pile of homework to mark and a separate app for every quiz. Students on their own devices see none of what is on the board. I wanted one place where a teacher starts a session, students join with a PIN and see the board, slides and polls live, and the slow work (marking handwritten homework, planning lessons, emailing parents) happens automatically.

Decisions and why

Live session state in Redis, not in server memory

A live 'flight deck' (whiteboard history, chat, doubts, joined students, the open poll, zoom and pan) is stored in Redis under its PIN, and Socket.io uses the Redis adapter. Any server instance can serve any student, and a student who joins late gets the full board state in one sync event instead of a blank canvas.

Same code with or without Redis

Every Redis call goes through one service class that falls back to an in-memory store when no REDIS_URL is set. Locally the app runs with just MongoDB; in production the same code gets shared state, caching and the job queue without any changes.

AI grading as a background job

Reading a handwritten page with Gemini takes several seconds, too long to hold an HTTP request open. The upload is put on a BullMQ queue, a worker grades it against the teacher's rubric, writes the score to the gradebook, deletes the temp file and pushes the result to the teacher over the socket. Without Redis it falls back to grading in the request.

Caching AI answers by their input

Lesson plans, maths solutions and visual aids are cached in Redis using a key built from the prompt inputs, kept for a day, a week or a month depending on how often the result changes. The same request from another teacher costs nothing and returns instantly.

Organised by feature, ready to scale

The backend is split into feature folders (auth, classroom, course, student, AI) with Zod request validation, role checks on every route, Helmet, rate limiting and Mongo sanitising. It ships as Docker images with Kubernetes manifests for the API, frontend, MongoDB, Redis and the ingress.

The hardest part

Keeping a live whiteboard in sync for everyone in the room. Drawing sends a lot of events, so stroke start and move events go straight to the room, and only the finished stroke is written into the saved board history. That keeps drawing smooth while still letting a late joiner rebuild the board. Disconnects were the other tricky part: if the teacher drops, the session closes for every student and is removed from Redis; if a student drops, they are taken off the teacher's list, the raised-hand queue and any co-op room, so the teacher's dashboard always shows who is really there.