Google Services Dashboard with login
import logging
from gunicorn.app.base import BaseApplication
from app_init import app
# IMPORT ALL ROUTES
from routes import *
# Setup logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
class StandaloneApplication(BaseApplication):
def __init__(self, app, options=None):
self.application = app
self.options = options or {}
super().__init__()
def load_config(self):
# Apply configuration to Gunicorn
for key, value in self.options.items():
if key in self.cfg.settings and value is not None:
self.cfg.set(key.lower(), value)
Created: | Last Updated:
Here's a how-to article for the Google Services Dashboard template:
Introduction
The Google Services Dashboard template provides a secure way to build applications that connect to Google Cloud Services. It includes built-in authentication and allows users to connect their Google accounts to access services like Gmail, Google Drive, and Calendar through a unified dashboard interface.
Getting Started
- Click "Start with this Template" to begin using this template in the Lazy Builder
Initial Setup
You'll need to set up Google Cloud credentials to enable OAuth authentication:
- Go to the Google Cloud Console (https://console.cloud.google.com)
- Create a new project or select an existing one
- Enable the Gmail API for your project
- Go to "APIs & Services" > "Credentials"
- Click "Create Credentials" > "OAuth Client ID"
- Choose "Web Application" as the application type
- Add your authorized redirect URI (you'll get this from the Lazy CLI after pressing Test)
- Copy your Client ID and Client Secret
Add these credentials as environment secrets in the Lazy Builder Environment Secrets tab:
* GOOGLE_CLIENT_ID
: Your Google OAuth client ID
* GOOGLE_CLIENT_SECRET
: Your Google OAuth client secret
Test
Click the Test button to launch your application. The Lazy CLI will provide you with: * Your application's URL * The redirect URI to add to your Google Cloud Console OAuth configuration
Using the Dashboard
Once deployed, the dashboard provides:
- Single sign-on with Google authentication
- A clean interface to manage Google service connections
- Profile management with user avatar display
- Secure token handling for Google API access
Users can: * Connect their Google account through a simple OAuth flow * View their connected services * Safely disconnect services when needed * Access their profile information
Integrating Additional Google Services
The template is pre-configured for Gmail API access, but you can add other Google services by:
- Enabling additional APIs in Google Cloud Console
- Adding the required scopes to the
GMAIL_OAUTH_SCOPES
list in routes.py - Building additional routes and UI components for the new services
For example, to add Google Drive access, add this scope:
python
GMAIL_OAUTH_SCOPES = [
'https://www.googleapis.com/auth/gmail.readonly',
'https://www.googleapis.com/auth/drive.readonly'
]
The template handles all the authentication flow and token management automatically, making it easy to expand to additional Google services as needed.
Template Benefits
-
Rapid Google Cloud Integration - Provides immediate infrastructure for connecting to Google Cloud services, reducing development time from weeks to hours for applications requiring Gmail, Drive, or Calendar access.
-
Enterprise-Ready Authentication - Built-in secure authentication system with Google OAuth, making it ideal for business applications that need to manage multiple users while maintaining data privacy and security compliance.
-
Scalable User Management - Includes a complete user management system with database integration, allowing businesses to easily manage multiple users and their Google service connections in a centralized dashboard.
-
Token Management Automation - Features automatic token refresh and management, eliminating the need to handle complex OAuth token logistics and ensuring uninterrupted access to Google services.
-
Multi-Service Foundation - Serves as a foundation for applications that need to interact with multiple Google services simultaneously, perfect for creating unified business tools that combine Gmail, Drive, and Calendar functionalities.
Technologies




