Home Server

Server

APK_SERVER_URL=http://192.168.0.103:5000

No auth token is currently set — omit the Authorization header.

Naming convention: Web apps use lowercase-hyphens (e.g. weather, budget-tracker). APKs use PascalCase (e.g. MarketAnalyst, BudgetTracker). Don't mix them up.

Web App Deployment

When asked to "deploy" or "serve" a web app (React, Vue, static site, etc.):

Steps

  1. Build the app (if it has a build step):
    • Run npm run build (or yarn build, pnpm build)
    • The output is typically in dist/ or build/

    No build tool? (plain HTML/CSS/JS) — skip this step and zip the source files directly.

    The server automatically injects a <base> tag so asset paths work under /apps/<name>/. No need to configure base in vite or homepage in package.json.

  2. Zip the build output:
    python3 -c "import shutil; shutil.make_archive('app', 'zip', 'dist')"

    On Windows without Python: powershell -c "Compress-Archive -Path 'dist/*' -DestinationPath app.zip"

    On Linux/macOS with zip: cd dist && zip -r ../app.zip . && cd ..

    The zip must contain index.html at the root (or in a single subdirectory).

  3. Upload:
    curl -F "file=@app.zip" \
         -F "app=<appname>" \
         -F "notes=<short description>" \
         "${APK_SERVER_URL}/api/webapps/upload"
  4. Report the result:
    • Print the app URL: ${APK_SERVER_URL}/apps/<appname>/
    • Print the dashboard: ${APK_SERVER_URL}

Rules


APK Build & Serve

When asked to "build and serve the APK":

Steps

  1. Build the APK:
    • Android/Gradle: ./gradlew assembleDebug
    • Flutter: flutter build apk --debug
    • React Native: cd android && ./gradlew assembleDebug
    • Always build debug — automatically signed with the debug keystore
    • The APK is typically at app/build/outputs/apk/debug/app-debug.apk
  2. Upload:
    curl -F "file=@<path-to-apk>" \
         -F "app=<AppName>" \
         -F "version=<version>" \
         -F "notes=<short description of what changed>" \
         "${APK_SERVER_URL}/api/upload"
  3. Report the result:
    • Print the download URL: ${APK_SERVER_URL}/apks/<AppName>/<version>/<filename>.apk
    • Print the dashboard: ${APK_SERVER_URL}

Rules