feat: Complete Google Search Console integration with Clerk authentication
- Add GSC API service with OAuth2 authentication - Implement Clerk authentication for frontend and backend - Add GSC login button and OAuth callback handling - Create comprehensive GSC data fetching and caching - Add authentication middleware for backend API protection - Implement real-time GSC data integration in SEO dashboard - Add user-specific GSC site management - Include comprehensive logging and error handling - Add TypeScript support and proper type definitions - Create environment templates and setup documentation - Update gitignore to exclude sensitive credential files Features added: - GSC OAuth2 authentication flow - Real-time search analytics data - Site list management - Sitemap analysis - User-specific data isolation - Comprehensive error handling - Authentication token management - Popup-based OAuth flow - Data caching and refresh mechanisms Note: gsc_credentials.json should be created locally with your Google OAuth credentials
This commit is contained in:
@@ -42,10 +42,6 @@ from api.onboarding import (
|
||||
get_onboarding_summary,
|
||||
get_website_analysis_data,
|
||||
get_research_preferences_data,
|
||||
save_business_info,
|
||||
get_business_info,
|
||||
get_business_info_by_user,
|
||||
update_business_info,
|
||||
StepCompletionRequest,
|
||||
APIKeyRequest
|
||||
)
|
||||
@@ -437,51 +433,16 @@ async def research_preferences_data():
|
||||
logger.error(f"Error in research_preferences_data: {e}")
|
||||
raise HTTPException(status_code=500, detail=str(e))
|
||||
|
||||
# Business Information endpoints
|
||||
@app.post("/api/onboarding/business-info")
|
||||
async def business_info_save(request: 'BusinessInfoRequest'):
|
||||
"""Save business information for users without websites."""
|
||||
try:
|
||||
from models.business_info_request import BusinessInfoRequest
|
||||
return await save_business_info(request)
|
||||
except Exception as e:
|
||||
logger.error(f"Error in business_info_save: {e}")
|
||||
raise HTTPException(status_code=500, detail=str(e))
|
||||
|
||||
@app.get("/api/onboarding/business-info/{business_info_id}")
|
||||
async def business_info_get(business_info_id: int):
|
||||
"""Get business information by ID."""
|
||||
try:
|
||||
return await get_business_info(business_info_id)
|
||||
except Exception as e:
|
||||
logger.error(f"Error in business_info_get: {e}")
|
||||
raise HTTPException(status_code=500, detail=str(e))
|
||||
|
||||
@app.get("/api/onboarding/business-info/user/{user_id}")
|
||||
async def business_info_get_by_user(user_id: int):
|
||||
"""Get business information by user ID."""
|
||||
try:
|
||||
return await get_business_info_by_user(user_id)
|
||||
except Exception as e:
|
||||
logger.error(f"Error in business_info_get_by_user: {e}")
|
||||
raise HTTPException(status_code=500, detail=str(e))
|
||||
|
||||
@app.put("/api/onboarding/business-info/{business_info_id}")
|
||||
async def business_info_update(business_info_id: int, request: 'BusinessInfoRequest'):
|
||||
"""Update business information."""
|
||||
try:
|
||||
from models.business_info_request import BusinessInfoRequest
|
||||
return await update_business_info(business_info_id, request)
|
||||
except Exception as e:
|
||||
logger.error(f"Error in business_info_update: {e}")
|
||||
raise HTTPException(status_code=500, detail=str(e))
|
||||
|
||||
# Include component logic router
|
||||
app.include_router(component_logic_router)
|
||||
|
||||
# Include subscription and usage tracking router
|
||||
app.include_router(subscription_router)
|
||||
|
||||
# Include GSC router
|
||||
from routers.gsc_auth import router as gsc_auth_router
|
||||
app.include_router(gsc_auth_router)
|
||||
|
||||
# Include SEO tools router
|
||||
app.include_router(seo_tools_router)
|
||||
# Include Facebook Writer router
|
||||
|
||||
Reference in New Issue
Block a user