feat: Complete onboarding system with No Website functionality
- Add No Website button to Step 2 with business description form - Implement onboarding cache service for browser-side data storage - Add business info database models and API endpoints - Update API key manager to save keys to .env file immediately - Add database migration scripts for business info table - Create reset onboarding script for fresh starts - Implement hybrid data storage (API keys to backend, other data to cache) - Add comprehensive business info CRUD operations - Include database table creation and migration tools
This commit is contained in:
@@ -430,8 +430,11 @@ class APIKeyManager:
|
||||
|
||||
def load_api_keys(self):
|
||||
"""Load API keys from environment variables."""
|
||||
# Reload environment variables first
|
||||
load_dotenv(override=True)
|
||||
# Reload environment variables first - use backend directory path
|
||||
import os
|
||||
backend_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
env_path = os.path.join(backend_dir, ".env")
|
||||
load_dotenv(env_path, override=True)
|
||||
|
||||
env_mapping = {
|
||||
"OPENAI_API_KEY": "openai",
|
||||
@@ -492,8 +495,10 @@ class APIKeyManager:
|
||||
# Update environment variable
|
||||
os.environ[env_var] = api_key
|
||||
|
||||
# Update .env file
|
||||
env_path = ".env"
|
||||
# Update .env file - use backend directory path
|
||||
import os
|
||||
backend_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
env_path = os.path.join(backend_dir, ".env")
|
||||
if os.path.exists(env_path):
|
||||
with open(env_path, 'r') as f:
|
||||
lines = f.readlines()
|
||||
|
||||
Reference in New Issue
Block a user