#!/bin/bash

# TimeSafari Electron Setup Script
# This script installs all required dependencies for the Electron platform

set -e

echo "🔧 Setting up Electron dependencies..."

# Navigate to electron directory
cd electron

# Install required dependencies for Capacitor SQLite plugin
echo "📦 Installing better-sqlite3-multiple-ciphers..."
npm install better-sqlite3-multiple-ciphers

echo "📦 Installing electron-json-storage..."
npm install electron-json-storage

# Rebuild native modules
echo "🔨 Rebuilding native modules..."
npm run build

echo "✅ Electron setup complete!"
echo ""
echo "To run the Electron app:"
echo "  npm run electron:start"
echo ""
echo "Or from the project root:"
echo "  npm run electron:dev" 