How myselfsislam/qonnect-tool works
Purpose and Entry Points
This repository serves a small server-rendered search/lookup application, with data synchronized from Google Sheets into JSON and optional cache warming. The primary runtime entry point is app.py; the browser UI is rendered from templates/ and enhanced by static assets. Supporting operational paths cover container deployment and SSL certificate renewal.
Application Server and Routes
app.py is the central application boundary: it likely owns HTTP routing, template rendering, data loading, search handling, and authentication/session behavior indicated by the available templates.
Key UI route surfaces are represented by:
• templates/index.html
• templates/search.html
• templates/login.html
• templates/declare.html
The application is server-rendered rather than a standalone client application. Search behavior is split between server responses and browser-side interaction.
Search Presentation Layer
The search experience is implemented through HTML templates plus a focused JavaScript asset:
• templates/search.html
• templates/search_simple.html
• static/js/search.js
templates/search_backup.html suggests an alternate or retained prior search view. Styling is centrally provided by static/css/style.css. The browser boundary should remain limited to presentation and user interaction; authoritative lookup data and access decisions belong in the Python application.
Sheet-to-JSON Data Ingestion
sync_sheets_to_json.py is the repository’s explicit data-ingestion stage. Its role is to pull source data from Google Sheets and materialize it as JSON for application consumption. This establishes Google Sheets as an external source of truth and JSON as the local application-facing data boundary.
Relevant paths:
• sync_sheets_to_json.py
• app.py
• warm_cache_local.py
The expected operational flow is: synchronize sheet data, load or cache the generated data in the app, then serve searches against that local representation rather than requiring a Sheets request for every browser interaction.
Cache Preparation
warm_cache_local.py provides a separate precomputation or local cache-population path. It is architecturally distinct from request handling: it can prepare data before traffic reaches app.py, reducing startup or first-request latency.
Relevant paths:
• warm_cache_local.py
• sync_sheets_to_json.py
• app.py
Any deployment scheduler or manual operational process should run synchronization/cache warming with clear ordering, since the cache is downstream of source data acquisition.
Container and GCP Deployment Boundary
The root container definition packages the primary application runtime:
• Dockerfile
• app.py
• requirements.txt
GCP_ARCHITECTURE.md documents the intended Google Cloud deployment architecture. Google Cloud is therefore a material infrastructure dependency, while Google Sheets is the material external data service. .gcloudignore controls what is included in Google Cloud deployment contexts.
SSL Renewal Sidecar/Operational Unit
Certificate renewal is isolated into its own deployable operational unit rather than embedded in the application container:
• ssl-renewal/Dockerfile
• ssl-renewal/renew.sh
• SSL_CERTIFICATE_RENEWAL_REMINDER.md
The separate ssl-renewal/ subtree indicates independent lifecycle, scheduling, and permissions for certificate management. This separation protects the application runtime from certificate-renewal tooling and allows SSL operations to be deployed or executed independently.
Main entry points: app.py Application server · search.html Search views · sync_sheets_to_json.py Sheet synchronizer · index.html App views
Components 14
Browser UI
- Browser
- Search views · Search results and alternate search presentations.
templates/search.html - App views · Index, login, and declaration pages.
templates/index.html - Search interaction
static/js/search.js - Shared styling
static/css/style.css
Application Runtime
- Application server · Owns routes, rendering, search, and access decisions.
app.py
Data Operations
- Google Sheets · Source of truth for lookup data.
- Sheet synchronizer · Materializes sheet data for local application use.
sync_sheets_to_json.py - Local JSON data · Application-facing representation of synchronized sheet data.
- Cache warmer · Prepares local data/cache before traffic.
warm_cache_local.py
Deployment & SSL
- Application container · Packages the Python application runtime.
Dockerfile - Google Cloud
- SSL renewal unit · Independently renews certificates.
ssl-renewal/Dockerfile - Certificate renewal
ssl-renewal/renew.sh
Connections 14
- Browser → Application server: HTTP requests
- Application server → Search views: renders
- Application server → App views: renders
- Search views → Search interaction: loads
- Search views → Shared styling: uses
- App views → Shared styling: uses
- Sheet synchronizer → Google Sheets: reads
- Sheet synchronizer → Local JSON data: writes
- Cache warmer → Local JSON data: prepares from
- Application server → Local JSON data: loads lookup data
- Application container → Application server: packages
- Google Cloud → Application container: runs
- SSL renewal unit → Certificate renewal: executes
- Google Cloud → SSL renewal unit: operates independently