Skip to content

Conversation

@andrii-kulminskyi
Copy link
Contributor

@andrii-kulminskyi andrii-kulminskyi commented Oct 21, 2025

As a part of https://github.com/TeamDev-IP/Marketing/issues/803.

In this changeset, we added a demo desktop app with web-based UI on vue.js. This demo is part of the "Java desktop app with Shadcn UI" blog post. The app shows a dialog for preferences and saves them to the file system, so they are preserved after restarting. Here’s what it looks like:

example 1

The web app is located in the web-app directory. To set up communication between the web app and Java, we configured the Armeria gRPC server to run on localhost. The client (web app) connects to the server through gRPC web transport:

const transport = createGrpcWebTransport({
    baseUrl: `http://localhost:${rpcPort}`,
});

Loading web UI

The way we load the web UI depends on whether it's a development or production environment.

Dev mode

To load the web UI in dev mode, you should first start the dev server. In the root directory, run:

./gradlew :desktop-web-app-vue:startDevServer 

After that, run the application itself:

./gradlew :desktop-web-app-vue:run 

Prod mode

In the production mode, we used an approach based on custom schemes and the URL request interceptor. This way, all web resource requests are handled inside the app, so no one can intercept them and access the resources, which is essential for desktop apps.

At the same time, using a custom scheme ensures that regular HTTPS XHR requests, such as authentication, API calls, can come through.

@andrii-kulminskyi andrii-kulminskyi marked this pull request as draft October 21, 2025 10:53
@andrii-kulminskyi andrii-kulminskyi self-assigned this Oct 21, 2025
@andrii-kulminskyi andrii-kulminskyi changed the title Desktop web app vue Desktop web app with vue.js Oct 22, 2025
@andrii-kulminskyi andrii-kulminskyi marked this pull request as ready for review October 24, 2025 09:15
Copy link
Contributor

@ivan-diachenko-td ivan-diachenko-td left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And let's add line breaks at the end of the files.

Copy link
Contributor

@vlad-lubenskyi vlad-lubenskyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andrii-kulminskyi as discussed last week, let's avoid copy-pasting the Java backend and re-use it from the existing React application.

@TeamDev-IP TeamDev-IP deleted a comment from vladimir-ikryanov Oct 29, 2025
Copy link
Contributor

@vlad-lubenskyi vlad-lubenskyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're almost there. Let's finish this one today.

Copy link
Contributor

@ivan-diachenko-td ivan-diachenko-td left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with some minor comments

@@ -0,0 +1,19 @@
Copyright (c) 2025 TeamDev
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this file?

@andrii-kulminskyi andrii-kulminskyi merged commit 5cc64ae into master Nov 10, 2025
2 checks passed
@andrii-kulminskyi andrii-kulminskyi deleted the desktop-web-app-vue branch November 10, 2025 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants