
This course teaches JavaScript for frontend development through practical examples and a step-by-step e-commerce application called ShopEasy. Students learn JavaScript concepts and apply them to a real-world-style project using HTML, CSS, JavaScript, ES Modules, Local Storage, Fetch API, and REST APIs.
Project Background
ShopEasy is a demo e-commerce application that includes:
User registration and login
Product listing and search
Product details
Add to cart
Increase and decrease product quantity
Remove products from cart
Calculate subtotal, shipping, and grand total
Checkout and form validation
Error handling
JavaScript classes and modules
Learning Objectives
By the end of this lesson, students should be able to:
Understand how a frontend application communicates with a REST API.
Retrieve product data using the HTTP GET method.
Use a reusable ApiService class for API communication.
Use ProductManager to manage product data.
Handle API errors using try...catch.
Map external API response fields to the application's existing product structure.
Display API products in the ShopEasy interface.
Inspect API requests and responses using browser DevTools.
Files Used
js/ApiService.js — handles HTTP requests.
js/ProductManager.js — retrieves and normalizes product data.
js/products.js — displays the product listing.
js/product-details.js — displays individual product details.
products.html — product listing page.
product-details.html — product details page.
Testing
Students should verify that:
Products load successfully from the API.
Product cards display the correct details and images.
The View Product button opens the correct product.
The browser Network tab shows the GET request and its response status.
API failures display a friendly error message.
The application continues using its expected product data structure.