removed supabase placeholder dependency completely for smooth startup and added macos scripts too. updated README.md for more info
parent
036cca5881
commit
688eb2a5c8
@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
echo "Cleaning up project for GitHub..."
|
||||
|
||||
echo "Removing node_modules directory..."
|
||||
rm -rf node_modules
|
||||
|
||||
echo "Removing dist directory..."
|
||||
rm -rf dist
|
||||
|
||||
echo "Removing dist-electron directory..."
|
||||
rm -rf dist-electron
|
||||
|
||||
echo "Removing release directory..."
|
||||
rm -rf release
|
||||
|
||||
echo "Removing package-lock.json..."
|
||||
rm -f package-lock.json
|
||||
|
||||
echo "Removing any .env files..."
|
||||
rm -f .env .env.local .env.development .env.production
|
||||
|
||||
echo "Cleanup complete!"
|
||||
echo "Ready to commit to GitHub."
|
||||
echo "Run 'npm install' after cloning to install dependencies."
|
||||
echo "Press Enter to continue..."
|
||||
read
|
||||
@ -1,122 +1,40 @@
|
||||
import { createClient } from "@supabase/supabase-js"
|
||||
// This file has been emptied to remove Supabase dependencies.
|
||||
// The open-source version uses local configuration instead.
|
||||
|
||||
console.log("Supabase URL:", import.meta.env.VITE_SUPABASE_URL)
|
||||
console.log(
|
||||
"Supabase Anon Key:",
|
||||
import.meta.env.VITE_SUPABASE_ANON_KEY?.slice(0, 10) + "..."
|
||||
)
|
||||
|
||||
const supabaseUrl = import.meta.env.VITE_SUPABASE_URL
|
||||
const supabaseAnonKey = import.meta.env.VITE_SUPABASE_ANON_KEY
|
||||
|
||||
if (!supabaseUrl || !supabaseAnonKey) {
|
||||
throw new Error("Missing Supabase environment variables")
|
||||
}
|
||||
|
||||
export const supabase = createClient(supabaseUrl, supabaseAnonKey, {
|
||||
// Export empty objects to prevent import errors in case any components still reference this file
|
||||
export const supabase = {
|
||||
auth: {
|
||||
flowType: "pkce",
|
||||
detectSessionInUrl: true,
|
||||
persistSession: true,
|
||||
autoRefreshToken: true,
|
||||
debug: true,
|
||||
storage: {
|
||||
getItem: (key) => {
|
||||
const item = localStorage.getItem(key)
|
||||
console.log("Auth storage - Getting key:", key, "Value exists:", !!item)
|
||||
return item
|
||||
},
|
||||
setItem: (key, value) => {
|
||||
console.log("Auth storage - Setting key:", key)
|
||||
localStorage.setItem(key, value)
|
||||
},
|
||||
removeItem: (key) => {
|
||||
console.log("Auth storage - Removing key:", key)
|
||||
localStorage.removeItem(key)
|
||||
}
|
||||
}
|
||||
getUser: async () => ({ data: { user: null } }),
|
||||
onAuthStateChange: () => ({ data: { subscription: { unsubscribe: () => {} } } }),
|
||||
signOut: async () => ({ error: null }),
|
||||
exchangeCodeForSession: async () => ({ error: null }),
|
||||
signInWithOAuth: async () => ({ data: null, error: null })
|
||||
},
|
||||
realtime: {
|
||||
params: {
|
||||
eventsPerSecond: 10
|
||||
},
|
||||
headers: {
|
||||
apikey: supabaseAnonKey
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
export const signInWithGoogle = async () => {
|
||||
try {
|
||||
console.log("Initiating Google sign in...")
|
||||
const { data, error } = await supabase.auth.signInWithOAuth({
|
||||
provider: "google",
|
||||
options: {
|
||||
redirectTo: window.location.origin
|
||||
}
|
||||
from: () => ({
|
||||
select: () => ({
|
||||
eq: () => ({
|
||||
single: async () => null,
|
||||
maybeSingle: async () => null
|
||||
})
|
||||
|
||||
if (error) {
|
||||
console.error("Google sign in error:", error)
|
||||
throw error
|
||||
}
|
||||
|
||||
console.log("Google sign in response:", data)
|
||||
return data
|
||||
} catch (error) {
|
||||
console.error("Unexpected error during Google sign in:", error)
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
let channel: ReturnType<typeof supabase.channel> | null = null
|
||||
|
||||
// Monitor auth state changes and manage realtime connection
|
||||
supabase.auth.onAuthStateChange((event, session) => {
|
||||
console.log("Auth state changed:", event, session?.user?.id)
|
||||
console.log("Full session data:", session)
|
||||
|
||||
if (event === "SIGNED_IN" && session) {
|
||||
// Only establish realtime connection after successful sign in
|
||||
console.log("Establishing realtime connection...")
|
||||
|
||||
// Clean up existing channel if any
|
||||
if (channel) {
|
||||
channel.unsubscribe()
|
||||
}
|
||||
|
||||
channel = supabase.channel("system", {
|
||||
config: {
|
||||
presence: {
|
||||
key: session.user.id
|
||||
}
|
||||
}
|
||||
}),
|
||||
update: () => ({
|
||||
eq: () => ({
|
||||
select: () => ({
|
||||
single: async () => null
|
||||
})
|
||||
|
||||
channel
|
||||
.on("system", { event: "*" }, (payload) => {
|
||||
console.log("System event:", payload)
|
||||
})
|
||||
.subscribe((status) => {
|
||||
console.log("Realtime subscription status:", status)
|
||||
if (status === "SUBSCRIBED") {
|
||||
console.log("Successfully connected to realtime system")
|
||||
}
|
||||
if (status === "CHANNEL_ERROR") {
|
||||
console.error("Realtime connection error - will retry in 5s")
|
||||
setTimeout(() => {
|
||||
channel?.subscribe()
|
||||
}, 5000)
|
||||
}
|
||||
})
|
||||
}
|
||||
}),
|
||||
channel: () => ({
|
||||
on: () => ({
|
||||
subscribe: () => ({
|
||||
unsubscribe: () => {}
|
||||
})
|
||||
})
|
||||
})
|
||||
};
|
||||
|
||||
if (event === "SIGNED_OUT") {
|
||||
// Clean up realtime connection on sign out
|
||||
if (channel) {
|
||||
console.log("Cleaning up realtime connection")
|
||||
channel.unsubscribe()
|
||||
channel = null
|
||||
}
|
||||
}
|
||||
})
|
||||
export const signInWithGoogle = async () => {
|
||||
console.log("Sign in with Google not available in open-source version");
|
||||
return { data: null };
|
||||
};
|
||||
|
||||
@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
echo "=== Interview Coder - Invisible Edition (No Paywall) ==="
|
||||
echo
|
||||
echo "IMPORTANT: This app is designed to be INVISIBLE by default!"
|
||||
echo "Use the keyboard shortcuts to control it:"
|
||||
echo
|
||||
echo "- Toggle Visibility: Cmd+B"
|
||||
echo "- Take Screenshot: Cmd+H"
|
||||
echo "- Process Screenshots: Cmd+Enter"
|
||||
echo "- Move Window: Cmd+Arrows (Left/Right/Up/Down)"
|
||||
echo "- Adjust Opacity: Cmd+[ (decrease) / Cmd+] (increase)"
|
||||
echo "- Reset View: Cmd+R"
|
||||
echo "- Quit App: Cmd+Q"
|
||||
echo
|
||||
echo "When you press Cmd+B, the window will toggle between visible and invisible."
|
||||
echo "If movement shortcuts aren't working, try making the window visible first with Cmd+B."
|
||||
echo
|
||||
|
||||
# Navigate to script directory
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
echo "=== Step 1: Creating required directories... ==="
|
||||
mkdir -p ~/Library/Application\ Support/interview-coder-v1/temp
|
||||
mkdir -p ~/Library/Application\ Support/interview-coder-v1/cache
|
||||
mkdir -p ~/Library/Application\ Support/interview-coder-v1/screenshots
|
||||
mkdir -p ~/Library/Application\ Support/interview-coder-v1/extra_screenshots
|
||||
|
||||
echo "=== Step 2: Cleaning previous builds... ==="
|
||||
echo "Removing old build files to ensure a fresh start..."
|
||||
rm -rf dist dist-electron
|
||||
rm -f .env
|
||||
|
||||
echo "=== Step 3: Building application... ==="
|
||||
echo "This may take a moment..."
|
||||
npm run build
|
||||
|
||||
echo "=== Step 4: Launching in stealth mode... ==="
|
||||
echo "Remember: Cmd+B to make it visible, Cmd+[ and Cmd+] to adjust opacity!"
|
||||
echo
|
||||
export NODE_ENV=production
|
||||
npx electron ./dist-electron/main.js &
|
||||
|
||||
echo "App is now running invisibly! Press Cmd+B to make it visible."
|
||||
echo
|
||||
echo "If you encounter any issues:"
|
||||
echo "1. Make sure you've installed dependencies with 'npm install'"
|
||||
echo "2. Make sure this script has execute permissions (chmod +x stealth-run.sh)"
|
||||
echo "3. Press Cmd+B multiple times to toggle visibility"
|
||||
echo "4. Check Activity Monitor to verify the app is running"
|
||||
Loading…
Reference in new issue