How eateamagon/kcinventory works
Project type + purpose (from file tree + README)
This is a Google Apps Script (GAS) project for an inventory tracker (“Kate Collins Middle School Inventory Tracker”). The structure is the classic GAS web app pattern:
• Code.gs: server-side Apps Script (runs on Google’s servers)
• Index.html: client-side UI (HTML/JS served by Apps Script’s HTML service)
• No separate backend framework/server, no package manager—deployment is typically “Deploy as Web App” inside Apps Script.
• Since GAS apps commonly store data in Google Sheets, treat Sheets/Drive as the likely “database layer” even if the README doesn’t explicitly say so.
Client/UI layer
• Browser
• Index.html (UI)
• HTML/CSS layout
• Client-side JavaScript
• Calls into server via google.script.run (typical GAS pattern) or via web endpoints (doGet, doPost) depending on implementation.
Server/runtime layer (Google-managed)
• Google Apps Script runtime
• Code.gs (Server logic)
• Web entrypoints: doGet(e) / doPost(e) (common)
• Business operations: “add item”, “check out”, “return”, “search”, “list inventory”, etc. (infer from inventory tracker purpose)
• Data access functions: reads/writes to Sheets, possibly Drive, maybe PropertiesService.
Data layer (Google services)
• Google Sheets (most likely persistent store)
• Inventory table(s)
• Transaction history (check-out / return logs)
• Optionally also show:
• Google Drive (hosting/permissions for the spreadsheet)
• Apps Script PropertiesService (config, spreadsheet IDs, etc.)
• Google Authentication / Authorization (who can access, “execute as”, domain restrictions)
Deployment / hosting boundary
• Apps Script Web App deployment (the hosted URL, versioning, access settings)
User → Browser → Index.html
• User loads the web app URL
• Apps Script serves Index.html (via HTML Service)
Index.html → Code.gs
• Client triggers actions (buttons/forms)
• Calls server functions:
• google.script.run.<functionName>(...) (RPC-style)
• or HTTP calls to doPost/doGet if implemented that way
Code.gs → Google Sheets (and/or Drive)
• Server reads/writes inventory data
• Updates rows, appends logs, queries items
Code.gs → Index.html
• Returns data (lists, item details, success/error states)
• UI rerenders
(If applicable) AuthN/AuthZ boundary
• Web app access rules (only domain users, only specific accounts, etc.)
• “Execute as” setting impacts spreadsheet permissions and auditing
Architectural patterns to highlight (specific to GAS inventory apps)
• Serverless backend: no custom server; Apps Script is the backend.
• Thin client / RPC: UI is mostly a view/controller calling server functions.
• Spreadsheet-as-database: persistence and “queries” are implemented via Sheets operations.
• Permission-driven design: spreadsheet access depends on deployment settings + the executing identity.
• Single-repo, two-tier: “frontend file” + “backend file” but both deployed as one web app.
Don’t overthink it: “separate into as many components as possible” (but still accurate)
• UI rendering
• UI event handling
• Server endpoints
• Business logic
• Data access
• Persistence store
• Identity/permission model
• Deployment boundary
To make it “best and most accurate,” open Code.gs and confirm:
• Does it use doGet / doPost?
• Does it call SpreadsheetApp.openById(...) or openByUrl(...) (confirms Sheets as DB)?
• Any use of DriveApp, PropertiesService, Session, OAuth scopes?
• Any roles (admin vs staff), or domain restriction assumptions?
Google Sheets (Inventory Spreadsheet)
• Staff → Browser (use)
• Browser → Apps Script (load UI)
• Browser ⇄ Apps Script (actions / responses)
• Apps Script ⇄ Sheets (CRUD)
That’s the cleanest representation of this specific repo’s architecture.