https://github.com/hapticx/happyx-native
Macro-oriented web-framework compiles to native written with ♥
https://github.com/hapticx/happyx-native
app-framework frontend happyx native-apps nim web-native webnative
Last synced: 7 months ago
JSON representation
Macro-oriented web-framework compiles to native written with ♥
- Host: GitHub
- URL: https://github.com/hapticx/happyx-native
- Owner: HapticX
- License: mit
- Created: 2023-12-12T05:29:08.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-12-31T13:08:04.000Z (about 1 year ago)
- Last Synced: 2025-06-28T18:43:49.886Z (8 months ago)
- Topics: app-framework, frontend, happyx, native-apps, nim, web-native, webnative
- Language: Nim
- Homepage: https://hapticx.github.io/happyx-native/happyx_native.html
- Size: 535 KB
- Stars: 25
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HappyX Native
### macro-oriented web-framework compiles to native
[](https://hapticx.github.io/happyx-native/happyx_native.html)
## Install
```shell
nimble install happyx-native
```
or via GitHub:
```shell
nimble install https://github.com/HapticX/happyx-native
```
## Features
- Support for Chrome/Yandex/Edge browsers & Webview
- Support for Android
## Project Initialization
To init project you should use this command:
```shell
hpx-native init --name ProjectName
```
This command will automatically initialize your project.
It also fetches `ANDROID_SDK_ROOT` from environment (need for android compilation).
## Building
To build your project you should move into project folder
```shell
cd ProjectName
```
and just build it!
```shell
hpx-native build
```
This automatically builds your project for your OS as target platform.
### Cross-Compilation
To compile for other OS use
```shell
hpx-native build --target linux
```
Possible values:
| OS | value | aliases |
| :-- | :--: | :--: |
| Windows | windows | win |
| Linux | linux | unix |
| MacOS | macosx | mac, macos |
| Android | android | - |
### Android compilation
You should have:
- Android Studio with SDK and NDK;
- Gradle >= 7.5;
- Nim >= 2.0.0;
By default `hpx-native build --target android` supports all android architectures.
If you want to disable some architectures then use:
```shell
hpx-native build --target android --no-x86_64
```
Possible architectures
| Architecture | Disable Argument |
| :-- | :--: |
| x86 | `--no-x86` |
| x86_64 | `--no-x86_64` |
| armeabi-v7a | `--no-armeabi-v7a` |
| arm64-v8a | `--no-arm64-v8a` |
If you doesn't want to use gradle building then use
```shell
hpx-native build --target android --no-gradle
```
This command will build only `.so` libraries.
### Building Assets
HappyX Native supports "building" assets - all resources from app directory (by default `/assets`) and all subdirectories are "sewn" into executable file.
This way you can distribute your application over the network with only one executable file.
> This option can be disabled via `--no-build-assets`
### Webview Notes
When building with `-d:webview`, on Windows, you may notice that the window icon is not set
for you. This is due to a limitation within Happyx Native, that will be resolved in the
future. Currently, you may manually link in your desired window icon, like how is done in
.
In addition, Webview does not currently support window positioning
(see ), so the `x` and `y` arguments passed to
`nativeApp` will be ignored.
## Browsers
If you want choose other browser instead of default - use these flags:
| browser | flag |
| :-----: | :-------------: |
| Default browser | uses by default |
| Chrome | `-d:chrome` |
| Edge | `-d:edge` |
| Yandex | `-d:yandex` |
| Webview | `-d:webview` |