How danielho-bs/anonymousmessage works
Main Components
• Client/User Interface – represented by the two HTML files:
• Index.html: Provides the interface where users can post their messages.
• View.html: Displays the existing messages.
• Server-side Logic – represented by Code.gs:
• This script acts as the backend that processes user requests, interacts with the Google Sheets “database,” and serves the appropriate HTML content.
• Data Storage – Google Sheets:
• The project leverages a Google Spreadsheet (with a defined structure, e.g., ‘Timestamp’, ‘Name’, and ‘Message’) as the data store for submitted messages.
• External Platform – Google Apps Script Environment:
• The deployment and execution environment that ties together the HTML front-end and the Google Sheets back-end (accessed via the GAS platform’s built-in services).
Out the Relationships and Data Flow
• User Interaction:
• A user interacts via a web browser and accesses the web app.
• From the browser, the user sees either the message posting screen (Index.html) or the view page (View.html).
• Communication with Server:
• The HTML pages communicate with Code.gs, which contains the server-side logic.
• Code.gs processes incoming HTTP requests, retrieves or submits data, and then returns responses that update the UI.
• Data Management:
• Code.gs accesses the Google Sheets API (via the built-in Apps Script services) to read/write messages.
• Any changes in the spreadsheet are reflected on the message view page.
Architectural Patterns and Design Principles
• Layer Separation:
• Although the application is small, it clearly separates client-side presentation (HTML files) from server-side business logic (Code.gs).
• Serverless and Managed Infrastructure:
• By using Google Apps Script, the project benefits from a managed serverless environment.
• Simple MVC-Like Flow:
• The HTML pages serve as the Views while Code.gs acts as the Controller managing interactions with the Model (Google Sheet).
Relevant Technologies and Frameworks
• Google Apps Script:
• The environment executing Code.gs and managing deployment as a web application.
• Google Sheets:
• Acts as the backend “database” where messages are stored.
• HTML/CSS (and possibly basic client-side JavaScript embedded in the HTML pages):
• Used for the user interface.