The easiest way to start a Medusa instance is from scratch. If you have that luxury, you can just use our quickstart template. This is a very lightweight, minimal setup.
It contains two controllers. A simple hello world controller, and a fragment controller. The hello world shows a page with a counter that initializes at 0 and can increase with a button press.
It also embeds a fragment. The fragment shows the current time. The fragment's controller initializes with the current time, and has scheduling enabled to showcase bi-directionality.
A scheduled job, running every second, pushes a new date to you if you're on the hello-world page.
Using this template, you can get up and running instantly.
Assuming you do not have a greenfield project but an existing one, look to the steps below to add medusa.
Installation of a Medusa-based app is very easy. Simply set up a maven project with Reactive Spring from start.spring.io
You'd need a JDK21 project with a pom containing spring-boot-starter-thymeleaf and spring-boot-starter-webflux
Add Medusa via an additional Maven dependency:
See Maven Central
<dependency>
<groupId>io.getmedusa</groupId>
<artifactId>medusa-ui</artifactId>
<version>0.9.5</version>
</dependency>
And you're done. Your first step would be to create a Controller class and relevant page. Look at our samples in the showcase for ideas on where to start.
At this point, you have a bidirectional frontend app, but it does not yet work as a micro-frontend together with others. Once you start combining multiple apps together, consider Hydra.
Hydra works as a separate app that runs as a proxy in front of all your other frontend apps. Your URL would always point to your Hydra cluster.
This proxy will cluster together with all your Medusa apps through built-in service discovery. It will use the bidirectionality from Medusa to communicate live which apps are online and available.