How 888leonidas888/googleapis works
Main Components
• VBA Client Application – This is the consumer (typically Excel or another Office product) that uses the DLL.
• GoogleApis DLL – The central library that exposes the functionality to VBA. Inside the DLL, break it down into:
– Drive Module: Contains subdirectories like Common, Component, Helper, and Interfaces. It encapsulates operations such as listing files, uploading/downloading files, creating folders, etc.
– Sheet Module: Similarly divided into Common, Component, Helper, and Interfaces. This module handles operations like creating spreadsheets, reading/writing data, and other sheets-related functions.
– OAuth Module: Implements the FlowOauth class (with its subdirectories and interfaces) that manages the OAuth 2.0 flow required for authentication.
• External Services – Represent Google’s endpoints:
– Google Drive API endpoint
– Google Sheets API endpoint
– OAuth 2.0 Authorization/Token endpoints
Relationships and Interactions
• The VBA Client calls the methods offered by the DLL (e.g., FlowOauth, GoogleDrive, and GoogleSheets classes).
• The OAuth Module communicates directly with Google’s OAuth endpoints to handle token retrieval and refreshing.
• The Drive and Sheets modules use the token (and API key) provided by the OAuth module to send REST API requests to Google Drive and Sheets endpoints.
• There is a configuration layer (credentials stored in JSON files) that the OAuth module reads to determine client credentials, API keys, and token storage location.
Architectural Patterns and Key Design Principles
• Modularity: The separation into “Drive”, “Sheet”, and “Oauth” modules with clearly defined interfaces allows for clean separation of concerns.
• Abstraction: Interfaces and helper classes abstract the complexity of making HTTP requests to external APIs.
• Layered Architecture: There is a client layer (VBA), an application/service layer (DLL with multiple components), and an external integration layer (Google APIs).
• Extensibility: The project structure (especially with interfaces for Drive and Sheets functionality) makes it easier to add or update supported API operations.
Relevant Technologies and Frameworks
• C# and .NET (for building the DLL)
• VBA for consuming the DLL (ensure correct COM registration and setup as per the Installer component)
• JSON for representing configuration and data payloads
• Google API endpoints for Drive and Sheets
• OAuth 2.0 protocol for managing authentication
Final Reminders for the Principal Software Engineer
• It’s best to visually separate the system into logical boundaries even if that means “over-separating” the various internal components; clarity is paramount.