# sradha-tcs/tcs-corp architecture

> Architecture diagram of the GitHub repository sradha-tcs/tcs-corp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sradha-tcs/tcs-corp
- Repository: https://github.com/sradha-tcs/tcs-corp

## Overview

This repository is the browser-side frontend for a TCS corporate site rendered from AEM-authored pages. The principal workflow is page initialization, followed by section and block loading, then interactive content rendering for visitors; shared decorators and utilities support that rendering. The tree also includes templates, navigation, forms, media, search/filtering, and editorial experiences. Evidence is limited to the supplied excerpts and source index, so unsampled block relationships are omitted rather than inferred.

Main entry points: [`scripts/scripts.js`](https://github.com/sradha-tcs/tcs-corp/blob/main/scripts/scripts.js) (Page Runtime), [`blocks`](https://github.com/sradha-tcs/tcs-corp/tree/main/blocks) (Content Blocks), [`utils/query-index.js`](https://github.com/sradha-tcs/tcs-corp/blob/main/utils/query-index.js) (Page Query Index), [`utils/placeholders.js`](https://github.com/sradha-tcs/tcs-corp/blob/main/utils/placeholders.js) (Localized UI Text)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Page Runtime"]
  node_page_runtime["Page Runtime<br/>[scripts.js]"]
  node_aem_loader["AEM Loader<br/>[aem.js]"]
  node_templates["Page Templates"]
end

subgraph group_content["Site Experiences"]
  node_navigation["Site Navigation<br/>[header.js]"]
  node_footer["Site Footer<br/>[footer.js]"]
  node_content_blocks["Content Blocks"]
  node_filter_search["Filtering and Search<br/>[filter-list.js]"]
  node_forms["Forms<br/>[form-variations.js]"]
  node_conversation["Conversation Canvas"]
  node_media_experiences["Media Experiences<br/>[gen-carousel.js]"]
  node_fragment["Page Fragments<br/>[fragment.js]"]
end

subgraph group_rendering["Shared Rendering"]
  node_decorators["Content Decorators"]
  node_responsive_images["Responsive Images"]
  node_buttons["Button Rendering"]
  node_editor_items["Editor Items"]
  node_cells["Authored Cells<br/>[cells.js]"]
  node_properties["Block Properties<br/>[properties.js]"]
  node_ids["Page IDs<br/>[ids.js]"]
end

subgraph group_data["Site Data"]
  node_site_config["Site Configuration<br/>[site.js]"]
  node_query_index["Page Query Index<br/>[query-index.js]"]
  node_placeholders["Localized UI Text<br/>[placeholders.js]"]
end

node_visitor(("Site Visitor"))
node_site_sheets[("Published Site Sheets")]
node_query_service[("Query Index Service")]

node_visitor -->|"opens page"| node_page_runtime
node_page_runtime -->|"loads sections"| node_aem_loader
node_aem_loader -->|"loads blocks"| node_content_blocks
node_page_runtime -->|"loads template"| node_templates
node_page_runtime -->|"loads header"| node_navigation
node_page_runtime -->|"loads footer"| node_footer
node_page_runtime -->|"builds images"| node_responsive_images
node_footer -->|"loads fragment"| node_fragment
node_filter_search -->|"reads cells"| node_cells
node_filter_search -->|"uses index"| node_query_index
node_forms -->|"reads properties"| node_properties
node_conversation -->|"checks environment"| node_site_config
node_media_experiences -->|"uses media"| node_responsive_images
node_content_blocks -.->|"uses decorators"| node_decorators
node_content_blocks -.->|"uses buttons"| node_buttons
node_content_blocks -.->|"supports editing"| node_editor_items
node_content_blocks -.->|"reads authored rows"| node_cells
node_content_blocks -.->|"creates unique ids"| node_ids
node_query_index -->|"gets index root"| node_site_config
node_query_index -->|"applies overrides"| node_site_sheets
node_query_index -.->|"fetches index"| node_query_service
node_placeholders -->|"gets locale path"| node_site_config
node_placeholders -->|"loads translations"| node_site_sheets
node_editor_items -->|"gets editor text"| node_placeholders
node_buttons -->|"uses link decorator"| node_decorators
node_ids -->|"normalizes ids"| node_aem_loader

click node_page_runtime "https://github.com/sradha-tcs/tcs-corp/blob/main/scripts/scripts.js"
click node_aem_loader "https://github.com/sradha-tcs/tcs-corp/blob/main/scripts/aem.js"
click node_templates "https://github.com/sradha-tcs/tcs-corp/tree/main/templates"
click node_navigation "https://github.com/sradha-tcs/tcs-corp/blob/main/blocks/header/header.js"
click node_footer "https://github.com/sradha-tcs/tcs-corp/blob/main/blocks/footer/footer.js"
click node_content_blocks "https://github.com/sradha-tcs/tcs-corp/tree/main/blocks"
click node_filter_search "https://github.com/sradha-tcs/tcs-corp/blob/main/blocks/filter-list/filter-list.js"
click node_forms "https://github.com/sradha-tcs/tcs-corp/blob/main/blocks/form-variations/form-variations.js"
click node_conversation "https://github.com/sradha-tcs/tcs-corp/blob/main/blocks/conversation-canvas/canvas-controller.js"
click node_media_experiences "https://github.com/sradha-tcs/tcs-corp/blob/main/blocks/gen-carousel/gen-carousel.js"
click node_fragment "https://github.com/sradha-tcs/tcs-corp/blob/main/blocks/fragment/fragment.js"
click node_decorators "https://github.com/sradha-tcs/tcs-corp/tree/main/decorators"
click node_responsive_images "https://github.com/sradha-tcs/tcs-corp/blob/main/decorators/responsive-image-decorator.js"
click node_buttons "https://github.com/sradha-tcs/tcs-corp/blob/main/decorators/button-decorator.js"
click node_editor_items "https://github.com/sradha-tcs/tcs-corp/blob/main/decorators/editor-item-decorator.js"
click node_cells "https://github.com/sradha-tcs/tcs-corp/blob/main/utils/cells.js"
click node_properties "https://github.com/sradha-tcs/tcs-corp/blob/main/utils/properties.js"
click node_ids "https://github.com/sradha-tcs/tcs-corp/blob/main/utils/ids.js"
click node_site_config "https://github.com/sradha-tcs/tcs-corp/blob/main/utils/site.js"
click node_query_index "https://github.com/sradha-tcs/tcs-corp/blob/main/utils/query-index.js"
click node_placeholders "https://github.com/sradha-tcs/tcs-corp/blob/main/utils/placeholders.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_page_runtime,node_aem_loader,node_templates toneBlue
class node_navigation,node_footer,node_content_blocks,node_filter_search,node_forms,node_conversation,node_media_experiences,node_fragment,node_site_sheets,node_query_service toneAmber
class node_decorators,node_responsive_images,node_buttons,node_editor_items,node_cells,node_properties,node_ids toneMint
class node_site_config,node_query_index,node_placeholders toneRose
class node_visitor toneIndigo
```

## Components

### Page Runtime

- [Page Runtime](https://github.com/sradha-tcs/tcs-corp/blob/main/scripts/scripts.js): `scripts/scripts.js`
- [AEM Loader](https://github.com/sradha-tcs/tcs-corp/blob/main/scripts/aem.js): `scripts/aem.js`
- [Page Templates](https://github.com/sradha-tcs/tcs-corp/tree/main/templates): `templates`

### Site Experiences

- [Site Navigation](https://github.com/sradha-tcs/tcs-corp/blob/main/blocks/header/header.js): `blocks/header/header.js`
- [Site Footer](https://github.com/sradha-tcs/tcs-corp/blob/main/blocks/footer/footer.js): `blocks/footer/footer.js`
- [Content Blocks](https://github.com/sradha-tcs/tcs-corp/tree/main/blocks): `blocks`
- [Filtering and Search](https://github.com/sradha-tcs/tcs-corp/blob/main/blocks/filter-list/filter-list.js): `blocks/filter-list/filter-list.js`
- [Forms](https://github.com/sradha-tcs/tcs-corp/blob/main/blocks/form-variations/form-variations.js): `blocks/form-variations/form-variations.js`
- [Conversation Canvas](https://github.com/sradha-tcs/tcs-corp/blob/main/blocks/conversation-canvas/canvas-controller.js): `blocks/conversation-canvas/canvas-controller.js`
- [Media Experiences](https://github.com/sradha-tcs/tcs-corp/blob/main/blocks/gen-carousel/gen-carousel.js): `blocks/gen-carousel/gen-carousel.js`
- [Page Fragments](https://github.com/sradha-tcs/tcs-corp/blob/main/blocks/fragment/fragment.js): `blocks/fragment/fragment.js`

### Shared Rendering

- [Content Decorators](https://github.com/sradha-tcs/tcs-corp/tree/main/decorators): `decorators`
- [Responsive Images](https://github.com/sradha-tcs/tcs-corp/blob/main/decorators/responsive-image-decorator.js): `decorators/responsive-image-decorator.js`
- [Button Rendering](https://github.com/sradha-tcs/tcs-corp/blob/main/decorators/button-decorator.js): `decorators/button-decorator.js`
- [Editor Items](https://github.com/sradha-tcs/tcs-corp/blob/main/decorators/editor-item-decorator.js): `decorators/editor-item-decorator.js`
- [Authored Cells](https://github.com/sradha-tcs/tcs-corp/blob/main/utils/cells.js): `utils/cells.js`
- [Block Properties](https://github.com/sradha-tcs/tcs-corp/blob/main/utils/properties.js): `utils/properties.js`
- [Page IDs](https://github.com/sradha-tcs/tcs-corp/blob/main/utils/ids.js): `utils/ids.js`

### Site Data

- [Site Configuration](https://github.com/sradha-tcs/tcs-corp/blob/main/utils/site.js): `utils/site.js`
- [Page Query Index](https://github.com/sradha-tcs/tcs-corp/blob/main/utils/query-index.js): `utils/query-index.js`
- [Localized UI Text](https://github.com/sradha-tcs/tcs-corp/blob/main/utils/placeholders.js): `utils/placeholders.js`

### Other components

- **Site Visitor**
- **Published Site Sheets**
- **Query Index Service**

## Connections

- Site Visitor → Page Runtime: opens page (evidence: `scripts/scripts.js`)
- Page Runtime → AEM Loader: loads sections (evidence: `scripts/scripts.js`)
- AEM Loader → Content Blocks: loads blocks (evidence: `scripts/aem.js`)
- Page Runtime → Page Templates: loads template (evidence: `scripts/scripts.js`)
- Page Runtime → Site Navigation: loads header (evidence: `scripts/scripts.js`)
- Page Runtime → Site Footer: loads footer (evidence: `scripts/scripts.js`)
- Page Runtime → Responsive Images: builds images (evidence: `scripts/scripts.js`)
- Site Footer → Page Fragments: loads fragment (evidence: `blocks/footer/footer.js`)
- Filtering and Search → Authored Cells: reads cells (evidence: `blocks/filter-list/filter-list.js`)
- Filtering and Search → Page Query Index: uses index (evidence: `blocks/filter-list/filter-list.js`)
- Forms → Block Properties: reads properties (evidence: `blocks/form-variations/form-variations.js`)
- Conversation Canvas → Site Configuration: checks environment (evidence: `blocks/conversation-canvas/canvas-controller.js`)
- Media Experiences → Responsive Images: uses media (evidence: `blocks/gen-carousel/gen-carousel.js`)
- Content Blocks → Content Decorators: uses decorators (evidence: `blocks/fragment/fragment.js`)
- Content Blocks → Button Rendering: uses buttons (evidence: `blocks/filter-list/filter-list.js`)
- Content Blocks → Editor Items: supports editing (evidence: `blocks/filter-list/filter-list.js`)
- Content Blocks → Authored Cells: reads authored rows (evidence: `blocks/filter-list/filter-list.js`)
- Content Blocks → Page IDs: creates unique ids (evidence: `blocks/filter-list/filter-list.js`)
- Page Query Index → Site Configuration: gets index root (evidence: `utils/query-index.js`)
- Page Query Index → Published Site Sheets: applies overrides (evidence: `utils/query-index.js`)
- Page Query Index → Query Index Service: fetches index
- Localized UI Text → Site Configuration: gets locale path (evidence: `utils/placeholders.js`)
- Localized UI Text → Published Site Sheets: loads translations (evidence: `utils/placeholders.js`)
- Editor Items → Localized UI Text: gets editor text (evidence: `decorators/editor-item-decorator.js`)
- Button Rendering → Content Decorators: uses link decorator (evidence: `decorators/button-decorator.js`)
- Page IDs → AEM Loader: normalizes ids (evidence: `utils/ids.js`)
