How sohzm/cheating-daddy works
1. What this repo is
- This is an Electron desktop application for real-time AI assistance during meetings/interviews.
- There is no backend server in the repo; the app runs locally and talks to external AI APIs directly from the desktop app.
2. Top-level runtime split
- The architecture is the standard Electron split:
- Main process: app lifecycle, window creation, OS-level behavior, packaging.
- Preload layer: safe bridge between Electron and the UI.
- Renderer/UI: the user-facing assistant, settings, onboarding, and session screens.
- The file layout strongly suggests src/index.js as the main entry, src/preload.js as the bridge, and src/components/* as the renderer app.
3. Main-process responsibilities
- src/utils/window.js and src/utils/windowResize.js indicate the main process controls the desktop window: positioning, resizing, always-on-top behavior, and likely click-through toggling.
- This is important because the app is not a normal page UI; it behaves like a transparent overlay window that can be moved and optionally made non-interactive.
4. Renderer application structure
- src/components/app/* contains the top-level app shell, including CheatingDaddyApp.js and AppHeader.js.
- src/components/views/* contains the feature screens:
- MainView for the main session
- OnboardingView for setup
- AssistantView for live AI interaction
- CustomizeView and AICustomizeView for profile/model tuning
- HistoryView, HelpView, and FeedbackView for support and session history
- src/components/index.js likely wires these views together into the renderer entry.
5. Primary user flow
- The app flow appears to be:
1. First-time setup/onboarding
2. User enters API key and chooses a profile/language
3. User starts a live session
4. The assistant consumes screen/audio context and returns help in real time
- The README’s shortcut-driven interaction and “transparent overlay” behavior imply the renderer is optimized for being present during other apps, not as a full-screen standalone workspace.
6. AI integration layer
- src/utils/gemini.js is the core integration with Google Gemini 2.0 Flash Live.
- src/utils/cloud.js and src/utils/localai.js suggest an abstraction over different model/runtime backends or transport modes, with cloud Gemini as the primary path and local AI as an alternate path.
- src/utils/prompts.js centralizes prompt templates and session instructions, which likely vary by profile such as interview, sales, meeting, or presentation.
7. Context gathering pipeline
- src/audioUtils.js plus the README’s audio notes show a dedicated audio-capture path.
- Screen/audio context is the input to the AI layer: the assistant responds based on what is seen/heard rather than on a purely chat-driven conversation.
- Platform-specific audio handling matters:
- macOS uses the bundled SystemAudioDump asset
- Windows uses loopback capture
- Linux falls back to microphone input
8. Persistence and local state
- src/storage.js is the local persistence boundary.
- This likely stores user settings such as API key, selected profile, language, window preferences, and possibly history/session metadata.
- The app appears to keep most state locally on the machine rather than in a remote account system.
9. Cross-process communication boundary
- src/preload.js is the trust boundary between renderer and main process.
- This is where the UI likely gets access to safe APIs for window control, storage, and maybe capture/session commands.
- That boundary matters for the diagram because the renderer should be shown as isolated from direct Electron/OS access.
10. Packaging and desktop distribution
- forge.config.js shows the project is packaged with Electron Forge.
- entitlements.plist indicates macOS-specific signing/permissions support, which is relevant because the app needs screen/audio access and window control permissions.
- src/assets/* contains icons and onboarding assets used in the packaged desktop app.
11. Platform/OS dependencies
- This is a desktop-native product with OS permissions and platform-specific capture behavior.
- The design depends on screen recording permissions, audio capture permissions, and always-on-top window support.
- The README explicitly notes best support on the latest macOS and Windows, with Linux treated more as a testing path.
12. Important architectural takeaway
- The core architecture is: desktop overlay UI → preload bridge → main-process window/control + local storage → AI service adapter → Gemini/other model backend, with screen/audio context feeding the AI response loop.
- If you are drawing it, the main boundaries are:
- renderer UI
- preload bridge
- Electron main/OS integration
- capture utilities
- AI provider layer
- local persistence
Main entry points: MainView.js Main view · index.js App entry · gemini.js Gemini live · window.js Window control
Components 22
Main process
Electron lifecycle, windowing, capture coordination, and local persistence
- App entry · Starts Electron and wires the desktop runtime
src/index.js - Window control · Creates and manages the transparent always-on-top app window
src/utils/window.js - Resize logic · Handles window positioning, sizing, and interaction mode changes
src/utils/windowResize.js - Local state · Stores settings, profile choices, and other machine-local state
src/storage.js - Audio capture · Platform-specific audio input and loopback capture helpers
src/audioUtils.js
Renderer UI
Desktop app shell and user-facing views
- Renderer entry · Bootstraps the renderer application
src/components/index.js - App shell · Top-level assistant layout and navigation frame
src/components/app/CheatingDaddyApp.js - Header · App-level controls and status header
src/components/app/AppHeader.js - Main view · Primary screen that routes between onboarding, sessions, and settings
src/components/views/MainView.js - Onboarding · First-run setup for keys, profile, and language choices
src/components/views/OnboardingView.js - Assistant · Real-time assistance interface during active sessions
src/components/views/AssistantView.js - Customize · General preference and profile tuning screen
src/components/views/CustomizeView.js - AI tuning · Assistant and model-specific configuration screen
src/components/views/AICustomizeView.js - History · Past sessions and saved activity review
src/components/views/HistoryView.js - Help · Usage guidance and troubleshooting
src/components/views/HelpView.js - Feedback · User feedback and issue reporting
src/components/views/FeedbackView.js
AI layer
Provider adapters, prompts, and live assistant logic
- Gemini live · Primary live AI integration used during sessions
src/utils/gemini.js - Cloud adapter · Cloud-side transport and provider abstraction
src/utils/cloud.js - Local adapter · Alternate local runtime or model backend
src/utils/localai.js - Prompt pack · System prompts and role-specific session instructions
src/utils/prompts.js
Packaged assets
Bundled icons and onboarding media
- Assets · Icons and onboarding media bundled with the desktop app
src/assets
Other components
- Bridge · Trusted IPC boundary that exposes safe app controls to the UI
src/preload.js
Connections 25
- App entry → Window control: creates · Main process initializes the overlay window
- App entry → Bridge: loads · Main process attaches the preload bridge
- App entry → Local state: uses · Main process reads and writes local app state
- App entry → Audio capture: coordinates · Main process coordinates platform capture helpers
- Window control → Resize logic: delegates · Window behavior delegates sizing and positioning logic
- Window control → Renderer entry: hosts · Desktop window displays the renderer app
- Bridge → Renderer entry: exposes api · Renderer reaches main-process capabilities through the bridge
- Renderer entry → App shell: mounts · Renderer boots into the app shell
- App shell → Header: includes · Shell renders shared chrome and controls
- App shell → Main view: routes · Shell routes into the main working area
- Main view → Onboarding: first run · Initial setup path leads to onboarding
- Main view → Assistant: session · Primary live-assistance workspace
- Main view → Customize: settings · Main flow opens general customization
- Customize → AI tuning: refines · General settings flow into AI-specific tuning
- Main view → History: reviews · Users can inspect previous sessions
- Main view → Help: supports · Main flow includes help and troubleshooting
- Main view → Feedback: reports · Main flow includes feedback capture
- Assistant → Audio capture: consumes · Live assistant uses captured audio context
- Assistant → Gemini live: queries · Assistant sends context to the AI layer
- Gemini live → Cloud adapter: primary path · Gemini live uses the cloud provider path
- Gemini live → Local adapter: fallback · Local model adapter is an alternate backend
- Gemini live → Prompt pack: uses · Assistant behavior is shaped by prompt templates
- Local state → Customize: persists · Preferences and profile choices are stored locally
- Local state → Onboarding: saves · Onboarding selections are written to local state
- Assets → Onboarding: feeds · Onboarding uses bundled assets and media