Windows users: Use WSL (Windows Subsystem for Linux) for the build process. Native Windows builds are not supported.
Clone the Astara repository:
git clone https://github.com/DesolateSea/Astara_stellarium-web-engine.git astara
cd astaraClone the Emscripten SDK:
Note: Ensure it is installed in the
astararoot folder for the Docker method.
git clone https://github.com/emscripten-core/emsdk.gitEnsure Docker is installed and running:
sudo systemctl status docker
# If not running:
sudo systemctl start dockerNavigate to the web frontend directory:
cd apps/web-frontendRun the setup command. This will:
- Build the Docker image for Emscripten compilation.
- Compile the Stellarium Web Engine (WASM + JS) inside Docker.
- Build the Docker image for the Node.js environment.
- Install Node.js dependencies (using Yarn) inside Docker.
sudo -E make setupRun frontend on dev server:
sudo -E make devBuild the production frontend:
sudo -E make buildThe build artifacts will be in dist.
Set required environment variables:
export CAPACITOR_ANDROID_STUDIO_PATH=/path/to/android-studio/bin/studio.shexport JAVA_HOME=/path/to/java-21-openjdk
export PATH=$JAVA_HOME/bin:$PATHSync with Capacitor:
make sync-androidBuild the debug APK:
make build-apkThe APK will be located at:
android/app/build/outputs/apk/debug/app-debug.apk
Generate a keystore in the android directory (one-time setup):
cd android
keytool -genkey -v -keystore my-release-key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias my-key-aliasBuild the release APK:
./gradlew assembleReleaseSign the APK using apksigner:
Note:
apksigneris located in$ANDROID_HOME/build-tools/<version>/. Use the full path if it's not in your PATH.
macOS/Linux:
$ANDROID_HOME/build-tools/34.0.0/apksigner sign --ks my-release-key.jks --out app-release-signed.apk app/build/outputs/apk/release/app-release.apkWindows (PowerShell/CMD):
%LOCALAPPDATA%\Android\Sdk\build-tools\34.0.0\apksigner sign --ks my-release-key.jks --out app-release-signed.apk app\build\outputs\apk\release\app-release.apkVerify the signature:
macOS/Linux:
$ANDROID_HOME/build-tools/34.0.0/apksigner verify app-release-signed.apkWindows:
%LOCALAPPDATA%\Android\Sdk\build-tools\34.0.0\apksigner verify app-release-signed.apkIf you prefer to build web-frontend manually without Docker, follow these steps.
Manually install and activate the Emscripten SDK:
cd emsdk
./emsdk install latest
./emsdk activate latest # writes .emscripten file
source ./emsdk_env.sh # Active PATH and other environment variables in current terminalInstall additional versions required by Stellarium:
# Get a tip-of-tree
./emsdk install tot
# Install required emscripten version
./emsdk install 1.40.1
./emsdk activate 1.40.1
source ./emsdk_env.shNote: Stellarium Web Engine is sensitive to Emscripten versions. Version
1.40.1is known to work reliably.
Install scons (choose one):
sudo apt-get install scons # Debian / Ubuntu
sudo dnf install scons # Fedora
pip install scons # PythonActivate Emscripten:
source /path/to/emsdk/emsdk_env.shBuild the engine:
makeCopy the generated artifacts into the frontend:
cp build/stellarium-web-engine.* apps/web-frontend/src/assets/js/This produces:
stellarium-web-engine.jsstellarium-web-engine.wasm
cd apps/web-frontend
npm install --legacy-peer-depsWorkaround for OpenSSL compatibility:
export NODE_OPTIONS=--openssl-legacy-providerRun the dev server:
npm run devBuild the production frontend:
npm run build