# Run Blueprint-generated Microservices and Micro Frontends in Dev Mode
This tutorial guides you through running an Entando project with microservices and micro frontends in a local development environment. It is specific to a project generated with the Entando JHipster Blueprint, converted to a docker-based bundle.
# Prerequisites
- Generate Microservices and Micro Frontends tutorial
- Verify dependencies with the Entando CLI:
ent check-env develop
# Start Keycloak and Microservice
The following steps utilize the ent bundle CLI.
- From the project root directory, start up Keycloak. This uses Docker Compose to run Keycloak in the background until you end the process with
ent bundle svc stop keycloak
. You can view the logs withent bundle svc logs keycloak
.
ent bundle svc start keycloak
- Start up the Spring Boot application
conference-ms
. The logs will display in the console and you can stop the application withCtrl+C
. Keep the microservice running while the MFEs are run.
ent bundle run conference-ms
To check that the MS is working, go to http://localhost:8081/
. In local development, the run command can be used to modify the port number so multiple microservices can run parallel on different ports, but in production, microservices must run on port 8081.
- If you want to reset the conference-ms data, and you selected "H2 with disk-based persistence" during microservice generation, you can delete the target folder, restart the microservice, and the data will be regenerated.
- The
serviceUrl
variable is the microservice API URL.
# Start the Micro Frontends
# Run the conference-table MFE
- From another shell, start the conference-table micro frontend from the project root directory. This command runs React in development mode, so any changes you make to the source files should be immediately seen in the browser.
ent bundle run conference-table
If you are not logged in, you'll be redirected to do so. Log in using the following credentials.
- Username: user
- Password: user
Once logged in, you will see the table widget with generated sample data.
# Run the conference-form MFE
If you are still running the previous micro frontend, click
Ctrl+C
to end the processStart up the conference-form MFE
ent bundle run conference-form
The form to enter the name and location for conferences should open in your browser. You may enter and save new data to see it in the other MFEs.
If you want to modify a different row in the database, edit the
microfrontends/conference-form/public/index.html
file. Change theid
attribute in this line:
<conference-form id="1" />
# Run the conference-details MFE
If you are running the previous micro frontend, click
Ctrl+C
to end the processStart the conference-details MFE
ent bundle run conference-details
When the run is complete, you should see the details MFE showing the information for the Conference with ID 1.
If you want to modify a different row in the database, edit
microfrontends/conference-details/public/index.html
file. Change theid
attribute in this line:
<conference-details id="1" />
# Keycloak Settings and Issues
Change Development Settings
If you want to use another Keycloak installation, modify the reference in the Keycloak YAML file located in the
svc/
folder.In this blueprint-generated project, Docker Compose persists Keycloak data across restarts by default. If you want your data to reset on restarts:
- Edit the
svc/keycloak.yml
file.
Replace'-Dkeycloak.migration.strategy=IGNORE_EXISTING',
with the following:
'-Dkeycloak.migration.strategy=OVERWRITE_EXISTING',
- In the same file, remove this persistent volume statement under
volumes
:
- ./keycloak-db:/opt/jboss/keycloak/standalone/data
- Keycloak should now reset every time you restart.
- Edit the
Error
User is not authenticated
: If you see this message after starting the MFEs, it is likely that your Keycloak application is not running or the.env.local
file is not configured properly. Check if Keycloak is running; otherwise, update the configuration inmicroservice/conference-x/.env.local
.