Yupiik Fusion is a modern, lightweight Java framework designed to quickly build efficient, modular, and maintainable applications with ease built on top of GraalVM. Leveraging powerful features like dependency injection, easy RESTful API creation, and seamless JSON-RPC support, Fusion streamlines development and boosts developer productivity.
-
✅ Simplicity: Minimum magic needed to make your development workflow smooth and nice.
-
✅ Modularity: Lightweight and modular architecture that lets you choose exactly what your application needs.
-
✅ Dependency Injection: Intuitive and reflectionless DI model that simplifies component management and improves maintainability.
-
✅ JSON-RPC & REST API: Effortlessly build JSON-RPC or REST APIs for modern web applications.
-
✅ CLI Application Support: Quickly create robust and maintainable Command-Line Interface (CLI) applications.
-
✅ Cloud-Native Ready: Ideal for containerized applications running in Kubernetes or cloud environments.
-
✅ Native: Built on top of GraalVM for easy native build.
-
✅ Efficient Resource Handling: Supports streaming and low memory usage for high-performance scenarios.
To quickly get started with Yupiik Fusion, add the core dependencies to your Maven project:
<dependencies>
<dependency>
<groupId>io.yupiik.fusion</groupId>
<artifactId>fusion-build-api</artifactId>
<version>${fusion.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.yupiik.fusion</groupId>
<artifactId>fusion-processor</artifactId>
<version>${fusion.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.yupiik.fusion</groupId>
<artifactId>fusion-api</artifactId>
<version>${fusion.version}</version>
</dependency>
</dependencies>
Add Json and HttpServer dependencies:
<dependency>
<groupId>io.yupiik.fusion</groupId>
<artifactId>fusion-json</artifactId>
<version>${fusion.version}</version>
</dependency>
<dependency>
<groupId>io.yupiik.fusion</groupId>
<artifactId>fusion-http-server</artifactId>
<version>${fusion.version}</version>
</dependency>
Create REST Endpoint:
import io.yupiik.fusion.framework.api.scope.ApplicationScoped;
import io.yupiik.fusion.framework.build.api.http.HttpMatcher;
import io.yupiik.fusion.http.server.api.HttpException;
import io.yupiik.fusion.http.server.api.Request;
import io.yupiik.fusion.http.server.api.Response;
import io.yupiik.fusion.json.JsonMapper;
@ApplicationScoped
public class ProductEndpoint {
private final ProductService productService;
private final JsonMapper jsonMapper;
public ProductEndpoint(final JsonMapper jsonMapper, final ProductService productService) {
this.jsonMapper = jsonMapper;
this.productService = productService;
}
@HttpMatcher(methods = "GET", path = "/product", pathMatching = HttpMatcher.PathMatching.EXACT)
public List<Product> findAllProduct(final Request request) {
return productService.findProducts();
}
@HttpMatcher(methods = "GET", path = "/product/", pathMatching = HttpMatcher.PathMatching.STARTS_WITH)
public Product findProduct(final Request request) {
final var id = request.path().split("/")[2];
return productService.findProduct(id);
}
@HttpMatcher(methods = "POST", path = "/order", pathMatching = HttpMatcher.PathMatching.EXACT)
public Response createOrder(final Request request, final Order order) { // custom response crafting
return Response.of()
.status(201)
.header("content-type", "application/json")
.body(jsonMapper.toString(orderService.createOrder(order)))
.build();
}
}
Easily create JSON-RPC APIs.
Add dependencies:
<dependency>
<groupId>io.yupiik.fusion</groupId>
<artifactId>fusion-json</artifactId>
<version>${fusion.version}</version>
</dependency>
<dependency>
<groupId>io.yupiik.fusion</groupId>
<artifactId>fusion-jsonrpc</artifactId>
<version>${fusion.version}</version>
</dependency>
import io.yupiik.fusion.framework.api.scope.ApplicationScoped;
import io.yupiik.fusion.framework.build.api.jsonrpc.JsonRpc;
import io.yupiik.fusion.http.server.api.Request;
import io.yupiik.fusion.json.JsonMapper;
import java.util.Map;
@ApplicationScoped
public class JsonRpcEndpoint {
private final ProductService productService;
public JsonRpcEndpoint(final ProductService productService) {
this.productService = productService;
}
@JsonRpc(value = "fusion.examples.product.findAll", documentation = "Fetch all product available")
public List<Product> findAllProduct(final Request request) {
return productService.findProducts();
}
@JsonRpc(value = "fusion.examples.product.findById", documentation = "Find a product by id")
public Product findProduct(final Request request, final String id) {
return productService.findProduct(id);
}
}
The full examples can be found on the GitHub project:
Fusion provide useful extensions:
Comprehensive documentation is available at:
We warmly welcome contributions!
-
Fork the repository
-
Submit your enhancements via pull requests
-
Create issues
-
Open discussions
Yupiik Fusion is released under the Apache License, Version 2.0. See the LICENSE file for more details.