Zum Hauptinhalt springen

Lokale Entwicklung

Diese Anleitung erklärt, wie du JustCall lokal einrichtest.

Voraussetzungen

  • Node.js 20+
  • npm oder pnpm
  • Docker (optional, für lokale Supabase)
  • Supabase CLI
  • Fly.io CLI

1. Repository klonen

git clone https://github.com/milionmohamed1993/justcall-restaurant-hub.git
cd justcall-restaurant-hub

2. Dependencies installieren

# Frontend
npm install

# Voice Server
cd voice-server
npm install
cd ..

# Docs (optional)
cd docs-site
npm install
cd ..

3. Environment Variables

Erstelle .env.local im Root:

# Supabase
VITE_SUPABASE_URL=https://lgmzgyzaynrwgxyyhffw.supabase.co
VITE_SUPABASE_ANON_KEY=eyJ...

# Google Maps (für Delivery Zones)
VITE_GOOGLE_MAPS_API_KEY=AIza...

Erstelle .env in voice-server/:

# Supabase
SUPABASE_URL=https://lgmzgyzaynrwgxyyhffw.supabase.co
SUPABASE_SERVICE_ROLE_KEY=eyJ...

# OpenAI
OPENAI_API_KEY=sk-...

# Redis (Upstash)
UPSTASH_REDIS_REST_URL=https://...
UPSTASH_REDIS_REST_TOKEN=...

# Optional: Debug
LOG_LEVEL=debug

4. Frontend starten

npm run dev

Öffne http://localhost:5173

5. Voice Server starten

cd voice-server
npm run dev

Der Server läuft auf Port 3000.

6. Tunneling für Twilio (ngrok)

Für lokale Voice-Tests brauchst du einen Tunnel:

ngrok http 3000

Kopiere die HTTPS-URL und konfiguriere sie in der Twilio Console als Webhook.

Nützliche Befehle

BefehlBeschreibung
npm run devFrontend Dev Server
npm run buildProduction Build
cd voice-server && npm run devVoice Server mit Hot Reload
cd voice-server && npm run buildVoice Server kompilieren
supabase functions serveEdge Functions lokal
flyctl logs -a justcall-voiceVoice Server Logs

Debugging

Frontend

React DevTools und Network Tab in Chrome DevTools.

Voice Server

# Live Logs
flyctl logs -a justcall-voice

# Oder lokal mit Debug Level
LOG_LEVEL=debug npm run dev

Edge Functions

# Supabase Dashboard → Edge Functions → Logs
# Oder CLI:
supabase functions logs tool-get-menu