How cyetheguy/uark_csce_eeg_capstone works
DreamRT is a wireless EEG sleep-monitoring product: users sign in, connect a BLE device, view live EEG and sleep-stage feedback, and review or export saved sessions. The React reader is the user-facing hub; its hooks call the Python API, which coordinates BLE acquisition, signal processing, and encrypted per-user session storage. Review and sleep statistics are additional product stages. The README documents the device-to-tracer workflow, while sampled code confirms key UI/API and backend calls; unsampled subsystem links are omitted or marked unverified.
Main entry points: EEGDataReader.tsx EEG reader · main.py HTTP API · data_processor.py Signal processing · crypto_ops.py Account & encryption
Components 21
Reader UI
- Desktop app shell
frontend/electron/main.cjs - Reader routes
frontend/src/App.tsx - EEG reader
frontend/src/functions/components/EEGDataReader/EEGDataReader.tsx - Login state
frontend/src/functions/components/EEGDataReader/hooks/useAuth.ts - Session data
frontend/src/functions/components/EEGDataReader/hooks/useSleepData.ts - EEG visualization
frontend/src/functions/components/EEGDataReader/components/VisualizationPanel.tsx - Session controls
frontend/src/functions/components/EEGDataReader/components/SessionPanel.tsx - Stage estimation
frontend/src/functions/components/EEGDataReader/utils/sleepStagesFromAmplitude.ts
Backend API
- HTTP API
backend/main.py
Acquisition & Analysis
- BLE bridge
backend/ble_comms.py - Signal processing
backend/data_processor.py - Sleep staging
backend/sleep_stages_amplitude.py
Accounts & Sessions
- Account & encryption
backend/crypto_ops.py - Encrypted sessions
backend/crypto_ops.py - Runtime data paths
backend/runtime_paths.py
EEG Hardware
- EEG device firmware
firmware/main.c - Desktop BLE client
backend/CommunicationManager/src/Desktop/ConnectionManager.cpp - Device BLE module
backend/CommunicationManager/src/Device/DeviceBLEModule.cpp - Desktop security
backend/CommunicationManager/src/Desktop/SecurityManager.cpp - Big integer math
backend/CommunicationManager/include/Desktop/BigInt.h
Other components
- EEG user
Connections 23
- EEG user → Desktop app shell: opens
- Desktop app shell → Reader routes: hosts
- Reader routes → EEG reader: routes to
frontend/src/App.tsx - EEG user → EEG reader: uses
- EEG reader → Login state: uses
frontend/src/functions/components/EEGDataReader/EEGDataReader.tsx - EEG reader → Session data: uses
frontend/src/functions/components/EEGDataReader/EEGDataReader.tsx - EEG reader → EEG visualization: renders
frontend/src/functions/components/EEGDataReader/EEGDataReader.tsx - EEG reader → Session controls: renders
frontend/src/functions/components/EEGDataReader/EEGDataReader.tsx - Session data → Stage estimation: computes labels
frontend/src/functions/components/EEGDataReader/hooks/useSleepData.ts - Login state → HTTP API: logs in
frontend/src/functions/components/EEGDataReader/hooks/useAuth.ts - Session data → HTTP API: requests sessions
frontend/src/functions/components/EEGDataReader/hooks/useSleepData.ts - HTTP API → Account & encryption: authenticates
backend/main.py - HTTP API → Signal processing: requests plots
backend/main.py - HTTP API → BLE bridge: gets samples
backend/main.py - HTTP API → Signal processing: exports samples
backend/main.py - Signal processing → Account & encryption: decrypts sessions
backend/data_processor.py - Signal processing → Sleep staging: uses staging
backend/data_processor.py - Account & encryption → Encrypted sessions: reads and writes
backend/crypto_ops.py - Account & encryption → Runtime data paths: resolves directories
backend/crypto_ops.py - EEG device firmware → Desktop BLE client: streams BLE data
- Desktop BLE client → BLE bridge: relays samples
- EEG device firmware → Device BLE module: BLE interface
- Desktop security → Big integer math: uses arithmetic