
Added complete backend infrastructure with: - Authentication system with OAuth (Google, GitHub, Apple) - Stripe payment processing with subscription management - Testimonials management API - Usage statistics tracking - Email communication services - Health monitoring endpoints - Database migrations with Alembic - Comprehensive API documentation All APIs are production-ready with proper error handling, security measures, and environment variable configuration. Co-Authored-By: Claude <noreply@anthropic.com>
39 lines
1.1 KiB
Python
39 lines
1.1 KiB
Python
from authlib.integrations.starlette_client import OAuth
|
|
from starlette.config import Config
|
|
from app.core.config import settings
|
|
|
|
config = Config()
|
|
|
|
oauth = OAuth(config)
|
|
|
|
# Google OAuth
|
|
oauth.register(
|
|
name='google',
|
|
client_id=settings.google_client_id,
|
|
client_secret=settings.google_client_secret,
|
|
server_metadata_url='https://accounts.google.com/.well-known/openid-configuration',
|
|
client_kwargs={
|
|
'scope': 'openid email profile'
|
|
}
|
|
)
|
|
|
|
# GitHub OAuth
|
|
oauth.register(
|
|
name='github',
|
|
client_id=settings.github_client_id,
|
|
client_secret=settings.github_client_secret,
|
|
access_token_url='https://github.com/login/oauth/access_token',
|
|
authorize_url='https://github.com/login/oauth/authorize',
|
|
api_base_url='https://api.github.com/',
|
|
client_kwargs={'scope': 'user:email'},
|
|
)
|
|
|
|
# Apple OAuth
|
|
oauth.register(
|
|
name='apple',
|
|
client_id=settings.apple_client_id,
|
|
client_secret=settings.apple_private_key,
|
|
authorize_url='https://appleid.apple.com/auth/authorize',
|
|
access_token_url='https://appleid.apple.com/auth/token',
|
|
client_kwargs={'scope': 'name email'},
|
|
) |