Skip to main content
@aymanbismail

Trainer OS

An offline-first desktop platform that lets a trainer deliver a multi-day programme and run attendance, scoring, assignments and reports from one laptop, built with Next.js inside Electron.

Tech Stack :

Private

Trainer OS: screenshot 1 of 3
1 / 3

Project Overview

Trainers who run multi-day programmes usually juggle slide decks, spreadsheets, attendance sheets and shared folders, often in rooms with unreliable internet. Trainer OS brings the delivery and the operations into one workspace that runs entirely on the trainer's laptop, with no server and no connection required.
It has two sides. Training Mode is for the room: units organized by day, a presentation mode with in-room questions, and interactive simulations that open full screen. Management Mode, locked behind a PIN, is for everything around it: participants, attendance, scores, assignments, final projects and reports.
I built it for Besterra, end to end, as a Windows desktop app: a Next.js 16 application embedded in Electron, with Prisma on a local SQLite database, and a fully Arabic, right-to-left interface.

Key Features

  • Presentation mode: keyboard-driven slides with trainer notes, scenarios, discussions and multiple-choice questions revealed and explained in the room
  • Interactive simulations: eight scored scenarios (phishing, malicious links, incident response, metadata exposure and more), each in its own full-screen window, with results saved automatically
  • Participant management: profiles, evidence photos, and bulk import from Excel or CSV with a row-by-row preview and duplicate detection
  • Attendance and scoring: per-day attendance (present, late, absent, excused), bulk score entry and a leaderboard
  • Assignments and final projects: file submissions with a review flow (approve or request changes) and trainer feedback
  • Dashboard: attendance, scores and progress at a glance, filtered by training day
  • Reports: participants, attendance, scores and assignments in Excel and Arabic PDF, or all eight files in one ZIP
  • Backup and restore: one-click archives of the data and files, with a safety snapshot taken before every restore

Technical Highlights

  • Next.js inside Electron: the standalone Next.js server runs as a local child process on 127.0.0.1, behind a splash screen, with a single-instance lock
  • Offline by design: all data lives in SQLite and local folders under the user's Documents, so nothing depends on a network
  • Streaming jobs: long exports and backups stream live progress and can be cancelled mid-run, cleaning up partial files
  • Arabic PDF reports: right-to-left HTML rendered to PDF by the system's Edge or Chrome through puppeteer-core, launching the browser once per export
  • Resilient data layer: retries with exponential backoff for transient SQLite locks, idempotent seeding, and separate log files per area
  • Hardened desktop shell: context isolation, a minimal preload bridge, path-traversal guards on file access, and a scrypt-hashed PIN

My Contributions

  • Designed and built the entire product, from the interface to the Electron packaging and the Windows installer
  • Modelled the data with Prisma: courses, units, participants, attendance, scores, submissions and simulation results
  • Built the presentation engine and the eight interactive simulations
  • Implemented the Excel and CSV import pipeline with validation, preview and duplicate detection
  • Built the report engine (ExcelJS and Arabic PDF) and the cancellable streaming job system for exports and backups
  • Added diagnostics and a self-test that checks storage, the database and PDF rendering

Challenges & Solutions

Challenge: A Next.js app normally needs a server, but training often happens in rooms with poor or no internet.
Solution: Ship the standalone Next.js server inside Electron, bound to localhost, with SQLite and every upload stored in the user's Documents folder.
Result: The whole platform installs as a normal Windows app and works fully offline.
Challenge: Exporting eight reports, including Arabic PDFs, could take long enough to look frozen.
Solution: A streaming job protocol with live progress and real cancellation, which launches the PDF browser only once for the whole package.
Result: The trainer sees progress file by file, can cancel safely, and still gets the Excel files if PDF rendering isn't available.

Tech Stack

Frontend: Next.js 16, React 19, TypeScript, Tailwind CSS 4, shadcn/ui (Radix UI), Framer Motion, TanStack Table, React Hook Form, Zod
Desktop: Electron 42, electron-builder (Windows installer)
Database: SQLite with Prisma 6
Tools: ExcelJS, puppeteer-core, archiver, pnpm, ESLint

Need something like this?Tell me about your project