npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dodex-helidon-mp

v1.0.1

Published

A synchronous server for Dodex, Dodex-Input and Dodex-Mess

Downloads

2

Readme

dodex-helidon-MP

A synchronous server for Dodex, Dodex-Input and Dodex-Mess using the Helidon Virtual Threaded Java Framework.

Install Assumptions

  1. Java 21+ installed with JAVA_HOME set.
  2. Maven and Gradle 8.5.0 installed.
  3. Javascript node with npm package manager installed.
  4. Helidon cli client.

Install Dodex-Helidon-MP

Execute npm install dodex-helidon-mp or download from https://github.com/DaveO-Home/dodex-helidon-mp. If you use npm install, move node_modules/dodex-helidon to an appropriate directory.

Why Helidon MP

  • Helidon supports two frameworks, Helidon MP and Helidon SE. MP is an Java EE annotated microprofile configuration where as SE is a framework supporting reactive programming.
  • Java 21+ and frameworks using Virtual Threads(Helidon MP) may be performant using traditional synchronous programming versus non-blocking asynchronous code on modern computer chip architecture.
  • Microprofile compliant

Getting Started

Quick Getting Started (docker)

  1. cd .../dodex-helidon-mp/src/main/resources/WEB/static and execute npm install --save to install the dodex modules.
  2. In .../dodex-helidon-mp Execute docker build -t dodex-helidon:latest .
  3. Execute docker run -d -p 8060:8060 --name dodex_helidon dodex-helidon:latest
  4. View in browser; localhost:8060/test/index.html or localhost:8060/test/bootstrap.html
  5. To verify that the image is working, execute docker exec -ti --tty dodex_helidon /bin/sh
  6. To keep and run later, execute docker stop dodex_helidon and later docker start dodex_helidon
  7. To cleanup execute docker stop dodex_helidon and docker rm dodex_helidon and docker rmi dodex-helidon
  8. To verify cleanup execute docker imiages, execute docker rmi <image id> to remove unwanted images.
    Note: Assumes that dodex-helidon-mp is setup to use the "h2" database, the default.

Building dodex-helidon-mp

  1. cd .../dodex-helidon-mp/src/main/resources/WEB/static and execute npm install --save to install the dodex modules.
  2. To build for development use the helidon client as it supports live-reload. Execute helidon dev, uses pom.xml.
  3. The other build method is; cd .../dodex-helidon-mp and execute gradlew run. This should also install java dependencies and startup the server against the default h2 database.
  4. Execute url http://localhost:8060/test/index.html in a browser.
  5. You can also run http://localhost:8060/test/bootstrap.html for a bootstrap example.
  6. Follow instructions for dodex at https://www.npmjs.com/package/dodex-mess and https://www.npmjs.com/package/dodex-input.

Operation

  1. The Dodex-Helidon backend uses Hibernate/HikariCP to persist data.
  2. The application is configured to use a Websocket-Endpoint and OpenAPI endpoints to communicate with frontend HTML/javascript.
  3. Multiple databases are supported, to configure see;
    • .../src/main/resources/META-INF/microprofile-config.properties for connection properties.
    • .../src/main/resources/META-INF/persistence.xml for J2EE/JTA persistence units.
    • .../src/main/java/dmo/fs/db/fac/DbConfiguration.java to change which database to use (String pu = "h2dev").
  4. Once the connection properties are configured, the pu variable in DbConfiguration.java can be changed with one of the following:
    • h2dev or h2prod
    • postgresdev or postgresprd
    • mariadbdev or mariadbprod
    • oracledev or oracleprod
    • mssqldev or mssqlprod
    • ibmdb2dev or ibmdb2prod
  5. Building the Production Jar with supporting libraries using Maven.
    • Before building the Jar for production.
      • Make sure dodex is installed at ./src/main/resources/WEB/static by running npm install.
      • Also consider setting up a production database.
    • Execute mvn package to generate the production jar(dodex-helidon-mp.jar) in ./target and ./target/libs.
    • Execute java -jar target/dodex-helidon-mp.jar to startup the production server.
  6. Building the Production Jar with supporting libraries using Gradle.
    • Execute ./gradlew clean build to generate the production jar(dodex-helidon-mp.jar) in ./build/libs`.
    • Execute java -jar build/libs/dodex-helidon-mp.jar to startup the production server.
  7. Execute url http://localhost:8060/test/index.html or .../test/bootstrap.html in a browser.

Java Linting with PMD

Note: PMD is not ready for Java-21 - "ClassNotFoundException: net.sourceforge.pmd.ant.PMDTask". However, all of the PMD 7 deprecations have been fixed in dodexstart.xml.

  • Run gradlew pmdMain and gradlew pmdTest to verify code using a subset of PMD rules in dodexstart.xml
  • Reports can be found in build/reports/pmd

Test Dodex

  1. Make sure the demo dodex-helidon-mp server is running in development mode.
  2. Test Dodex-mess by entering the URL localhost:8060/test/index.html in a browser.
  3. Ctrl+Double-Click a dial or bottom card to popup the messaging client.
  4. To test the messaging, open up the URL in a different browser and make a connection by Ctrl+Double-Clicking the bottom card. Make sure you create a handle.
  5. Enter a message and click send to test.
  6. For dodex-input Double-Click a dial or bottom card to popup the input dialog. Allows for uploading, editing and removal of private content. Content in JSON can be defined as arrays to make HTML more readable.
  7. Standalone Dodex can be used as a normal rolodex as well as a menu launcher(localhost:8060/test/bootstrap.html).

Dodex Groups using OpenAPI

  • A default javascript client is included in .../dodex-helidon-mp/src/main/resources/WEB/static/group/. It can be regenerated in .../dodex-helidon-mp/src/openapi/client/ by executing npm run group:prod.
  • The group javascript client is in .../src/grpc/client/js/dodex/groups.js and group.js.
    Note: The client is included in the application by default.
  • See .../src/main/resources/META-INF/openapi.yaml for OpenAPI declarations. You can view and test the configuration for development at http://localhost:8060/openapi/ui/index.html. If there is an error, explore with /openapi/.
  • The implementation uses a REST api in the GroupResource class.

Installing in Dodex (already included in demo)

  1. Implementing in a javascript module; see .../dodex-helidon-mp/handicap/src/grpc/client/js/dodex/index.js
    • import { groupListener } from "./groups";
    • in the dodex init configuration, add
      ...
      .then(function () {
           groupListener();
      ...
  2. Implementing with inline html; see .../dodex-helidon-mp/main/resources/WEB/static/test/index.html
    • <script src="../group/main.min.js"></script>
    • in the dodex init configuration, add
      ...
      .then(function () {
           window.groupListener();
      ...
  3. Using dodex-messaging group functionality
    Note: Grouping is only used to limit the list of "handles" when sending private messages.
    • Adding a group using @group+<name>
      • select Private Message from the more button dropdown to get the list of handles.
      • enter @group+<name> for example @group+aces
      • select the handles to include and click "Send". Members can be added at any subsequent time.
    • Removing a group using @group-<name>
      • enter @group-<name> for example @group-aces and click "Send". Click the confirmation popup to complete.
    • Removing a member
      • enter @group-<name> for example @group-aces
      • select a "handle" from the dropdown list and click "Send"
    • Selecting a group using @group=<name>
      • enter @group=<name> for example @group=aces and click "Send"
      • Select from reduced set of "handles" to send private message.

By default the entry "dodex.groups.checkForOwner" in microprofile-config.properties is set to false. This means that any "handle" can delete a "group" or "member". Setting the entry to true prevents global administration, however, if the owner "handle" changes, group administration is lost.

The grouping function also implements Basic HTTP Security, see application.yaml. The basic security is enabled by setting security.jersey.enabled to true. A user logging in with the admin role can manipulate any group.

A Logout button on the demo dodex pages .../test/index.html and .../test/bootstrap.html is provided to change the basic login. It may require a cntl alt f5 and browser restart to work.

ChangeLog

https://github.com/DaveO-Home/dodex-helidon-mp/blob/master/CHANGELOG.md

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details