Overview
You will learn
- How to create a skeleton React project
- How to create a skeleton UI5 project
- How to add Luigi and other dependencies to your project
Prerequisites
- It’s recommended to try the simpler examples on GitHub or the Getting Started page before this tutorial.
- Install Node.js 24.15.0 or newer in the Node.js 24 LTS line. This tutorial uses React 19, React Router 8 and UI5 Web Components React 2. Updating npm alone does not update Node.js.
- You need to install SAP Fonts.
Steps
Intro
In this tutorial, you will set up the two skeleton projects used throughout the Luigi tutorial series: a React project that hosts the Luigi Core application and a UI5 project for a micro-frontend. You will then add Luigi and the other required dependencies to both.
In this step, you will create a React skeleton project which will be used to create your Luigi app.
Open a Terminal or Command Prompt window and navigate to the space where you want to install the app. Then create a new folder:
Shellmkdir luigi-react-ui5 cd luigi-react-ui5Create a new folder to host the React core app:
Shellmkdir react-core-mf cd react-core-mfDownload the React example
package.jsonfrom the fixed Luigi revision below. KeepLUIGI_EXAMPLE_BASEset in this terminal for the subsequent downloads. Install the versions used by this tutorial rather than the latest packages:ShellLUIGI_EXAMPLE_BASE="https://raw.githubusercontent.com/SAP/luigi/e0dcf1ad945c3c31e90d61b45860dca47a3703d7/core/examples/luigi-example-react" curl --fail --location "$LUIGI_EXAMPLE_BASE/package.json" --output package.json npm install --save-exact @luigi-project/client@2.33.0 @luigi-project/core@2.33.0 fundamental-styles@0.42.0 @ui5/webcomponents-react@2.28.2 @ui5/webcomponents-fiori@2.28.1 npm install --save-dev --save-exact style-loader@4.0.0 css-loader@7.1.5 terser-webpack-plugin@5.6.1The downloaded manifest specifies React and React DOM 19.2.7 and
react-router8.3.0. Import router components fromreact-router, notreact-router-dom. Keep the generatedpackage-lock.jsonwith your project and usenpm cifor subsequent clean installations. The fixed revision also prevents changes on Luigi’smainbranch from changing the starting files. The React application will be bundled using Webpack. Download the Luigi Webpack configuration from an existing Luigi example app using the line below:
Shellcurl --fail --location "$LUIGI_EXAMPLE_BASE/webpack.config.js" --output webpack.config.jsNext, create the project structure for the React app. Create the following folders:
Shellmkdir -p src/views mkdir -p src/assets mkdir -p public
Download the Luigi React app files:
Shellcurl --fail --location "$LUIGI_EXAMPLE_BASE/public/luigi-config.js" --output public/luigi-config.js curl --fail --location "$LUIGI_EXAMPLE_BASE/src/index.js" --output src/index.js curl --fail --location "$LUIGI_EXAMPLE_BASE/src/views/home.js" --output src/views/home.js curl --fail --location "$LUIGI_EXAMPLE_BASE/src/views/sample1.js" --output src/views/sample1.js curl --fail --location "$LUIGI_EXAMPLE_BASE/src/views/sample1.js" --output src/views/sample2.js curl --fail --location "$LUIGI_EXAMPLE_BASE/public/index.html" --output public/index.html curl --fail --location "$LUIGI_EXAMPLE_BASE/public/sampleapp.html" --output public/sampleapp.htmlInstall and run the configuration:
npm i
npm run start
8. Stop the development server with Ctrl+C, then move back into the root directory:
cd ..In this step, you will create a skeleton UI5 project for your UI5 micro-frontend.
If you didn’t already, navigate to the root folder of your project in the terminal.
Install the UI5 project generator:
Shellnpm install -g yo generator-easy-ui5Enter this command in the Terminal/Command Prompt:
Shellyo easy-ui5 appAnswer the generator prompts as follows:
- Enter your application id (namespace)? Enter
luigi.ui5. This value matters: the later tutorial steps rely on it for the resource root (luigi.ui5) and controller names (for exampleluigi.ui5.controller.Main). - Which framework do you want to use? Choose the default (
OpenUI5) and press Enter. - For all remaining questions (framework version, author, etc.), choose the default option and press Enter.
- Enter your application id (namespace)? Enter
The generator creates the app in a folder named after the namespace (
luigi.ui5). To match the paths used in the following tutorials, rename this folder toui5-mf:Shellmv luigi.ui5 ui5-mf
Back: Introduction to Luigi ← | Next: Build Luigi App with React →
Resources
Discussion
Share feedback on this tutorial or join the conversation in SAP Community.