Open-source project
DeadWaveWave/demo2apk avatar
DeadWaveWave/demo2apk

Demo2APK: Package HTML and React Projects as Android APKs

Turn your Vibe Coding ideas into runnable Android Apps instantly

632 stars66 forksTypeScriptLicense varies

At a glance

What is it?
Demo2APK is a self-hostable build service that takes an HTML file, a React/Vite project ZIP, or pasted code and produces a signed, installable Android APK in minutes, with a web UI, a REST API, and Docker deployment.
Who is it for?
Demo2APK is a practical tool for developers who generate web app prototypes with AI tools and want to test them on Android without setting up a native build environment. It is not a replacement for a proper Android application: the output wraps a web app in a WebView, and React projects targeting older Android versions require the Vite legacy plugin to avoid blank screens.
Can I use it commercially?
Not without permission. GitHub finds no licence file in the repository, and without a licence all rights are reserved by default: you may read the code but not reuse it. Check the README, or ask the authors, before using it.
Is it still maintained?
Activity is slowing. The repository last received commits 6 months ago.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 17, 2026, and from our analysis. They are not legal advice.

Editorial analysis

The Problem Demo2APK Solves

AI coding tools like Gemini, ChatGPT, and DeepSeek generate working web application demos. Testing those demos on an Android device normally requires setting up Android Studio, configuring a build environment, wrapping the web code in a WebView, and signing the APK. For a quick prototype test, that overhead is disproportionate.

Demo2APK reduces that process to an upload. The developer provides the web code, and the service returns a signed, installable APK. No Android development environment is required on the developer's machine. The README describes the target user as a Vibe Coding user: someone who generates demos with AI tools and wants to get them onto a physical device without managing a native build pipeline.

The service is available as a free hosted instance at demo2apk.lasuo.ai with a limit of five builds per IP per hour and no registration required. The repository also supports self-hosting through Docker, which is the relevant path for teams that need higher limits, custom permissions, or data privacy. The smart queue system handles concurrent builds and shows real-time progress, so multiple developers sharing one self-hosted instance can submit builds without coordination overhead.

Supported Input Modes

Demo2APK accepts web code in three modes.

Single File Mode handles `.html`, `.js`, `.jsx`, `.ts`, and `.tsx` files. React components are detected automatically.

Paste Code Mode accepts raw code pasted directly into the web UI, with automatic recognition of HTML, React, and JavaScript content.

ZIP Archive Mode supports two project types: standard React/Vite projects (which go through an npm build step) and multi-file HTML projects (which require no build step). The service detects the project type automatically based on the archive contents.

For all three modes, the service applies offline optimization: CDN resources are handled and JSX compilation is run to ensure the app functions without an internet connection on the device. The README calls this Smart Offline.

The web UI supports customization at upload time: the app name, version number (for example, 1.0.0), and icon can all be set before the build starts. Android permissions are also configurable through the UI, defaulting to INTERNET only. Selecting the exact permissions your app needs rather than accepting a broad set is a sensible default for prototypes being installed on personal devices.

Build history is saved automatically in the UI session and survives page refresh through session restoration. Completed builds produce a shareable download link immediately.

Deploying Demo2APK with Docker

The recommended self-hosted deployment uses Docker on a Linux amd64 server. The three steps are: create a directory, download the compose file, and start the services.

bash
mkdir -p ~/demo2apk && cd ~/demo2apk
curl -O https://raw.githubusercontent.com/DeadWaveWave/demo2apk/main/docker-compose.deploy.yml

An optional environment configuration step:

bash
curl -O https://raw.githubusercontent.com/DeadWaveWave/demo2apk/main/.env.deploy.example
mv .env.deploy.example .env

Then start the services:

bash
docker compose -f docker-compose.deploy.yml up -d

The web UI is available at `http://127.0.0.1:5173`. To update to the latest version:

bash
docker compose -f docker-compose.deploy.yml pull && docker compose -f docker-compose.deploy.yml up -d

The README notes that Docker images support only `linux/amd64`. macOS users must use the local development path instead. The local development path requires pnpm 9 and Node 20. It starts Redis via Docker and runs three separate processes in separate terminal windows: `pnpm dev` for the API server on port 3000, `pnpm worker` for the build worker, and `pnpm frontend` for the web UI on port 5173. All three must be running for builds to complete.

Using the REST API for Automated Builds

Demo2APK exposes a REST API for integrating builds into scripts or CI pipelines without using the web UI.

Building from a single HTML file:

bash
curl -X POST http://localhost:3000/api/build/html \
  -F "[email protected]" \
  -F "appName=TestDemo"

Building from a React project ZIP:

bash
curl -X POST http://localhost:3000/api/build/zip \
  -F "[email protected]" \
  -F "appName=TestReactApp"

The API also supports submitting code directly:

bash
curl -X POST http://localhost:3000/api/build/code \
  -F "code=<export default function App() { return <h1>Hello</h1> }" \
  -F "appName=MyReactApp"

The API documentation is at `docs/API.md`. The rate limiter is enabled by default at five requests per hour per IP and can be disabled in development with `RATE_LIMIT_ENABLED=false`.

Configuration: Rate Limits, File Retention, and Concurrency

The service's key configuration variables live in `.env`. For file retention:

bash
FILE_RETENTION_HOURS=2
CLEANUP_BUILD_ARTIFACTS=true
CLEANUP_UPLOADS_ON_COMPLETE=true
FILE_CLEANUP_ENABLED=true
FILE_CLEANUP_INTERVAL_MINUTES=30

Generated APKs and temp files are deleted after two hours by default. A background worker scans every 30 minutes. This behavior is configurable but defaults to on, which limits storage consumption on shared instances.

Concurrent builds:

bash
WORKER_CONCURRENCY=2

The default is two concurrent builds. Excess builds queue automatically. The real-time queue position and progress are visible in the web UI.

An optional PWA export is available when `PWA_ENABLED=true`; the `PWA_HOST_SUFFIX` variable controls the URL pattern for exported PWA sites, and `PWA_RETENTION_HOURS` sets how long exported PWA sites are kept (defaults to `FILE_RETENTION_HOURS` if not set).

The server ports for the three processes are also configurable: `FRONTEND_PORT` defaults to 5173, `API_PORT` to 3000, and `REDIS_PORT` to 6379. The Redis URL can be changed with `REDIS_URL`, which is useful when pointing at an existing Redis instance instead of the bundled one.

The React Blank Screen Problem

React/Vite projects that target modern browsers may produce a blank screen when loaded in an Android WebView, because older WebViews do not support modern JavaScript features. The README documents the fix clearly.

First, install the legacy plugin:

bash
npm install -D @vitejs/plugin-legacy terser

Then add it to the Vite config:

javascript
import legacy from '@vitejs/plugin-legacy'

export default defineConfig({
  plugins: [
    react(),
    legacy({ targets: ['chrome >= 52', 'android >= 5'] })
  ],
  base: './'
})

The `base: './'` setting is required for APK builds. Without it, asset paths will break when the app runs from the WebView's local file context. The README points to `docs/REACT_PROJECT_REQUIREMENTS.md` for the complete troubleshooting guide. This blank-screen issue affects React projects generally in WebView contexts and is not specific to Demo2APK.

Limitations and What Demo2APK Does Not Do

Demo2APK wraps web applications in an Android WebView. The output is not a native Android app and does not have access to native Android APIs beyond what the WebView and the configured Android permissions provide. The web UI allows selecting permissions, defaulting to INTERNET only, but there is no bridge to native APIs like sensors, Bluetooth, or the camera.

The Docker images support only `linux/amd64`. There are no ARM images and no native macOS build pipeline. Teams on Apple Silicon servers cannot use the Docker deployment path.

Apkinizer and similar services such as AppsGeyser offer hosted HTML-to-APK conversion without self-hosting. Demo2APK's advantage is self-hosting capability with Docker and a documented API. The difference is control: Demo2APK allows configuring rate limits, storage, and permissions without depending on a third-party service.

The pnpm monorepo has three packages: `@demo2apk/frontend` (the React/Vite web UI), `@demo2apk/backend` (the API server and build worker), and `@demo2apk/core` (shared utilities including the offline optimization logic). The core package has its own test suite, and end-to-end tests run through `scripts/test-e2e.sh`. Teams that want to modify the build pipeline can fork the repository and change the core package without touching the frontend or API layers.

The last push to this repository was on 2026-03-20. The package.json shows version 2.3.0. The repository has no license file.

Editorial conclusion

Demo2APK is a practical tool for developers who generate web app prototypes with AI tools and want to test them on Android without setting up a native build environment. It is not a replacement for a proper Android application: the output wraps a web app in a WebView, and React projects targeting older Android versions require the Vite legacy plugin to avoid blank screens. The last push to this repository was on 2026-03-20; verify that the project is still maintained and that its Docker images remain accessible before building a team workflow around it.

Frequently asked questions

How do I create an APK file from an HTML project with Demo2APK?

Upload your HTML file through the web UI at demo2apk.lasuo.ai or via the REST API at /api/build/html. Set the app name and optionally the version and icon. The service returns a download link for the signed APK within minutes.

Why does my React app show a blank screen after being packaged as an APK?

Older Android WebViews do not support modern JavaScript. Install @vitejs/plugin-legacy and terser, add the legacy plugin targeting chrome >= 52 and android >= 5, and set base: './' in your Vite config. The README covers this in detail in docs/REACT_PROJECT_REQUIREMENTS.md.

Can Demo2APK run on macOS or ARM servers?

The Docker images support only linux/amd64. macOS and ARM users must use the local development path, which runs three processes: the API server on port 3000, the build worker, and the web UI on port 5173.

Official sources

  1. DeadWaveWave/demo2apk on GitHub
  2. Issues
  3. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/deadwavewave-demo2apk.svg)](https://hysenlabs.com/projects/deadwavewave-demo2apk)