Skip to content

Enablesoft-ERP-Consultancy-Pvt-Ltd/iExpro-Wayte

Repository files navigation

iExpro Wayte

design weight service design settings

Dependencies

Why rust and tauri?

Tauri and Rust were used for the application due to their combined strengths in building high-performance, secure, and cross-platform desktop applications. We can build our application for Windows, Mac and Linux

Tauri lets developers use web technoglogies to build frontend, which is extremely helpful since we can create beautiful and accessible designs and iterative over changes extremely fast.

Tauri lets developers use Rust to perform native functionality in an easy, safe and performant way.

Inter process communication

The application has two processes running

  • The Solidjs frontend
  • The Rust backend

Both processes communicate with each other using two different ways

  1. Commands
  2. Events

The application uses a combination of both of the them to communicate with serial ports.

Weight reader

Whenever the /protected/weight-service/ route is opened in the application. The frontend invokes a command in the backend (emit_weight_on_port) with the port and baud rate saved in the application settings store. The backend tries to open a connection with that port and baud rate

if it fails, it returns with the error back to the frontend.

if it succeeds,

  • Creates a var run of type Arc<Mutex<boolean>> in the function scope.
  • Creates a event listener (weight-close) which will set the above run var to false when invoked.
  • Also spawns a thread which reads data from the serial port and emit a event (weight-read) with the weight data with a delay of 300ms as long as run var is true.
  • Returns unit.

Then on the frontend we create a event listener which listens for weight-read events and updates the bell_weight field.

Build instructions

Make sure you have the following installed

In root directory first install the dependencies

pnpm install

then

to open the tauri application.

pnpm tauri dev

or to open only the web application

pnpm dev

or to build for production

pnpm tauri build

About

iExpro Wayte frontend application using Tauri

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published