Create .env in the project root:
cd /Users/agu/Desktop/emberhacks/emberhacks
cp .env.template .env
nano .envAdd your API keys:
GOOGLE_API_KEY=AIzaSyXXXXXXXXXXXXXXXXXXXX
ELEVENLABS_API_KEY=sk_XXXXXXXXXXXXXXXXXXXXXXXXCreate .env in the frontend folder:
cd /Users/agu/Desktop/emberhacks/emberhacks/frontend
cp .env.template .env
nano .envAdd your Porcupine key:
VITE_PORCUPINE_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-
Google Gemini API Key
- Go to: https://aistudio.google.com/app/apikey
- Sign in with Google account
- Click "Create API Key"
- Copy the key
-
ElevenLabs API Key
- Go to: https://elevenlabs.io/
- Sign up or log in
- Go to Settings → API Key
- Copy your API key
-
Porcupine Access Key
- Go to: https://console.picovoice.ai/
- Sign up or log in
- Copy your Access Key from the dashboard
emberhacks/
├── .env ← Backend API keys (ROOT)
├── .env.template ← Template for backend
├── frontend/
│ ├── .env ← Frontend API keys
│ └── .env.template ← Template for frontend
└── backend/
└── (no .env here!)
- ✅ All backend files now load from project root
.env - ✅ Frontend loads from
frontend/.env - ✅
.envfiles are in.gitignore(never committed) - ✅ Use
.env.templatefiles as reference
After setting up environment variables:
Terminal 1 - Backend:
cd /Users/agu/Desktop/emberhacks/emberhacks
source venv/bin/activate
python backend/main.pyTerminal 2 - Frontend:
cd /Users/agu/Desktop/emberhacks/emberhacks/frontend
npm run devMake sure:
.envfile exists in project root (not in backend folder)- File contains:
ELEVENLABS_API_KEY=your_actual_key - No quotes around the key
- No spaces before/after the
=
Run:
cd /Users/agu/Desktop/emberhacks/emberhacks
source venv/bin/activate
pip install google-generativeai flask python-dotenv requests playwrightAll backend files now automatically load from project root. If you still have issues:
# Check if .env exists in root
ls -la /Users/agu/Desktop/emberhacks/emberhacks/.env
# Check contents
cat /Users/agu/Desktop/emberhacks/emberhacks/.envThese files now load .env from project root:
- ✅
backend/main.py - ✅
backend/agent_runner.py - ✅
backend/test_elevenlabs.py
All use:
from pathlib import Path
project_root = Path(__file__).parent.parent
env_path = project_root / '.env'
load_dotenv(dotenv_path=env_path)