Understanding Sitecore JSS Architecture with Angular: A Complete Guide
2026-09-08
Modern web applications are moving toward headless architectures where content management and frontend presentation are separated.
Sitecore JSS allows developers to build frontend applications using modern JavaScript frameworks while Sitecore continues to manage content, layouts, renderings, personalization, and publishing.
For Angular developers, however, one of the biggest challenges is understanding what actually happens between a user requesting a page and Angular rendering Sitecore components.
Questions such as these are very common:
- How does Angular know which Sitecore component to render?
- Where does the page layout come from?
- What exactly does the Sitecore Layout Service return?
- How do placeholders work?
- How does routing connect to Sitecore content?
- Where does GraphQL fit into the architecture?
In this article, we will walk through the complete Sitecore JSS + Angular architecture and follow the flow from a browser request to the final rendered page.
1. The Big Picture
At a high level, a Sitecore JSS Angular application looks like this:
- Angular Application
- REST / GraphQL
- Routes
- Layouts
- Placeholders
- Renderings
- Datasource Content
The important concept is this:
The Sitecore Layout Service exposes layout information as structured JSON, allowing a decoupled frontend to consume the page structure and component data. JSS can retrieve this data through REST or GraphQL-based approaches.
2. Traditional Sitecore vs Headless Sitecore
Before understanding JSS, it helps to compare traditional Sitecore rendering with a headless approach.
Traditional Architecture
- Content
- Rendering
- Razor Views
- HTML
In a traditional architecture, Sitecore manages both:
- Content
- HTML rendering
The browser receives the final HTML.
Headless Architecture with Angular
- Content
- Route
- Layout
- Component Data
Here, the responsibilities are separated.
| Sitecore | Angular |
|---|---|
| Content management | UI rendering |
| Page structure | Components |
| Renderings | Styling |
| Placeholders | User interaction |
| Datasources | Application behavior |
| Publishing | Frontend presentation |
This separation is one of the core ideas behind Sitecore JSS.
3. The Main Building Blocks
To understand the architecture, let's look at the major pieces involved.
Let's explore each layer.
3.1 Sitecore Content Item
A Sitecore item contains content.
For example:
- Home
- Hero Title“Welcome to Our Website”
- Hero Description“We build modern digital experiences.”
- CTA Text“Learn More”
Angular should not need to know where this content is stored in the Sitecore tree.
Instead, Angular receives structured data.
For example:
{
"fields": {
"Title": {
"value": "Welcome to Our Website"
},
"Description": {
"value": "We build modern digital experiences."
},
"CTA": {
"value": "Learn More"
}
}
}This keeps the frontend focused on rendering instead of directly accessing the Sitecore content database.
4. What Is the Sitecore Layout Service?
The Layout Service is one of the most important concepts in Sitecore headless development.
It provides information about:
- The current route
- The layout
- Placeholders
- Components assigned to those placeholders
- Datasource content
- Context information
For example, imagine a page with this structure:
- Home Page
- main
- Hero
- Content Block
- Promo Banner
The Layout Service can return this information in a structured response.
A simplified response might look like this:
{
"sitecore": {
"route": {
"name": "home",
"placeholders": {
"main": [
{
"componentName": "Hero",
"fields": {
"Title": {
"value": "Welcome"
}
}
},
{
"componentName": "ContentBlock",
"fields": {
"Content": {
"value": "This is the content."
}
}
}
]
}
}
}
}The Layout Service is designed to expose Sitecore layout information as JSON and can be consumed by decoupled frontend applications.
5. The Complete Request Flow
Now let's follow the complete flow.
Suppose a user opens:
https://example.com/productsThe architecture flow can be represented as follows:
- Layout
- Placeholders
- Renderings
- Datasources
Let's break this down further.
Step 1: Angular Receives the Route
A user opens:
/productsAngular needs to determine what to display.
A normal Angular application might define routes like this:
const routes: Routes = [
{
path: 'products',
component: ProductsComponent
}
];However, a Sitecore application can have a large number of routes managed directly from Sitecore.
For example:
- Sitecore Routes
- /
- /about
- /products
- /products/product-a
- /products/product-b
- /services
- /contact
Hardcoding every Sitecore route inside Angular would not be practical.
This is where JSS dynamic routing becomes important.
The Angular JSS sample uses routing based on route data from the Layout Service, allowing Sitecore-managed routes to drive page rendering.
Conceptually:
Step 2: Sitecore Resolves the Page
Once Sitecore receives the route information, it identifies the requested item.
For example:
/productsCould map to:
/sitecore/content/MyWebsite/Home/ProductsSitecore then determines:
- Products Page
- Layout
- main Placeholder
- ProductHero
- ProductList
- CTA
- footer Placeholder
- Footer
The result is sent to the Angular application as layout data.
Step 3: Angular Receives the Layout Data
Now Angular receives information similar to:
{
"route": {
"name": "products",
"placeholders": {
"main": [
{
"componentName": "ProductHero"
},
{
"componentName": "ProductList"
},
{
"componentName": "CTA"
}
]
}
}
}At this point, Angular knows something important:
main placeholder.But Angular still needs to answer:
ProductHero?That is where component mapping comes in.
Step 4: Component Mapping
Imagine Sitecore returns:
{
"componentName": "Hero"
}Angular needs to map that Sitecore rendering to an Angular component.
Conceptually:
For example:
const components = {
Hero: HeroComponent,
ContentBlock: ContentBlockComponent,
PromoBanner: PromoBannerComponent
};Or, depending on the JSS Angular implementation, components can be registered with JSS infrastructure.
For example:
import { JssModule } from '@sitecore-jss/sitecore-jss-angular';
JssModule.withComponents([
{
name: 'Hero',
type: HeroComponent
},
{
name: 'ContentBlock',
type: ContentBlockComponent
}
]);The JSS infrastructure uses component registration or a component factory pattern to associate Sitecore rendering names with frontend implementations.
This mapping is extremely important.
If Sitecore contains:
HeroBut Angular does not have a corresponding mapping, the application cannot render that component correctly.
Step 5: Placeholders Render Components
Placeholders are the bridge between the Sitecore page structure and Angular components.
Imagine this Sitecore structure:
- Home Page
- main Placeholder
- Hero
- Content Block
- Promo Banner
In Angular, a JSS placeholder can look like this:
<sc-placeholder
name="main"
[rendering]="route">
</sc-placeholder>The placeholder receives route data.
Then the JSS infrastructure dynamically determines which components should be rendered.
Conceptually:
The sc-placeholder component in JSS for Angular dynamically renders components based on rendering data returned from Sitecore.
6. Creating a Simple JSS Angular Component
Let's create a simple Hero component.
hero.component.ts
import { Component, Input } from '@angular/core';
import { ComponentRendering } from '@sitecore-jss/sitecore-jss-angular';
@Component({
selector: 'app-hero',
templateUrl: './hero.component.html'
})
export class HeroComponent {
@Input() rendering!: ComponentRendering;
}The component receives rendering data.
hero.component.html
<section class="hero">
<h1>
{{ rendering.fields?.Title?.value }}
</h1>
<p>
{{ rendering.fields?.Description?.value }}
</p>
</section>The data flow is:
This is one of the main architectural differences between a regular Angular application and a Sitecore JSS application.
In a regular application, developers often directly control component instantiation.
With JSS, components are typically driven by the Sitecore layout data and dynamically associated with the corresponding frontend implementation.
7. Understanding the Data Flow
Let's visualize the full content flow.
- Content
- Templates
- Datasources
- Renderings
- Placeholders
- Route
- Placeholders
- Component Names
- Fields
- Routing
- JSS Context
- Component Mapping
- Placeholder Rendering
- Hero
- Content Block
- Product List
- Footer
8. Where Does GraphQL Fit In?
Sitecore JSS applications can retrieve layout and content data using REST or GraphQL.
For GraphQL-based applications, the JSS data layer can use the GraphQL Layout Service to retrieve layout information. Sitecore also supports GraphQL querying for layout and dictionary-related data in JSS applications.
The architecture becomes:
A simplified GraphQL query might look like:
query GetPage {
item(path: "/sitecore/content/MyWebsite/Home") {
name
fields {
name
value
}
}
}For JSS applications, GraphQL can also be used for layout data rather than manually creating a query for every page.
For example:
import { GraphQLLayoutService } from '@sitecore-jss/sitecore-jss';
export const layoutService = new GraphQLLayoutService({
clientFactory,
siteName: config.sitecoreSiteName
});The application can then fetch layout data through the configured service.
const data = await layoutService.fetchLayoutData('en');The exact configuration depends on the Sitecore and JSS version being used, so it is important to follow the SDK documentation for your project version.
9. REST vs GraphQL
Both approaches can be useful.
| REST Layout Service | GraphQL |
|---|---|
| Traditional API approach | Flexible query approach |
| JSON response | Query-based response |
| Simple setup | More control over requested data |
| Layout Service endpoint | Layout, dictionary and other supported GraphQL scenarios |
| Good for straightforward implementations | Useful for modern headless architectures |
The JSS Layout API abstracts data fetching and supports REST and GraphQL endpoint options, including Experience Edge-related GraphQL delivery scenarios.
My recommendation is:
- Understand the REST Layout Service first.
- Learn how layout data is structured.
- Then move to GraphQL.
- Use GraphQL when its flexibility and delivery architecture provide a clear benefit.
Understanding the architecture is more important than choosing a technology simply because it is newer.
10. A Practical Example
Let's imagine we have this page:
- Home
- main
- Hero
- FeatureList
- PromoBanner
Step 1: Sitecore defines the page
- Home
- main Placeholder
- Hero
- FeatureList
- PromoBanner
Step 2: Layout Service returns data
{
"placeholders": {
"main": [
{
"componentName": "Hero",
"fields": {
"Title": {
"value": "Welcome"
}
}
},
{
"componentName": "FeatureList"
},
{
"componentName": "PromoBanner"
}
]
}
}Step 3: Angular receives the route
export class LayoutComponent {
route: any;
}Step 4: Angular renders the placeholder
<sc-placeholder
name="main"
[rendering]="route">
</sc-placeholder>Step 5: JSS maps components
Step 6: Angular renders the final page
Hero
Welcome to Site
Feature List
- ✓ Fast
- ✓ Scalable
- ✓ Flexible
Promo Banner
Learn More →11. Suggested Angular Project Structure
For a maintainable Sitecore JSS Angular application, I recommend organizing the application clearly.
- src
- app
- components
- hero
- hero.component.ts
- hero.component.html
- hero.component.scss
- content-block
- promo-banner
- services
- sitecore-data.service.ts
- graphql.service.ts
- routing
- routing.module.ts
- shared
- app.module.ts
- environments
- assets
The exact generated structure can vary by JSS version, but the key principle remains the same:
12. Recommended Architecture Pattern
For larger projects, I recommend the following approach:
A component should primarily focus on:
- Receiving data
- Displaying data
- Handling UI interaction
For example:
@Component({
selector: 'app-product-card'
})
export class ProductCardComponent {
@Input() rendering: any;
}Avoid placing large amounts of Sitecore-specific API logic directly inside every component.
Instead:
This makes the application easier to test and maintain.
13. Common Mistakes
Mistake 1: Treating JSS Like a Normal Angular App
A normal Angular application might manually define all page components.
A JSS application is different because the page composition can come from Sitecore.
Instead of:
- Angular
- decides every page component
Think:
- Sitecore
- decides page composition
- Angular
- renders the mapped components
Mistake 2: Putting API Calls Inside Every Component
Avoid:
Prefer:
Mistake 3: Not Understanding Placeholders
A placeholder is not just a container in HTML.
In JSS, it represents a connection between:
Understanding placeholders makes debugging much easier.
Mistake 4: Component Name Mismatches
If Sitecore sends:
ProductHeroBut Angular registers:
HeroComponentWithout a correct mapping, the rendering cannot be resolved.
Always verify:
14. Debugging the Architecture
When a component does not render, I recommend following this flow.
This simple flow can save a significant amount of debugging time.
15. The Most Important Architecture Concept
If you remember only one thing from this article, remember this:
Sitecore controls the content and composition.
Angular controls the frontend experience.
That separation is the foundation of the Sitecore JSS architecture.
Conclusion
Sitecore JSS with Angular can initially feel complicated because multiple systems work together:
- Angular routing
- JSS routing
- Sitecore routes
- Layout Service
- Placeholders
- Renderings
- Component mapping
- REST or GraphQL delivery
However, once the request flow is understood, the architecture becomes much easier to work with.
The complete flow can be summarized as:
Understanding this flow is essential before moving into more advanced topics such as:
- Sitecore GraphQL
- Experience Edge
- XM Cloud
- Integrated GraphQL
- Personalization
- Multi-site architecture
- Performance optimization
- Component-driven design
In the next article, I will go deeper into one of the most important parts of this architecture: