From a Simple Click to a Global Digital Commerce Ecosystem
Part 2 – Inside Amazon’s Frontend: How Every Click Becomes an Action

Table of Contents
1. Introduction: What Happens When You Open Amazon?
Imagine that you open the Amazon website on your computer. You see a search bar, product images, prices, categories, offers and your shopping cart.
You search for a laptop. Amazon displays hundreds of products. You click one laptop, select a seller, add it to your cart and continue shopping.
For a normal user, this looks like a simple activity. But behind this experience, many frontend technologies work together.
Every button you click, every product image you see and every search result displayed on the screen is managed through different frontend components and technologies.
The frontend is responsible for everything the user can see and interact with. It receives user actions, communicates with the backend, processes responses and updates the screen.
In modern e-commerce platforms like Amazon, frontend development involves several important technologies, including HTML, CSS, JavaScript, TypeScript, React, APIs and browser rendering.
These technologies work together to create a responsive, interactive and user-friendly shopping experience.
The frontend is the communication bridge between the user and the application’s backend systems.
In this part, we will understand how this bridge works. We will explore Amazon frontend architecture step by step, starting from basic web technologies and moving towards advanced concepts such as component architecture, API communication, authentication, performance optimisation and frontend security.
By the end of this article, you will understand how a large e-commerce website manages its user interface and communicates with backend systems.
2. What Is Frontend Development in Amazon’s E-commerce Architecture?
Frontend development means building the user-facing part of a website or application. It focuses on the visual elements, layout, buttons, menus and interactive features that users see and use.
In an e-commerce website like Amazon, the frontend provides the complete shopping interface. It allows customers to search for products, view product details, select sellers, add items to their cart and complete purchases.
For an e-commerce website, the frontend includes:
- Homepage and navigation menu
- Search bar and search suggestions
- Product cards and product details
- Product images, prices and ratings
- Add to Cart and Buy Now buttons
- Login and registration screens
- Shopping cart and checkout screens
- Order status and tracking pages
Example: Understanding a Product Card
Consider a product card displayed on an e-commerce website:
Example Laptop – 15.6-inch
- 8 GB RAM
- 512 GB SSD
- Price: ₹49,999
- Availability: In Stock
This small card may contain text, images, buttons, prices, ratings and availability information. The frontend arranges all these elements and makes them interactive.
For example, when a customer clicks the Add to Cart button, the frontend captures that action and communicates with the backend through an API. The backend processes the request and sends a response, which the frontend uses to update the shopping cart on the screen.
This is how frontend development connects the visual interface with the application’s business logic.
3. Main Technologies Used in Amazon Frontend Development

Frontend development is not based on one programming language. Different technologies have different responsibilities. Together, they help developers build modern, interactive and responsive websites.
In large e-commerce platforms like Amazon, frontend architecture requires multiple technologies to manage webpage structure, visual design, user interactions and communication with backend systems.
Let’s understand the five important frontend technologies and their roles in website development.
3.1 HTML – Structure of the Website
HTML stands for HyperText Markup Language.
HTML defines the structure of a webpage. It creates headings, paragraphs, images, buttons, forms and links.
For example, HTML creates the structure of a product card containing a product name, price and Add to Cart button.
In an e-commerce website, HTML provides the basic structure for product listings, navigation menus, search boxes, login forms and shopping cart sections.
3.2 CSS – Design and Layout
CSS stands for Cascading Style Sheets.
CSS controls colours, fonts, spacing, borders, animations and responsive layouts.
Without CSS, a webpage would mostly display its content without the visual design that users expect from a modern website.
In e-commerce frontend development, CSS helps create attractive product cards, organised layouts, navigation menus and mobile-friendly shopping pages.
It also allows developers to make websites responsive so that they work properly on desktops, tablets and smartphones.
3.3 JavaScript – Functionality
JavaScript makes a website interactive.
It handles:
- Button clicks
- Form validation
- API requests
- Cart updates
- Dynamic content
- User interactions
For example, when a customer clicks Add to Cart, JavaScript can capture that event and send a request to the backend.
JavaScript can also update the shopping cart count, display messages, validate user input and dynamically show product information without reloading the entire webpage.
This makes JavaScript an important part of modern e-commerce frontend architecture.
3.4 TypeScript – Safer JavaScript Development
TypeScript adds static type checking to JavaScript.
It helps developers detect many coding mistakes before running the application.
For example, a developer can define that a product price must be a number rather than a text value.
This becomes especially useful in large applications where developers work with complex product data, customer information, API responses and reusable components.
TypeScript helps make code easier to maintain and understand as an application grows.
3.5 React – Building User Interfaces
React is a JavaScript library for building user interfaces using reusable components.
It allows developers to create separate components such as:
- Search Bar
- Product Card
- Shopping Cart
- Navigation Menu
- Login Form
For example, developers can create one reusable Product Card component and use it to display hundreds of products with different names, prices, images and ratings.
This component-based approach makes frontend development more organised and easier to maintain.
Important: These are common frontend technologies. They help us understand how a large e-commerce frontend can be built. We should not assume that every part of Amazon’s current website uses exactly this technology stack.
How Do These Frontend Technologies Work Together?
Each technology has a different responsibility:
| Technology | Main Responsibility |
|---|---|
| HTML | Creates webpage structure |
| CSS | Controls design and layout |
| JavaScript | Adds functionality and interactivity |
| TypeScript | Adds static type checking |
| React | Builds reusable user interface components |
When these technologies work together, developers can build a complete frontend application that displays products, handles customer interactions and communicates with backend services.
Understanding these technologies is the first step towards learning how large e-commerce platforms manage their frontend architecture.
4. How HTML, CSS and JavaScript Work Together in Amazon Frontend Development
HTML, CSS and JavaScript are the three fundamental technologies used in frontend web development. Each technology performs a different task, but they work together to create interactive and user-friendly websites.
Let’s understand this with a simple e-commerce product card example.
Suppose we want to create a product card with a button.
Step 1: HTML Creates the Structure
HTML defines the basic structure of the product card. It creates the product heading, price information and Add to Cart button.
<div class="product-card">
<h2>Example Laptop</h2>
<p>Price: ₹49,999</p>
<button id="cartButton">
Add to Cart
</button>
</div>
In this example:
<div>creates a container for the product card.<h2>displays the product name.<p>displays the product price.<button>creates the Add to Cart button.
Step 2: CSS Makes It Attractive
CSS controls the appearance and layout of the product card. It adds spacing, borders, rounded corners and button styling.
.product-card {
width: 280px;
padding: 20px;
border: 1px solid #ddd;
border-radius: 10px;
font-family: Arial;
}
.product-card button {
background: #ffd814;
border: none;
padding: 10px 18px;
cursor: pointer;
border-radius: 5px;
}
In this example:
widthcontrols the card width.paddingcreates space inside the card.borderadds an outline.border-radiuscreates rounded corners.backgroundsets the button colour.cursor: pointerindicates that the button is clickable.
Step 3: JavaScript Adds Functionality
JavaScript makes the product card interactive. It detects when the customer clicks the Add to Cart button and performs an action.
document
.getElementById("cartButton")
.addEventListener("click", function () {
alert("Product added to cart!");
});
In this example:
getElementById()finds the button using its ID.addEventListener()listens for a particular event."click"identifies the mouse click event.alert()displays a message when the customer clicks the button.
What Happens When These Three Technologies Work Together?
Now the user can see the product card and click the button. JavaScript responds to the click.
The complete process is:
- HTML creates the product card structure.
- CSS controls its appearance and layout.
- JavaScript handles the customer’s button click.
- The browser displays the updated interactive experience.
This is the basic foundation of an interactive e-commerce frontend.
How Is This Used in a Large E-commerce Website?
In a real e-commerce application, the process can become more advanced. When a customer clicks Add to Cart, JavaScript may send an API request to the backend. The backend validates the product information and processes the cart operation. The frontend then updates the cart count or displays a confirmation message based on the backend response.
This is how basic frontend technologies become part of a larger e-commerce architecture.
5. How Does a Browser Display a Website? Understanding the Browser Rendering Process

When you enter an address such as www.amazon.in, your browser does much more than simply display a page.
It follows a series of steps to download, process and display the website’s content. This process is known as browser rendering.
The browser takes HTML, CSS and JavaScript files and converts them into the visual webpage that users can see and interact with.
Let’s understand how this browser rendering process works step by step.
Step 1: HTML Is Downloaded
The browser requests the webpage and receives HTML content from a server.
This HTML contains the basic structure of the webpage, including headings, paragraphs, images, buttons and other elements.
Step 2: DOM Is Created
DOM stands for Document Object Model.
The browser converts HTML into a tree-like structure.
For example:
<body>
<h1>Welcome to Amazon</h1>
<button>Shop Now</button>
</body>
The browser creates a document structure containing the heading and button.
This structure is called the DOM tree. JavaScript can access and modify DOM elements to make the webpage interactive.
Step 3: CSS Is Processed
The browser reads CSS rules and understands how each element should look.
CSS provides information about colours, fonts, spacing, borders, dimensions and layouts.
The browser uses this styling information to determine the visual appearance of webpage elements.
Step 4: Render Tree Is Created
The browser combines the visible DOM elements and their styling information.
This creates the Render Tree, which contains the elements that need to be displayed on the screen along with their visual styling information.
Step 5: Layout
The browser calculates the size and position of each element.
For example, it determines:
- Where a product image should appear.
- How much space a product card requires.
- Where the product price should be displayed.
- How buttons and other elements should be positioned.
This process is also known as Layout or Reflow.
Step 6: Paint and Compositing
The browser draws text, images, backgrounds and other visual elements. It then combines the necessary layers to display the final page.
Painting creates the visual parts of the webpage, while compositing combines the required layers for display.
This complete process is called the browser rendering pipeline.
What Is the JavaScript Engine?
A JavaScript engine executes JavaScript code in the browser.
It allows websites to respond to user actions, process JavaScript instructions and update webpage content dynamically.
For example:
- Chrome uses the V8 JavaScript engine.
- Firefox uses SpiderMonkey.
- Safari uses JavaScriptCore.
When a user clicks a button, JavaScript can respond to the event and update the webpage.
In a large e-commerce website, JavaScript can handle product interactions, search suggestions, shopping cart updates and other dynamic user interface features.
Why Is Browser Rendering Important for Amazon Frontend Architecture?
A large e-commerce website may display thousands of product images, prices, buttons and other interface elements.
The browser must process and display these elements efficiently to provide a smooth shopping experience.
Understanding the browser rendering pipeline helps frontend developers identify performance problems, optimise webpage loading and build responsive user interfaces.
It is an important concept for understanding how modern websites deliver fast and interactive experiences.
6. How Does a Large Website Manage Thousands of Components?
Imagine that Amazon has to display thousands of product cards, search suggestions, navigation menus and customer account sections.
Writing every element separately would make development difficult.
This is why modern frontend development uses Component-Based Architecture.
A component is a small, reusable part of the user interface.
For example, an e-commerce website may have:
- Main Application
- Search Bar
- Account Menu
- Product Card
- Shopping Cart
- Navigation Menu
A product card can be reused for different products by passing different data to it.
Example Using React
function ProductCard({ name, price }) {
return (
<div className="product-card">
<h2>{name}</h2>
<p>₹{price}</p>
<button>Add to Cart</button>
</div>
);
}
function App() {
return (
<div>
<ProductCard
name="Laptop"
price="49999"
/>
<ProductCard
name="Keyboard"
price="999"
/>
</div>
);
}
Here, ProductCard is created once but reused for different products.
The actual product information can come from an API rather than being written directly in the code.
Why Are Components Useful?
- Code can be reused.
- Development becomes easier.
- Changes can be made in one place.
- Different teams can work on different components.
- Testing and maintenance become simpler.
7. How Does Amazon Identify a Product When You Click It? Understanding Product IDs, ASIN and Seller IDs

This is one of the most important concepts in e-commerce application development.
Suppose you search for a laptop and see three different laptops with similar names.
You click the second laptop.
How does the system know which product you selected?
Does it identify the product by its name or image?
Usually, a properly designed e-commerce application uses unique identifiers rather than depending on product names.
These identifiers help the frontend and backend identify products, sellers, inventory items and purchase offers accurately.
Understanding Product Identifiers in Amazon’s E-commerce Architecture
Different identifiers can be used for different purposes.
| Identifier | Meaning |
|---|---|
| Product ID | Unique internal identifier for a product |
| ASIN | Amazon Standard Identification Number |
| SKU | Stock Keeping Unit, often used to identify a particular seller’s stock item |
| Offer ID | Identifier for a specific purchase offer, where supported |
| Seller ID | Identifies the seller |
ASIN is an Amazon-specific product identifier. SKU is commonly used in inventory and seller systems. These identifiers are not interchangeable.
Each identifier serves a different purpose in an e-commerce system. Understanding their differences helps developers design better product catalogues, inventory systems and seller management applications.
Example: One Product, Multiple Sellers
Imagine that three sellers offer the same laptop model.
Example Laptop Model X
| Seller | Price | Delivery |
|---|---|---|
| Seller A | ₹49,999 | 2 days |
| Seller B | ₹48,999 | 4 days |
| Seller C | ₹50,499 | 3 days |
Notice that the product is the same, but the sellers, prices and delivery estimates are different.
Therefore, an e-commerce system may need to identify two things:
- Which product did the customer select?
- Which seller’s offer is being considered for purchase?
This distinction is important because a product represents the item in the catalogue, while an offer represents a seller’s specific purchasing option for that product.
How the Product Click Works
When a customer clicks a product, the frontend and backend work together to retrieve the correct product information.
- Customer clicks a product.
- Frontend reads the product identifier.
- Frontend sends an API request.
- Backend retrieves product information.
- Frontend displays product details.
For example, the frontend may send:
GET /api/products/PROD1001
The backend receives the product ID and retrieves the corresponding product information.
Example of Product Data
A backend API might return data like this:
{
"productId": "PROD1001",
"name": "Example Laptop",
"brand": "Example Brand",
"price": 49999,
"currency": "INR",
"offers": [
{
"sellerId": "SELLER01",
"price": 49999
},
{
"sellerId": "SELLER02",
"price": 48999
}
]
}
This is an educational example of an e-commerce API response, not an actual Amazon API response.
The frontend receives the information and displays it to the customer.
Why Are Product Identifiers Important?
Product identifiers help an e-commerce application:
- Retrieve the correct product details.
- Distinguish between similar products.
- Connect products with different seller offers.
- Manage inventory and stock information.
- Process shopping cart and order operations.
- Avoid depending on product names, which may not be unique.
Important: The frontend should not be trusted to decide the final product price. The backend must validate the selected product, seller offer, current price, stock availability and applicable discounts before processing an order. A customer changing the displayed price in the browser must not change the actual purchase price.
Understanding product IDs, ASIN, SKU and seller IDs is an important part of learning how large e-commerce platforms organise product catalogues and process customer purchases.
8. How Does Amazon Frontend Architecture Communicate With the Backend Through APIs?
The frontend cannot independently know everything about the business.
For example, it cannot safely decide:
- Whether the product is actually in stock.
- Whether the customer’s payment succeeded.
- Whether a seller is eligible to fulfil an order.
- Whether a coupon is valid.
- Whether an order has been confirmed.
It needs information from backend services.
This communication usually happens through APIs (Application Programming Interfaces).
In a large e-commerce application, the frontend sends requests to backend services to retrieve information or perform operations. The backend processes these requests, communicates with databases or other services and sends responses back to the frontend.
What Is an API?
API stands for Application Programming Interface.
An API allows two software systems to communicate with each other through defined rules.
For example:
- Frontend asks for product details.
- Backend processes the request.
- Backend returns product information.
- Frontend displays the response.
Think of an API as a communication channel between the frontend and backend. It defines how a request should be sent and what kind of response the application can receive.
What Is HTTP?
HTTP stands for Hypertext Transfer Protocol.
It is a protocol used for communication between clients and servers.
When a browser or frontend application communicates with a backend API, HTTP methods describe the type of operation being requested.
Common HTTP methods:
| Method | Purpose | Example |
|---|---|---|
| GET | Retrieve data | Get product details |
| POST | Create or submit data | Add an item to cart |
| PUT | Replace a resource | Update an address |
| PATCH | Partially update data | Change delivery preference |
| DELETE | Delete a resource | Remove a cart item |
These methods help developers organise API operations and define how the frontend interacts with backend resources.
Example: Product Details API
Suppose a customer clicks a laptop on an e-commerce website. The frontend needs to retrieve the product details from the backend.
Request:
GET /api/products/PROD1001
Possible response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"productId": "PROD1001",
"name": "Example Laptop",
"price": 49999,
"availability": "IN_STOCK"
}
The frontend reads this JSON response and updates the product page.
For example, it can display the product name, price and stock availability using the information received from the backend.
Important HTTP Status Codes
When the backend receives an API request, it sends an HTTP status code to indicate the result.
| Status Code | Meaning |
|---|---|
| 200 | Request successful |
| 201 | Resource created |
| 400 | Invalid request |
| 401 | Authentication required |
| 403 | Access not allowed |
| 404 | Resource not found |
| 409 | Conflict |
| 500 | Server error |
| 503 | Service unavailable |
For example, if a product does not exist, the backend may return 404 Not Found.
If a user is not logged in and tries to access a protected page, the backend may return 401 Unauthorized.
How Does This Communication Work in an E-commerce Website?
Consider a customer opening a laptop product page.
The communication process can be understood as follows:
- The browser displays the product page.
- The frontend sends a GET request to the product API.
- The backend receives the request.
- The backend retrieves the required product information.
- The backend sends a JSON response with an appropriate status code.
- The frontend processes the response and displays the product details.
This request-and-response process is a fundamental part of modern web application architecture.
Why Is Frontend-Backend Communication Important?
Without backend communication, a frontend application cannot reliably access live product information, customer accounts, inventory records, payment results or order status.
APIs connect the user interface with the business logic and data managed by backend systems.
Understanding APIs, HTTP methods, JSON responses and status codes is essential for students who want to learn full-stack development and understand how large e-commerce platforms work.
9. What Happens When a User Clicks Add to Cart in Amazon Frontend Architecture?
Let’s continue with our laptop example.
The user clicks Add to Cart.
The frontend first captures the click event and prepares a request.
In a modern e-commerce application, this action involves communication between the browser, frontend JavaScript and backend services.
A simplified example:
async function addToCart(productId) {
try {
const response = await fetch(
"/api/cart/items",
{
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
productId: productId,
quantity: 1
})
}
);
if (!response.ok) {
throw new Error("Unable to add product");
}
const result = await response.json();
console.log(result.message);
} catch (error) {
console.error(error.message);
}
}
addToCart("PROD1001");
Understanding the JavaScript Code
Let’s understand what happens in this example:
addToCart(productId)defines a function that receives a product identifier.asyncallows the function to use asynchronous operations.fetch()sends an HTTP request to the backend API.method: "POST"indicates that the frontend is submitting data.JSON.stringify()converts the product information into JSON format.awaitwaits for the API response.response.okchecks whether the HTTP response indicates success.response.json()reads the response body as JSON.try...catchhandles errors that may occur during the request.
This is a simplified example of how frontend JavaScript communicates with a shopping cart API.
What Happens Behind the Scenes?
When the customer clicks Add to Cart, several operations take place between the frontend and backend.
- User clicks the button.
- JavaScript captures the click.
- Frontend sends a POST request.
- Backend identifies the customer or session.
- Backend checks the product and offer.
- Backend validates the request and applicable rules.
- Backend updates the cart.
- Backend returns a response.
- Frontend updates the cart icon or displays a confirmation.
Understanding the Backend Processing
The backend performs important checks before updating the shopping cart.
For example, it may verify:
- Whether the product exists.
- Whether the selected offer is valid.
- Whether the requested quantity is allowed.
- Whether the customer is authorised to access the cart.
- Whether the cart operation follows the application’s business rules.
After processing the request, the backend sends a response to the frontend.
The frontend uses that response to update the shopping cart count or display a confirmation message.
Does Adding a Product to the Cart Reserve Stock?
The actual stock reservation and order confirmation processes can involve additional backend services. Adding something to the cart does not necessarily mean that stock has been reserved.
This distinction is important in e-commerce system design.
A product can be present in a customer’s shopping cart without being permanently reserved for that customer. Inventory validation and reservation rules are handled by backend systems according to the application’s business logic.
Why Is the Add to Cart Process Important?
The Add to Cart operation demonstrates how different parts of an e-commerce application work together:
- Frontend handles the customer’s click.
- JavaScript prepares the request.
- API connects the frontend with the backend.
- Backend validates the operation.
- Cart services manage cart information.
- Frontend displays the updated result.
This simple button demonstrates an important concept in Amazon frontend architecture: a user interface action can trigger multiple backend operations through API communication.
10. How Does Amazon Know Which Customer Is Logged In? Authentication, Sessions, Cookies and Tokens
Suppose you log in to Amazon using your email address and password.
You open a product, add it to your cart and then move to another page.
How does the website know that the same customer is still using it?
The answer involves Authentication, Sessions, Cookies and Tokens.
These technologies help modern e-commerce websites maintain user identity across multiple pages and API requests.
Without proper authentication and session management, a website would not be able to securely manage customer accounts, shopping carts, order history and personal information.
Authentication vs Authorisation
These two terms have different meanings.
- Authentication: Verifies who the user is.
- Authorisation: Checks what the user is allowed to do.
For example, a customer can view their own orders, but they should not be able to view another customer’s private order details.
Authentication confirms the customer’s identity, while authorisation controls access to protected resources.
What Is a Session?
A session represents an authenticated user’s interaction with an application.
After successful login, a server may create a session and provide a session identifier to the browser.
The browser sends the appropriate session information with later requests.
The backend uses this information to identify the user’s session and determine whether the request belongs to an authenticated customer.
For example, when a customer moves from the homepage to a product page and then to the shopping cart, the application can maintain the customer’s login session.
What Are Cookies?
Cookies are small pieces of data stored by the browser for a website.
They can help maintain login sessions and remember certain user preferences.
For example, a simplified cookie might look like:
Set-Cookie: session_id=abc123; HttpOnly; Secure; SameSite=Lax
This is an illustrative example, not an actual Amazon cookie.
Important cookie attributes:
| Attribute | Purpose |
|---|---|
| HttpOnly | Prevents JavaScript from reading the cookie |
| Secure | Sends the cookie only over secure HTTPS connections |
| SameSite | Controls when the browser sends cookies in cross-site requests |
| Expires / Max-Age | Controls cookie lifetime |
These attributes help developers protect session cookies and reduce certain security risks.
What Are Access Tokens?
Some applications use tokens to authenticate API requests.
For example, an application might send:
Authorization: Bearer ACCESS_TOKEN
The backend validates the token and determines whether the request is authorised.
Tokens can be used in different ways depending on the application architecture.
For example, an application may use access tokens with a defined expiry time and a separate refresh mechanism to maintain authentication.
The exact token management approach depends on the application’s security requirements and architecture.
Cookies vs Local Storage vs Session Storage
Web browsers provide different storage mechanisms for managing website data.
| Feature | Cookies | Local Storage | Session Storage |
|---|---|---|---|
| Storage | Browser | Browser | Browser tab/session |
| Automatically sent with HTTP requests | Yes, when matching cookie rules | No | No |
| Typical use | Session management | Preferences and non-sensitive data | Temporary page state |
| JavaScript access | Depends on HttpOnly | Yes | Yes |
Each storage mechanism has a different purpose.
Cookies can be automatically included in matching HTTP requests, while Local Storage and Session Storage require JavaScript to read their values and send them when needed.
Security lesson: Never store passwords or sensitive authentication information in ordinary browser storage. Authentication design requires careful protection against token theft, cross-site scripting and other attacks.
How Does This Work in Amazon Frontend Architecture?
Consider a customer who logs in and adds a laptop to the shopping cart.
The simplified process is:
- Customer enters login credentials.
- The authentication system verifies the credentials.
- The application establishes an authenticated session or issues an appropriate authentication token.
- The browser includes the required authentication information with subsequent requests.
- Backend services verify the customer’s identity and permissions.
- The application provides access to the customer’s authorised information.
This is how authentication and session management help an e-commerce application maintain customer identity across different pages and operations.
Understanding these concepts is important for frontend developers because login screens, protected pages, shopping carts and customer account sections all depend on secure communication between the frontend and backend.
11. How Does Amazon Load Product Images So Quickly? CDN and Image Optimisation Explained
Imagine Amazon displays 100 products on one page.
Each product may have several images. Downloading all images at their original size could make the page very slow.
Large websites therefore use image optimisation and content delivery techniques to improve website performance and provide a faster shopping experience.
In modern e-commerce frontend architecture, techniques such as Content Delivery Networks (CDNs), image compression, caching and lazy loading help deliver product images efficiently.
What Is a CDN?
CDN stands for Content Delivery Network.
A CDN distributes content through servers located in different geographical regions.
For example, a customer in India may receive an image from a nearby CDN location instead of downloading it from a distant origin server.
This can reduce network latency and improve image loading speed.
A simplified image delivery process:
- Browser requests an image.
- CDN checks whether it has a cached copy.
- If available, CDN sends the image.
- If not available, it may retrieve it from the origin server.
- The image is cached according to the configured rules.
This process helps reduce repeated requests to the origin server and improves content delivery for users in different locations.
What Is Lazy Loading?
Lazy loading means loading images when they are needed rather than loading every image immediately.
For example, consider a product listing page containing 100 products. The customer initially sees only the first few products. There is no need to download every image immediately if most products are far below the visible screen area.
Example:
<img
src="laptop.jpg"
alt="Example laptop"
loading="lazy"
/>
When the customer scrolls towards the image, the browser can load it.
This reduces unnecessary network usage, especially on long product pages.
Other Image Optimisation Techniques
Large e-commerce websites can use several techniques to improve product image delivery:
- Compressing images.
- Using suitable image dimensions.
- Serving modern formats such as WebP or AVIF when supported.
- Caching frequently requested images.
- Using responsive image sizes.
- Loading important above-the-fold images early.
Why Is Image Optimisation Important for Amazon Frontend Architecture?
Product images are an important part of the online shopping experience. Customers use them to understand product appearance, design and features.
If images take too long to load, the shopping experience becomes frustrating.
CDNs, lazy loading, caching and image compression help frontend developers improve page performance while reducing unnecessary network requests.
For students, understanding these techniques is important because image optimisation is a fundamental part of building fast and scalable e-commerce websites.
12. How Does Amazon Frontend Architecture Work on Mobile Phones? Responsive Web Design Explained
A customer may open Amazon on:
- Desktop computer
- Laptop
- Android phone
- iPhone
- Tablet
The screen size and user interaction methods are different.
A desktop computer has a large display, while a mobile phone has a smaller screen. Users may interact through a mouse and keyboard on a computer, but they generally use touch gestures on mobile devices.
A good frontend must adapt to these devices and provide a consistent shopping experience.
This is called Responsive Web Design.
What Is Responsive Design?
Responsive design allows the same website to adjust its layout according to the screen size.
For example, an e-commerce website may display four product columns on a desktop but only one or two columns on a mobile phone.
| Desktop | Mobile |
|---|---|
| Four product columns | One or two product columns |
| Full navigation menu | Compact navigation |
| Large search bar | Smaller search interface |
| Mouse interaction | Touch interaction |
Responsive design uses flexible layouts, CSS Grid, Flexbox, media queries and appropriately sized images to adapt the interface.
It is important because customers should be able to search for products, view product details, add items to their cart and complete purchases comfortably on different devices.
Example Using CSS Media Queries
CSS media queries allow developers to apply different styles according to screen characteristics such as viewport width.
.product-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 20px;
}
@media (max-width: 768px) {
.product-grid {
grid-template-columns: repeat(2, 1fr);
}
}
@media (max-width: 480px) {
.product-grid {
grid-template-columns: 1fr;
}
}
The browser changes the number of columns based on the screen width.
How does this code work?
- Default CSS: The product grid displays four columns.
- At 768px or below: The media query changes the layout to two columns.
- At 480px or below: The layout changes to one column.
Here, repeat(4, 1fr) creates four equal-width columns, while gap: 20px adds spacing between products.
The @media rule applies CSS only when the specified screen condition is satisfied.
What About Android and iOS Apps?
A mobile app is not simply a website opened on a phone.
Native Android and iOS applications can use platform-specific development technologies. Developers can also use cross-platform frameworks to build applications for multiple operating systems.
| Platform | Common Technologies |
|---|---|
| Android | Kotlin, Java |
| iOS | Swift |
| Cross-platform | React Native, Flutter |
These are common industry technologies. They should not be interpreted as a confirmed list of technologies used by every Amazon mobile application.
Responsive Website vs Native Mobile Application
A responsive website runs inside a web browser and adjusts its layout according to the device.
A native mobile application is developed for a specific operating system and can use platform features through its native APIs.
For example:
- A responsive website can be opened using Chrome or Safari.
- An Android application can use Android platform APIs.
- An iOS application can use iOS platform APIs.
- Cross-platform frameworks can help developers share parts of the application code across platforms.
Both approaches can communicate with backend services through APIs. However, their user interfaces, deployment methods and access to device features may differ.
Why Is Mobile Compatibility Important in E-commerce?
Customers may browse products using a laptop during the day and use a mobile phone later.
A mobile-friendly frontend should provide:
- Easy navigation on smaller screens.
- Readable product information.
- Touch-friendly buttons.
- Responsive product images.
- Convenient search and filtering.
- A simple shopping cart and checkout experience.
For frontend developers, responsive design is not just about making a website smaller. It is about adapting the user experience to different devices and interaction methods.
13. How Does Amazon Make Its Frontend Fast? 6 Website Performance Optimisation Techniques
A slow shopping website can frustrate customers.
Imagine that a customer clicks a product but waits ten seconds for the page to load. The customer may leave the website.
Frontend performance is therefore an important part of e-commerce development.
For large e-commerce platforms, frontend performance involves more than reducing page loading time. Developers must optimise JavaScript, CSS, images, API requests, browser rendering and the overall user experience.
Here are six important techniques used in modern frontend development to improve website performance.
1. Code Splitting
Instead of downloading the entire application at once, the application can load only the required code for a particular page or feature.
For example, a shopping website may have separate features for:
- Homepage
- Product listing
- Product details
- Shopping cart
- Checkout
- Customer account
A customer viewing a product page may not need the complete checkout application code immediately.
Code splitting divides the application into smaller JavaScript bundles. The browser can download the required bundles when needed.
Benefits of code splitting:
- Reduces the initial JavaScript download.
- Helps pages become interactive sooner.
- Avoids loading unnecessary code.
- Improves the performance of large frontend applications.
2. Lazy Loading
Images and other resources can be loaded when they are needed.
For example, if a page contains 100 product images, the browser does not necessarily need to load all images immediately.
Images below the visible screen area can be loaded as the customer scrolls towards them.
Example:
<img
src="laptop.jpg"
alt="Example laptop"
loading="lazy"
/>
Lazy loading helps reduce unnecessary network usage and can improve the initial page loading experience.
3. Caching
Frequently requested content can be stored temporarily to avoid downloading it again.
For example, a website may cache:
- Product images.
- CSS files.
- JavaScript files.
- Fonts.
- Other static resources.
When the browser or CDN has a valid cached copy, it may reuse that copy instead of downloading the resource again from the origin server.
Benefits of caching:
- Reduces repeated network requests.
- Improves loading speed.
- Reduces pressure on origin servers.
- Helps deliver frequently requested content efficiently.
Developers must configure caching rules carefully. Frequently changing information, such as stock availability and order status, may require different caching strategies from static images or CSS files.
4. Minification
Unnecessary spaces and characters can be removed from JavaScript and CSS files to reduce their size.
For example, readable JavaScript code:
function calculateTotal(price, quantity) {
return price * quantity;
}
A minified version:
function calculateTotal(a,b){return a*b}
Both examples perform the same calculation.
Minification reduces file size and can help the browser download resources faster. Production build tools can also perform bundling and other optimisations.
5. API Optimisation
The frontend should avoid unnecessary API calls and should request only the data required for the current screen.
Imagine that a product listing page needs only:
- Product name.
- Product image.
- Price.
- Rating.
- Availability.
It may not need to download every technical specification, customer review and order history for every product.
A well-designed API response can provide the information required by the frontend without transferring unnecessary data.
Common API optimisation techniques include:
- Avoiding duplicate API requests.
- Requesting only required fields.
- Using pagination for large product lists.
- Applying caching where appropriate.
- Combining related requests when it makes sense.
- Handling API errors and timeouts efficiently.
API optimisation improves the communication between frontend applications and backend services.
6. Skeleton Loading
A temporary placeholder can be displayed while the actual content is loading.
For example, when a customer opens a product listing page, grey placeholder blocks may appear where product images, names and prices will eventually be displayed.
Once the actual API response arrives, the placeholders are replaced with real product information.
This technique is called Skeleton Loading.
Why is it useful?
- Shows that the page is still loading.
- Gives users an immediate visual response.
- Helps reduce the feeling of waiting.
- Can reduce unexpected layout changes when placeholder dimensions match the final content.
What Are Core Web Vitals?
Core Web Vitals are Google’s measurements of important aspects of user experience.
They help developers understand how quickly a webpage loads, how well it responds to user interactions and whether its layout remains visually stable.
| Metric | What It Measures |
|---|---|
| LCP | How quickly the main content appears |
| INP | How responsive the page is to user interactions |
| CLS | How much the page layout unexpectedly shifts |
Understanding the three metrics:
- LCP (Largest Contentful Paint): Measures how long it takes for the largest visible content element to appear. For example, this may be a large product image or heading.
- INP (Interaction to Next Paint): Measures how quickly a page responds visually after a user interacts with it, such as clicking a button or selecting a filter.
- CLS (Cumulative Layout Shift): Measures unexpected movement of page elements while the page is loading or being used.
A good frontend developer should understand these metrics and know how to identify performance problems.
How Can Developers Measure Frontend Performance?
Developers can use tools such as:
- Google PageSpeed Insights: Analyses webpage performance and provides optimisation suggestions.
- Chrome DevTools: Helps inspect network requests, JavaScript execution, rendering and performance.
- Lighthouse: Audits performance, accessibility, SEO and other aspects of a webpage.
These tools help developers identify issues such as large images, slow API responses, excessive JavaScript and layout shifts.
Why Is Frontend Performance Important for E-commerce?
A fast website provides a smoother shopping experience. Customers can browse products, open product details, compare prices and interact with the shopping cart more comfortably.
For students learning frontend development, these techniques are important because building a website is not enough. Developers must also make sure that it performs efficiently under different network conditions and on different devices.
Remember: A good frontend is not only visually attractive. It should also be fast, responsive, accessible and reliable.
asurements and use tools such as Chrome DevTools and PageSpeed Insights to identify performance problems.
14. Frontend Security in Amazon Architecture: How Do We Protect Customers?
An e-commerce website handles sensitive activities such as login, payment, addresses and personal information.
Frontend security is therefore very important.
However, frontend security alone is not enough. The backend must also validate and protect all important operations.
For example, a shopping website may display a product price, accept a login form and send an order request. Attackers may try to manipulate these interactions, steal information or perform unwanted actions.
Let’s understand five important frontend security risks and how developers can protect users.
1. Cross-Site Scripting (XSS)
XSS occurs when an attacker manages to execute harmful scripts in another user’s browser.
Example: An application displays untrusted user input as executable HTML instead of safely displaying it as text.
Imagine a shopping website allows customers to submit product reviews. If the application handles the review content unsafely, an attacker may try to insert a malicious JavaScript script into the review.
When another customer opens that review, the script may execute in their browser.
Protection includes:
- Proper output encoding.
- Safe rendering practices.
- Content Security Policy (CSP).
- Avoiding unsafe HTML insertion methods.
- Validating and handling untrusted input carefully.
Developers should use safe framework rendering methods and avoid inserting untrusted content directly into the page as executable HTML.
2. Cross-Site Request Forgery (CSRF)
CSRF tricks an authenticated user’s browser into sending an unwanted request to a website.
For example, imagine a customer is already logged in to a shopping website. The attacker may try to make the customer’s browser send an unwanted request using the customer’s existing authenticated session.
The customer may not realise that the request has been triggered.
Protection can include:
- CSRF tokens.
- Appropriate SameSite cookie settings.
- Origin checks.
- Checking the request’s origin and security context.
A CSRF token is a unique value that the server expects with a protected request. It helps the server distinguish legitimate application requests from unauthorised cross-site requests.
3. Clickjacking
An attacker may attempt to hide a genuine website inside another page and trick a user into clicking something unexpected.
For example, an attacker may place an invisible or disguised website element over a visible button. The customer thinks they are clicking one thing but may actually interact with another page.
Security headers such as Content Security Policy’s frame-ancestors directive can help prevent this.
For example:
Content-Security-Policy: frame-ancestors 'self';
This example allows the page to be embedded only by pages from the same origin. A stricter policy can prevent embedding altogether:
Content-Security-Policy: frame-ancestors 'none';
The appropriate policy depends on whether the application needs to be embedded inside other websites.
4. Insecure API Requests
Sensitive information should not be sent through unencrypted connections.
HTTPS protects communication between the browser and server using TLS.
Without proper transport encryption, information travelling across a network may be exposed to interception or modification.
For example, a shopping application may exchange:
- Login credentials.
- Session information.
- Customer addresses.
- Order details.
- Payment-related information.
Using HTTPS helps protect data while it travels between the browser and backend server.
Important: HTTPS protects communication in transit. It does not automatically protect an application from every security vulnerability. Authentication, authorisation, secure session management and server-side validation are also necessary.
5. Trusting Frontend Prices
Suppose a product costs ₹49,999.
A malicious user might modify the displayed price using browser developer tools.
That does not mean the real product price should change.
The backend must retrieve and verify the actual price before accepting the order.
For example, the frontend might send this request:
{
"productId": "P101",
"quantity": 1,
"price": 1
}
The backend must not blindly accept the submitted price of ₹1.
Instead, it should:
- Identify the requested product.
- Retrieve the trusted price from the server-side product or offer records.
- Check product availability.
- Calculate the order amount using trusted server-side data.
- Apply valid discounts and business rules.
- Continue with the order and payment process using the verified amount.
This is an important example of why frontend validation alone cannot protect an e-commerce application.
Important Development Rule: Never Trust the Browser for Important Business Decisions
Validate prices, stock, permissions, discounts and payment status on the server.
The browser is controlled by the user. Developers cannot assume that information submitted by the frontend is genuine.
For example:
| Information | What the backend should verify |
|---|---|
| Product price | Retrieve the trusted price from server-side records |
| Stock quantity | Check current inventory availability |
| User permissions | Verify the user’s identity and access rights |
| Discount | Validate the coupon and applicable business rules |
| Payment status | Verify payment confirmation through a trusted payment process |
Why Is Frontend Security Important in Amazon-Style E-commerce Applications?
A secure frontend helps protect customer interactions, but security must be implemented across the complete application.
Developers should understand:
- Secure authentication and session management.
- Safe handling of user input.
- HTTPS and TLS.
- Protection against XSS and CSRF.
- Security headers and browser policies.
- Server-side validation and authorisation.
- Secure payment and order processing.
Remember: Frontend validation improves the user experience, but backend validation protects the application’s business logic and data.
15. Complete Amazon Frontend Architecture: From Customer Click to Screen Update
Let’s connect the concepts we have learned.
Suppose a customer opens a product page and adds a laptop to the cart.
What happens behind the scenes?
The browser displays the product information, frontend components handle the customer’s interaction, an API request communicates with the backend, and the response is used to update the screen.
The following is a simplified teaching architecture. It is not a claim about Amazon’s private internal implementation.
Main Components of Frontend Architecture
| Component | Responsibility |
|---|---|
| Browser / Mobile App | Displays the user interface |
| HTML / CSS | Structure and design |
| JavaScript / TypeScript | Interaction and application logic |
| UI Components | Product cards, cart and menus |
| API Client | Sends requests to backend |
| Authentication Layer | Maintains user identity |
| CDN | Delivers cached static content |
| Backend APIs | Process business requests |
| Database | Stores persistent information |
Understanding Each Component
1. Browser / Mobile App
The browser or mobile application is the customer’s entry point.
It displays the shopping interface and allows customers to search for products, view details, select quantities and interact with the shopping cart.
2. HTML / CSS
HTML defines the structure of the webpage, while CSS controls its appearance.
For example, HTML creates a product card containing the product name, image and price. CSS controls its layout, colours, spacing and responsiveness.
3. JavaScript / TypeScript
JavaScript and TypeScript handle frontend interaction and application logic.
For example, when a customer clicks the Add to Cart button, JavaScript can handle the click event and initiate an API request.
TypeScript adds static type checking to JavaScript, helping developers identify certain errors during development.
4. UI Components
UI components are reusable parts of the application.
Examples include:
- Product Card
- Search Bar
- Navigation Menu
- Shopping Cart
- Login Form
- Product Image Gallery
Component-based architecture makes large frontend applications easier to develop, test and maintain.
5. API Client
The API client handles communication between the frontend and backend.
It sends HTTP requests and processes responses, including JSON data and error information.
For example, when the customer adds a laptop to the cart, the API client may send a POST request containing the product ID and quantity.
6. Authentication Layer
The authentication layer helps maintain the customer’s identity across application requests.
It works with the application’s session or token mechanism so that backend services can identify the customer and check access permissions.
7. CDN
A Content Delivery Network distributes static resources such as product images, CSS files, JavaScript bundles and fonts through geographically distributed servers.
It can help reduce loading time and improve content delivery.
8. Backend APIs
Backend APIs receive requests from the frontend and process business operations.
For an Add to Cart request, the backend may verify the customer, product, seller offer, quantity and applicable business rules.
9. Database
The database stores persistent application information.
Depending on the application design, this may include customer records, product information, seller offers, cart data and order records.
The backend communicates with the database to retrieve or update information.
Overall Communication Flow
Customer
|
v
Website / Mobile App
|
v
Frontend Components
|
v
API Request
|
v
Backend Services
|
v
Database / Other Services
|
v
API Response
|
v
Frontend Updates Screen
This is the basic communication cycle behind many modern web applications.
Step-by-Step: What Happens When a Customer Clicks Add to Cart?
Let’s understand the complete process using a laptop as an example.
Step 1: Customer opens the product page
The browser loads the webpage structure, styles, JavaScript files and required product information.
Step 2: Frontend displays the product
The product component displays the laptop image, name, price and available actions.
Step 3: Customer clicks Add to Cart
JavaScript detects the click event and starts the cart operation.
Step 4: API client sends a request
The frontend sends a request to the backend. A simplified example is:
POST /api/cart/items
Content-Type: application/json
Request body:
{
"productId": "P101",
"quantity": 1
}
This is an illustrative API endpoint, not an actual Amazon endpoint.
Step 5: Backend processes the request
The backend identifies the customer, validates the product and checks the relevant business rules.
Step 6: Database or other services are accessed
The backend retrieves or updates the required cart information.
Step 7: Backend sends an API response
For example:
{
"success": true,
"message": "Product added to cart",
"cartCount": 1
}
This is an illustrative response.
Step 8: Frontend updates the screen
JavaScript processes the response and updates the shopping cart count or displays a confirmation message.
The customer can now see that the product has been added to the cart.
Why Is This Architecture Important?
A modern e-commerce application is not just a collection of HTML pages. It is a combination of frontend components, browser technologies, APIs, backend services, databases and content delivery systems.
Understanding how these components communicate helps developers:
- Build maintainable frontend applications.
- Separate user interface code from business logic.
- Handle API failures correctly.
- Improve application performance.
- Protect customer information.
- Develop applications that can scale as usage increases.
Key Learning: Every click on a modern shopping website may initiate a series of interactions between frontend components, APIs, backend services and databases. Understanding this complete flow is an important foundation for learning full-stack development and system design.
16. Practical Project for Students: Build Your Own Mini Amazon Frontend – KHCA Mini Shopping Store
Now let’s apply these concepts by building a small e-commerce frontend.
Until now, we have studied frontend architecture, HTML, CSS, JavaScript, React, APIs, authentication, CDN, performance and security.
Now it is time to apply this knowledge through a practical project.
Project Name: KHCA Mini Shopping Store
The objective is to develop a small online shopping website where customers can browse products, view product information, add products to a cart and calculate the total amount.
This project will help students understand how frontend technologies work together in a real-world e-commerce application.
Technologies Required for the Project
We will start with basic frontend technologies and gradually introduce backend development.
| Technology | Purpose |
|---|---|
| HTML | Webpage structure |
| CSS | Design and responsive layout |
| JavaScript | Functionality |
| JSON | Sample product data |
| Fetch API | Backend communication (in the next development stage) |
Understanding the technologies:
- HTML: Creates the structure of the homepage, product cards, navigation menu and shopping cart.
- CSS: Controls colours, spacing, product layouts, buttons and mobile responsiveness.
- JavaScript: Handles product selection, cart operations, quantity changes and price calculations.
- JSON: Represents product information in a structured data format.
- Fetch API: Allows JavaScript to communicate with backend services through HTTP requests.
Features to Develop
Build the following eight features step by step.
1. Homepage with Navigation and Search
Create a homepage containing:
- Website logo or project name.
- Navigation menu.
- Product search bar.
- Shopping cart icon.
- Product categories.
2. Product Listing Page
Display available products using product cards.
Each card can contain:
- Product image.
- Product name.
- Price.
- Stock information.
- Add to Cart button.
3. Product Detail Page
When a customer selects a product, display its detailed information.
For example, a laptop detail page can show the product name, price, available stock, description and product image.
4. Add to Cart Button
When the customer clicks Add to Cart, JavaScript should identify the selected product and add it to the shopping cart.
5. Shopping Cart with Quantity
Display the products selected by the customer.
The cart should show the product name, price, quantity and subtotal.
6. Remove Product Option
Allow customers to remove unwanted products from the shopping cart.
7. Automatic Total Price Calculation
Calculate the total amount automatically whenever the customer adds, removes or changes the quantity of a product.
For example:
| Product | Price | Quantity | Subtotal |
|---|---|---|---|
| Laptop | ₹49,999 | 1 | ₹49,999 |
| Keyboard | ₹999 | 2 | ₹1,998 |
| Wireless Mouse | ₹599 | 1 | ₹599 |
| Total | ₹52,596 |
8. Mobile-Friendly Design
Make the website responsive so that customers can use it on desktop computers, laptops, tablets and mobile phones.
Sample Product Data
We will initially store product information in a JavaScript array.
const products = [
{
id: "P101",
name: "Laptop",
price: 49999,
stock: 10
},
{
id: "P102",
name: "Keyboard",
price: 999,
stock: 25
},
{
id: "P103",
name: "Wireless Mouse",
price: 599,
stock: 40
}
];
Understanding this product data:
id: Unique identifier for each product.name: Product name.price: Product price in Indian Rupees.stock: Available quantity in this sample dataset.
The products variable contains an array of JavaScript objects.
Each object represents one product. JavaScript can use this data to generate product cards dynamically.
For example, instead of writing separate HTML for every product, developers can use a loop to display all products from the array.
Student Challenge
Create a product listing page using the above data.
When a customer clicks Add to Cart:
- The selected product should be added to the cart.
- The cart count should increase.
- The total price should be calculated.
- The same product should not create unnecessary duplicate cart entries; update its quantity instead.
Example:
Suppose a customer clicks Add to Cart for the Laptop three times.
The cart should display:
| Product | Quantity | Price | Subtotal |
|---|---|---|---|
| Laptop | 3 | ₹49,999 | ₹1,49,997 |
The application should maintain one cart entry for the laptop and update its quantity to three.
This is an important programming concept because developers must manage application state correctly.
Suggested Project Development Stages
To make the project easier for beginners, divide the development into stages.
| Stage | Development Task | Expected Result |
|---|---|---|
| Stage 1 | Create HTML structure | Basic shopping webpage |
| Stage 2 | Apply CSS | Attractive product layout |
| Stage 3 | Add JavaScript product data | Dynamic product listing |
| Stage 4 | Implement Add to Cart | Working shopping cart |
| Stage 5 | Add quantity and remove options | Cart management |
| Stage 6 | Calculate total price | Automatic billing |
| Stage 7 | Add responsive design | Mobile-friendly website |
| Stage 8 | Connect backend APIs | Full-stack application |
Future Development: Connect a Backend and Database
Initially, this project can work using JavaScript and sample product data.
However, a real e-commerce application needs backend services and persistent storage.
Later, connect this frontend to a FastAPI or Java Spring Boot backend and a database.
A possible learning architecture is:
KHCA Mini Shopping Store
|
v
HTML / CSS / JS
|
v
Fetch API
|
v
Backend Application
/ \
v v
FastAPI Spring Boot
\ /
v v
Database
This is a learning architecture. In an actual implementation, you would choose one backend framework rather than running both frameworks for the same application.
The backend can manage product information, customer accounts, cart operations, stock validation and order processing.
A database can store information permanently so that the data is not lost when the browser is closed.
What Will Students Learn From This Project?
After completing the KHCA Mini Shopping Store, students will understand:
- How HTML creates a webpage structure.
- How CSS creates responsive layouts.
- How JavaScript handles user interactions.
- How arrays and objects represent product data.
- How to manage shopping cart state.
- How to calculate quantities and totals.
- How frontend applications communicate with backend APIs.
- How a database stores application information.
- How to organise a small full-stack application.
This project also creates a foundation for learning React, FastAPI, Java Spring Boot, database management and system design.
Final Learning Goal: Don’t just copy an e-commerce website design. Understand how every feature works, write the code yourself, test different situations and gradually convert your frontend project into a full-stack shopping application.
This will help you understand how a real full-stack application works.
17. Test Your Knowledge – MCQs
Q1. Which technology is mainly responsible for the structure of a webpage?
A. CSS
B. HTML
C. JavaScript
D. SQL
Answer: B. HTML
Q2. Which technology makes a webpage interactive?
A. HTML
B. CSS
C. JavaScript
D. MySQL
Answer: C. JavaScript
Q3. What does DOM stand for?
A. Data Object Method
B. Document Object Model
C. Digital Output Machine
D. Document Operation Method
Answer: B. Document Object Model
Q4. What is the main purpose of an API?
A. Design images
B. Connect software systems
C. Store passwords in the browser
D. Create CSS animations
Answer: B. Connect software systems
Q5. Which HTTP method is commonly used to retrieve product information?
A. POST
B. DELETE
C. GET
D. PATCH
Answer: C. GET
Q6. What is a CDN used for?
A. Writing Java code
B. Distributing content closer to users
C. Creating database tables
D. Encrypting passwords
Answer: B. Distributing content closer to users
Q7. What is the purpose of lazy loading?
A. Load everything immediately
B. Delay loading until resources are needed
C. Delete unused files
D. Disable JavaScript
Answer: B. Delay loading until resources are needed
Q8. Which identifier is specific to Amazon’s product catalogue?
A. ASIN
B. CSS
C. HTML
D. HTTP
Answer: A. ASIN
Q9. What does HttpOnly do for a cookie?
A. Makes it public
B. Prevents JavaScript from reading it
C. Deletes it automatically
D. Encrypts the database
Answer: B. Prevents JavaScript from reading it
Q10. Where should the final product price be validated?
A. Only in HTML
B. Only in CSS
C. On the backend
D. Only in browser storage
Answer: C. On the backend
18. Interview Questions for Beginners
- What is the difference between frontend and backend?
- Explain the roles of HTML, CSS and JavaScript.
- What is the DOM?
- What is React and why are components useful?
- What is an API?
- Explain GET and POST requests.
- What is JSON?
- What is the difference between cookies and local storage?
- What is a CDN?
- Why should product prices be validated on the backend?
19. Important Technical Terms
| Term | Simple Meaning |
|---|---|
| Frontend | User-facing part of an application |
| DOM | Tree-like representation of a webpage |
| Component | Reusable UI element |
| API | Communication interface between systems |
| JSON | Data exchange format |
| HTTP | Web communication protocol |
| Cookie | Small browser-stored data |
| Session | Information representing a user’s interaction |
| CDN | Distributed content delivery network |
| Lazy Loading | Loading resources when needed |
| Responsive Design | Layout that adapts to screen sizes |
| XSS | Attack involving harmful scripts in webpages |
| CSRF | Attack that tricks a browser into sending unwanted requests |
20. References and Further Learning
These resources will help students understand the technologies in more depth.
- MDN Web Docs – Learn Web Development: https://developer.mozilla.org/en-US/docs/Learn_web_development
- React – Official React Learning Guide: https://react.dev/learn
- TypeScript – Official Documentation: https://www.typescriptlang.org/docs/
- OWASP – OWASP Top 10: https://owasp.org/www-project-top-ten/
- web.dev – Web Performance Learning: https://web.dev/learn/performance/
- Amazon – About Amazon: https://www.aboutamazon.com/
Conclusion of Part 2
We have now understood that a modern e-commerce frontend is much more than a collection of HTML pages.
It is a complete user interaction system involving:
- HTML, CSS, JavaScript and TypeScript.
- Component-based UI development.
- Browser rendering and JavaScript execution.
- Product identification through unique identifiers.
- API communication with backend services.
- Login sessions, cookies and tokens.
- Image delivery through CDNs.
- Responsive design and performance optimisation.
- Frontend security and data validation.
But one important question remains:
When the frontend sends a request to the backend, what happens inside the server?
How does the server identify the customer, retrieve product details, check seller offers, verify stock and communicate with different databases and services?
That is where we enter the next major topic.