Categories
Java maven Quarkus Vuejs

Build, run and deploy Vuejs app with Quarkus

Many services usually serve some web UI, whether it’s an admin tool, complete portal, or just a single HTML page. Vuejs is a perfect tool that can help you build single-page applications. Why not integrate it tightly with Quarkus?

This article covers:

  1. Setup node and dependencies required for Vuejs
  2. Init basic Vuejs project
  3. Configure Vuejs to serve from Quarkus
  4. Build and watch Vuejs project from maven
  5. Deploy minified Vuejs on maven package
Categories
graphql Java Quarkus

How to use GraphQL with Quarkus

GraphQL is both a language and a tool that can simplify your API and save some development hours to your project because you don’t need to create different endpoints for single data structure. With Quarkus, it can be done really easily with vertx extension.

Let’s start with a simple example. You have a simple service that returns project teams and users for them. You’ll need:

  1. Create endpoint to get all teams + create an endpoint to get a single team
  2. Create an endpoint that will give you all users of a team.
  3. Alternatively, you can use ORM to return teams with users in them as a one large result
  4. An endpoint that will only return teams with users, but users only have a name.

I included #4 because you might have some really large object(imagine that user has 200 fields, and you return thousands of them. And your clients only need their names to display in a search result.

If you’re looking for Microprofile GraphQL(the one with annotation support) please follow to official Quarkus guide.

Categories
graalvm Java Quarkus R

How to use R scripts with Quarkus

There’s a time when you need to call some R script from Quarkus. One option is to create microservice, but what if it’s something really small and you just want to call it in a single place without overwhelming project architecture. This is where GraalVM comes in. With GraalVm you can execute R scripts directly from Java without any conversion, microservices, or endpoints. We already have seen an example in Python, let’s see how to do it in R.

Categories
graalvm Java Python Quarkus

How to use Python with Quarkus and GraalVM

Quarkus is not just a backend framework. Rather, it’s a platform or ecosystem. With Quarkus you can write as JavaEE, as well as Spring applications, and even mix them, without thinking of underlying details.
We also must not forget that we can use GraalVM. GraalVM is a polyglot language and you can run Java, JavaScript, Python, R, C++ from each other without large overload. Calling code from different languages can be beneficial in terms of saving lots of hours, firstly of course because you don’t need to re-write code from one language to another, that can lead to potential bugs, and second thing is that you don’t need to rewrite anything from start.
So taking all that in mind, let’s see how you can freely re-use some of your Python code in Java

Categories
graalvm Java Quarkus

How to install GraalVM and native-image on Ubuntu

In this guide, you gonna see how easy it is to install GraalVM on Ubuntu Linux and start using awesome features like cross-language communication, faster JVM and more.