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:
Om-Singh1808
2025-09-04 11:03:35 +05:30
committed by ي
parent 201960ce9d
commit aeb7751d48
5 changed files with 333 additions and 4 deletions

View File

@@ -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()