To get started with development on your local machine:
Clone the repository:
git clone https://github.com/power-narrator/power-narrator-fe.git
cd power-narrator
Install dependencies:
npm install
Run in development mode:
npm run dev
To build and package the application for distribution:
Compile and Build:
npm run build
This runs TypeScript compilation, Vite build for the frontend, and compiles the Electron main process.
Package for Distribution:
npm run dist
This builds the application and creates a distributable package (e.g., .dmg or .app for macOS) using electron-builder.
Power Narrator is built as an Electron application with three distinct layers providing a modular and extensible architecture.
┌─────────────────────────────────────────┐
│ React Frontend (Vite) │ ← src/
│ ViewerPage · SettingsModal · LandingPage│
└────────────────┬────────────────────────┘
│ Electron IPC (ipcRenderer / ipcMain)
┌────────────────▼────────────────────────┐
│ Electron Main Process │ ← electron/main.ts
│ IPC Handlers · TtsManager · Store │
└──────┬─────────────────────┬────────────┘
│ │
┌──────▼──────┐ ┌────────▼────────────┐
│ PptProvider │ │ TtsProvider │
│ (Platform) │ │ (TTS Backend) │
└──────┬──────┘ └────────┬────────────┘
│ │
┌────▼──────────┐ ┌─────▼────────────┐
│ MacPptProvider│ │ GcpTtsProvider │
│ (AppleScript) │ │ LocalTtsProvider │
└──────┬────────┘ └──────────────────┘
│
┌────────▼────────┐
│ XmlPptProvider │ ← Decorator over MacPptProvider
│ (XML CLI) │ uses slide-voice-pptx binary
└─────────────────┘
PptProvider and TtsProvider interfaces allow for multiple implementations (e.g., switching between Google Cloud and Local TTS).XmlPptProvider wraps the standard provider to add XML-based manipulation capabilities via a bundled Python CLI.Create a .env file in the root directory to configure your TTS providers:
# --- Google Cloud TTS ---
# Set provider to 'gcp' and provide the path to your service account key
TTS_PROVIDER=gcp
GOOGLE_APPLICATION_CREDENTIALS=/path/to/your-google-cloud-key.json
# --- Local TTS (Mimic 3) ---
# Uncomment to use local server (default if TTS_PROVIDER is missing or not 'gcp')
# TTS_PROVIDER=local
# LOCAL_TTS_URL=http://localhost:59125/api/tts
# LOCAL_TTS_VOICE=en_UK/apope_low
Start the Mimic 3 Docker container:
docker run -it --user root -p 59125:59125 mycroftai/mimic3
If you modify the VBA source code (electron/scripts/ppt-tools.bas), you must manually recompile the .ppam add-in file. Follow these step-by-step instructions:
AudioTools already exists, right-click it and select Remove AudioTools....electron/scripts/ppt-tools.bas file.AudioTools listed under the Modules folder.ppt-tools.ppam.electron/scripts/ directory of your project, overwriting the existing file if prompted.electron/scripts/ppt-tools.ppam.electron/: Main process logic, IPC handlers, and providers.
platform/: PowerPoint provider implementations.tts/: Text-to-speech providers and managers.scripts/: AppleScript automation and VBA macros.src/: React frontend source code built with Vite and Mantine.xml/: Python source for the optional XML CLI manipulation tool.Power Narrator includes a different mode of operation that uses a Python-based CLI (slide-voice-pptx) to manipulate the .pptx XML directly, bypassing some VBA macro dependencies.
xattr -cr "/path/to/Power Narrator.app"
59125 and the voice name in .env is valid.