SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Build Luigi App with React

Create a mock shopping application with React and configure it using Luigi.

Overview

🎓 beginner 25 min. User InterfaceBeginnerJavascript

You will learn

  • โœ”How to add content to your React web shopping app
  • โœ”How to use Luigi to configure navigation
  • โœ”How to create simple micro-frontends using React
Johannes Doberer J Johannes Doberer June 15, 2026
Created by December 10, 2024
Contributors

Prerequisites

Steps

Step 1 Add a file with product data
โ€”

In this step, you will create a file with information about the products on sale in your shopping app.

In a real life implementation, this data would be provided by an external service/API. But for simplicity, you will create a .js file containing dummy data. This file will provide the displayed data in the micro-frontend. You will create a similar file in the UI5 micro-frontend to avoid bundling issues.

  1. Navigate to react-core-mf/src/assets and create a products.js file with the following content:

    JavaScript
    export const ProductCollection = [
    {
        "id": 101,
        "name": "Mouse",
        "price": 45.0,
        "stock": 80,
        "icon": "product",
        "currencyCode": "EUR",
        "orderQuantity": 2,
        "description": "Wireless Gaming Mouse with Sensor"
    },
    {
        "id": 102,
        "name": "Keyboard",
        "price": 50.0,
        "stock": 22,
        "icon": "product",
        "currencyCode": "EUR",
        "orderQuantity": 1,
        "description": "A physical keyboard that uses an individual spring and switch for each key. Today, only premium keyboards are built with key switches."
    },
    {
        "id": 103,
        "name": "Optical Mouse",
        "price": 35.0,
        "stock": 4,
        "icon": "product",
        "currencyCode": "EUR",
        "orderQuantity": 2,
        "description": "Utilizing the latest optical sensing technology, the USB Optical Scroll Mouse records precise motion."
    },
    {
        "id": 104,
        "name": "Laptop Pro",
        "price": 1299.0,
        "stock": 11,
        "icon": "laptop",
        "currencyCode": "EUR",
        "orderQuantity": 3,
        "description": "Newest laptop featuring a touch-sensitive OLED display."
    },
    {
        "id": 105,
        "name": "Mouse 2",
        "price": 40.0,
        "stock": 20,
        "icon": "product",
        "currencyCode": "EUR",
        "orderQuantity": 6,
        "description": "The Mouse 2 is a computer mouse featuring a multi-touch acrylic surface for scrolling. The mouse features a lithium-ion rechargeable battery and Lightning connector for charging and pairing."
    },
    {
        "id": 106,
        "name": "Printer",
        "price": 235.0,
        "stock": 24,
        "icon": "fx",
        "currencyCode": "EUR",
        "orderQuantity": 1,
        "description": "Affordable printer providing you with the optimal way to take care of all your printing needs."
    },
    {
        "id": 107,
        "name": "Phone 11",
        "price": 835.0,
        "stock": 45,
        "icon": "iphone",
        "currencyCode": "EUR",
        "orderQuantity": 8,
        "description": "The Phone 11 dimensions are 150.9mm x 75.7mm x 8.3mm (H x W x D). It weighs about 194 grams (6.84 ounces)."
    },
    {
        "id": 108,
        "name": "Phone 3a",
        "price": 299.0,
        "stock": 54,
        "icon": "desktop-mobile",
        "currencyCode": "EUR",
        "orderQuantity": 7,
        "description": "At 5.6 inches, the display is proportionate to the relatively small body of the phone."
    },
    {
        "id": 109,
        "name": "Game Console 4",
        "price": 330.0,
        "stock": 94,
        "icon": "video",
        "currencyCode": "EUR",
        "orderQuantity": 1,
        "description": "This is the fourth home video game console compatible with all gaming systems."
    },
    {
        "id": 110,
        "name": "Monitor",
        "price": 630.0,
        "stock": 20,
        "icon": "sys-monitor",
        "currencyCode": "EUR",
        "orderQuantity": 3,
        "description": "34'' Monitor, Display with stand Height adjustable (115 mm), tiltable (-5ยฐ to 21ยฐ), rotatable (-30ยฐ to 30ยฐ) Security slot (cable lock sold separately), anti-theft slot for locking to stand (for display). Includes: DisplayPort cable, HDMI cable, Power cable, Stand, USB 3.0 Type-A to Type-B cable, USB-C cable."
    }

]; ```

Step 2 Add Luigi to index.html
+
Step 3 Create micro-frontends template
+
Step 4 Configure webpack
+
Step 5 Configure Luigi for "Home" node
+
Step 6 Configure router for "Home" view
+
Step 7 Add "Products" view to Luigi app
+
Step 8 Add "Product Detail" view to Luigi app
+
Step 9 Install missing dependency
+
Step 10 Run your core app
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 10
1. Add a file with product data 2. Add Luigi to index.html 3. Create micro-frontends template 4. Configure webpack 5. Configure Luigi for "Home" node 6. Configure router for "Home" view 7. Add "Products" view to Luigi app 8. Add "Product Detail" view to Luigi app 9. Install missing dependency 10. Run your core app

Learn more →