How arunachalamj2025csecs-cyber/ars-2008 works
Purpose and deployment
REC CampusConnect is a Google Apps Script web portal for students and administrators. It manages user profiles, complaints, complaint status/history, and campus events using Google Sheets as persistence. The deployable app consists primarily of the Apps Script backend in Code.gs, SPA frontend in index.html, and Apps Script web-app manifest in appsscript.json.
Entry points and runtime boundary
Apps Script serves the portal and exposes backend functions from Code.gs; index.html invokes them through google.script.run when Apps Script-hosted, or through the configured deployed web-app URL when externally hosted. appsscript.json defines the Apps Script runtime/deployment configuration. setupPortal() is the provisioning entry point that creates/upgrades required spreadsheet structure.
Backend API, sessions, and authorization
Code.gs is the system’s central application layer: it handles registration/login, session lifecycle, role-dependent student/admin operations, profile updates, Google-token verification, and validation. Authorization is enforced server-side around protected user, complaint, and event operations; the UI in index.html is a consumer, not the security boundary.
Spreadsheet-backed domain persistence
The backend persists the core model in a connected Google Sheet with Users, Complaints, and Events tabs. User settings and complaint timelines are JSON-bearing columns rather than separate tables. This allows complaint view records, status changes, administrator contact metadata, Google identity metadata, and activity history to remain attached to their parent records. Schema setup and backward-compatible profile-photo column additions are handled in Code.gs.
Complaint workflow and administrator visibility
Students use the dashboard, complaint list, sidebar, and profile history in index.html to create and inspect complaints. Administrators review, view, and update complaints through backend calls in Code.gs. Opening a complaint records an administrator view in its history; status updates identify the responsible administrator. Student complaint detail prefers the administrator who changed status, then exposes available email and phone contact actions.
Events and dashboard projections
Events are stored and managed through Code.gs, with administrators able to see drafts and published items. Student-facing dashboard/event views in index.html receive published events only. Backend ordering places recent past events before chronologically ordered upcoming events; dashboard upcoming counts account for events scheduled on the current local date.
Identity and external services
Password-based login supports existing users and administrators. Optional student Google sign-in uses Google Identity Services in index.html; Code.gs verifies credentials against Google’s tokeninfo endpoint, validates client audience and verified email, and stores identity metadata such as Google subject in user settings. OAuth client configuration is split between the frontend and the GOOGLE_CLIENT_ID Apps Script project property.
Profile-photo upload crosses into Google Drive: Code.gs stores images in the REC CampusConnect Profile Photos folder and saves the resulting URL in the user record. This requires Apps Script permissions for Sheets, Drive, external HTTP verification, and web-app execution.
Frontend portal
index.html is a single-page role-aware interface containing loading, login, student dashboard, complaints, event views, profiles, and administrator workflows. It owns interaction state and presentation, including read-only/editable profile transitions, while delegating persistence and privileged actions to Code.gs. REC-CampusConnect-Responsive.zip appears to be a bundled project artifact rather than a runtime component.
Main entry points: Code.gs Application backend · index.html SPA frontend · appsscript.json Web-app manifest
Components 15
Apps Script portal
- SPA frontend · Role-aware student and administrator portal.
index.html - Application backend · Central API, authorization, validation, and domain logic.
Code.gs - Schema provisioning · Creates and upgrades spreadsheet structure.
Code.gs - Web-app manifest · Defines runtime and deployment configuration.
appsscript.json - Sessions & authorization · Enforces protected operations server-side.
Code.gs - Complaint workflow · Creates, views, assigns status, and records administrator history.
Code.gs - Event management · Filters published student events and orders dashboard projections.
Code.gs - Profiles & photo upload · Updates profiles and stores profile images.
Code.gs - Apps Script project properties · Stores GOOGLE_CLIENT_ID for token validation.
Persistence
- Connected Google Sheet · Core persistence for users, complaints, and events.
- Users tab · Contains profiles, settings JSON, and identity metadata.
- Complaints tab · Contains complaints and JSON-backed timelines.
- Events tab · Contains draft and published events.
Google services
- Google Identity & tokeninfo · Frontend obtains credentials; backend validates audience and verified email.
- Google Drive photos folder · REC CampusConnect Profile Photos folder.
Connections 18
- Web-app manifest → Application backend: configures deployment
- SPA frontend → Application backend: invokes API · Uses google.script.run or deployed web-app URL.
- Schema provisioning → Connected Google Sheet: creates/upgrades schema
- Application backend → Sessions & authorization: applies
- Application backend → Complaint workflow: implements
- Application backend → Event management: implements
- Application backend → Profiles & photo upload: implements
- Sessions & authorization → Users tab: reads users and sessions
- Complaint workflow → Complaints tab: persists complaints/history
- Event management → Events tab: persists events
- Profiles & photo upload → Users tab: updates profiles/settings
- Users tab → Connected Google Sheet: tab in
- Complaints tab → Connected Google Sheet: tab in
- Events tab → Connected Google Sheet: tab in
- SPA frontend → Google Identity & tokeninfo: optional Google sign-in
- Application backend → Google Identity & tokeninfo: verifies token
- Application backend → Apps Script project properties: reads client ID
- Profiles & photo upload → Google Drive photos folder: stores profile photos