Demo app built using Sans UI
This project demonstrates how to use the @profullstack/sans-ui module to create a simple counter button across multiple platforms:
- Web (Web Components and Svelte)
- Desktop (Windows, macOS, Linux)
- Mobile (iOS, Android)
- Counter button that increments by 1 when clicked
- Consistent UI across all platforms using Sans UI
- Native performance on desktop and mobile
# Install dependencies
pnpm installpnpm run test:webThis will start a simple HTTP server and open the Web Components demo in your default browser.
pnpm run dev:web-componentsThis will start a local server for the Web Components demo at http://localhost:3000.
pnpm run dev:svelteThis will start a local development server for the Svelte demo at http://localhost:5173.
To run the desktop demo, you'll need to install NodeGUI dependencies first:
# Install NodeGUI dependencies
pnpm add @nodegui/nodeguiThen you can run the desktop app:
pnpm run desktopTo run the mobile demo, you'll need to set up NativeScript first:
# Install NativeScript CLI globally
npm install -g nativescript
# Verify installation
ns doctorFollow the instructions from the ns doctor command to set up your environment for Android and/or iOS development.
Once your environment is set up, you can run the mobile app:
# Run on Android
pnpm run mobile:android
# Run on iOS (requires macOS)
pnpm run mobile:iosTo build the desktop app for distribution, follow these steps:
- Install NodeGUI and its dependencies:
cd desktop
npm install @nodegui/nodegui- For Windows:
# Install Windows build tools
npm install --global windows-build-tools
# Build the app
npm install electron-packager -g
electron-packager . --platform=win32- For macOS:
# Build the app
npm install electron-packager -g
electron-packager . --platform=darwin- For Linux:
# Build the app
npm install electron-packager -g
electron-packager . --platform=linuxTo build the mobile app for distribution, follow these steps:
-
Set up your development environment following the NativeScript docs:
-
For Android:
cd mobile
ns build android --release --key-store-path <path-to-keystore> --key-store-password <password> --key-store-alias <alias> --key-store-alias-password <password>- For iOS (requires macOS):
cd mobile
ns build ios --release --for-device --team-id <your-team-id>web-components/- Web Components implementationsvelte/- Svelte implementationdesktop/- Desktop implementation using NodeGUImobile/- Mobile implementation using NativeScript
All implementations use the @profullstack/sans-ui package to provide a consistent UI across platforms:
- Web implementations use the web components or Svelte components
- Desktop implementation uses NodeGUI/Qt
- Mobile implementation uses NativeScript
Each implementation provides the same functionality: a button that increments a counter by 1 when clicked, with the current count displayed above the button.
If you encounter issues with the NodeGUI dependencies, you may need to install additional system dependencies:
- Linux:
sudo apt-get install build-essential libglib2.0-dev - macOS:
xcode-select --install - Windows: Install Visual Studio with C++ build tools
For mobile build issues, refer to the NativeScript troubleshooting guide: https://docs.nativescript.org/troubleshooting.html