tauri-cpp
This is an example of a fullstack app set for Desktop and Android with a C/C++ shared library using Tauri.
George-Madeley
main
public
George-Madeley
main
public
This is an example of a fullstack app set for Desktop and Android with a C/C++ shared library using Tauri.
The frontend of the App is a React Router CSR (Client-side rendered) TypeScript app. This is a launched by a Rust backend using Tauri. Rust also compiles a C/C++ shared library using CMake and links it to the resulting executable/app. Communication between the TypeScript frontend and the Rust backend uses Tauri's invoke mechanism.
This examples shows that you can make a fullstack TypeScript and C/C++ app for desktop and Android without dealing with the JNI or setting up a communication server (i.e., REST and/or gRPC).
Before you can start building, please ensure you have an instance of Node.js for build the frontend. Then, simply run yarn in the root directory to install all of the dependencies.
Next, you will need to following the Tauri installation instruction to get set up to build the Rust backend.
To build the C/C++ library, you will need CMake and a compiler of your choosing. In link the library to the Rust executable/app, we need to generate the Rust bindings for the C/C++, this requires the Rust crate bindgen which requires libclang to preprocess, parse, and type check C and C++ header files. Installation instructions can be found on the bindgen website.
To build for desktop applications, run:
yarn tauri buildFor android, you will need to first following the installation instructions to get setup with Android Studio. You will also need to add C:\Program Files\Android\Android Studio\jbr\bin to your path to be able to access keytool.exe to generate the APK signing keys.
Before building, we will need to generate the app signing keys. To do this, please follow the Tauri instructions to generate the signing keys. The signing process will be completed as part of the build.
Finally, you can build the android app with:
yarn tauri android buildThis is an example of a fullstack app set for Desktop and Android with a C/C++ shared library using Tauri.
1
7
0
1