Skip to content

amnxd/aether

Repository files navigation

Aether

Minimal Flutter app named Aether with a Discord-inspired dark theme.

Run:

flutter pub get
flutter run

Web App + Domain Hosting

This repository can be shipped as a Flutter Web app.

  1. Build for web with your backend URL baked in:
flutter build web --release --dart-define=AETHER_BASE_URL=https://YOUR_BACKEND_HOST
  1. Deploy the generated static files from build/web/ to your host (Cloudflare Pages, Vercel, Netlify, Nginx, Apache, etc.).

  2. Configure SPA fallback so all routes return index.html.

  3. Point your domain DNS to the hosting provider and enable HTTPS.

Notes:

  • The source folder web/ is project configuration; deploy build/web/.
  • If your backend is on a different domain, ensure CORS allows your web domain.
  • For local testing:
flutter run -d chrome --dart-define=AETHER_BASE_URL=http://localhost:8080

Recommended Host (Free + Fast + Reliable)

Best default choice: Cloudflare Pages.

Why this is the strongest default for your case:

  • Free tier is generous for static hosting.
  • Very fast global CDN and edge caching.
  • Strong security baseline (TLS, WAF options, DDoS protection).
  • Reliable DNS + hosting in one place if your domain is on Cloudflare.

Quick setup:

  1. Push this repo to GitHub.
  2. Build locally:
flutter build web --release --dart-define=AETHER_BASE_URL=https://YOUR_BACKEND_HOST
  1. In Cloudflare Dashboard, create a Pages project using Direct Upload.
  2. Upload the generated build/web directory.
  3. Add your custom domain in Pages.
  4. Set backend CORS allowlist to your domain.

Notes:

  • web/_redirects is included for SPA route fallback.
  • web/_headers is included for baseline security headers.

Backend CORS allowlist (required for production):

  • Set backend env AETHER_ALLOWED_ORIGINS to a comma-separated list of exact origins.
  • Example:
AETHER_ALLOWED_ORIGINS=https://chat.example.com,https://www.chat.example.com
  • If unset, backend falls back to localhost-only origins for development.

Google Drive backups (Android)

If Google Drive backup/restore shows PlatformException(sign_in_failed, 10: ...), Google Sign-In is not configured for the current Android app id/signing key.

  • Ensure the Android package name matches android/app/build.gradle.kts (applicationId).
  • In Firebase Console (Project Settings → Your apps → Android), add your SHA-1 (and SHA-256) certificate fingerprints.
  • Enable Google Sign-In for the project (Firebase Authentication → Sign-in method → Google).
  • Download the updated google-services.json and replace android/app/google-services.json.
  • Rebuild the app.

To print the debug SHA-1 on Windows:

keytool -list -v -alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore -storepass android -keypass android | findstr /C:"SHA1"

Android release signing (GitHub Releases)

For stable GitHub Release APKs (and stable Google Sign-In), configure a real release keystore.

Prereq: Java/JDK 17 (needed for Gradle + keytool). On Windows you can install it with:

winget install -e --id EclipseAdoptium.Temurin.17.JDK
  1. Create a keystore (run from the repo root):
keytool -genkeypair -v -keystore android/aether-release.jks -alias aether -keyalg RSA -keysize 2048 -validity 10000
  1. Create android/key.properties (do not commit it). Start from:
  • android/key.properties.example
  1. Add the keystore SHA-1 to Firebase (Project settings → Android app → SHA certificate fingerprints):
keytool -list -v -keystore android/aether-release.jks -alias aether | findstr /C:"SHA1"
  1. Re-download android/app/google-services.json from Firebase and rebuild.

Build the release APK:

flutter clean && flutter pub get && flutter build apk --release

Backend URL (important for APKs)

The app talks to the Rust backend in backend_rust/ via HTTP + WebSocket.

Cloud: use your deployed HTTPS URL (example: https://aether-swix.onrender.com)

If you're running via Docker Compose, the backend is published on a random free host port (so it won't collide with whatever is already using 8080).

Find the chosen port with:

docker compose port backend 8080

Then use that port in the app, e.g. Android emulator: http://10.0.2.2:<PORT>.

If you're running the Rust backend directly (e.g. cargo run in backend_rust/), it defaults to port 8080 (override via PORT).

You can bake the backend URL into the build with --dart-define:

flutter build apk --release --dart-define=AETHER_BASE_URL=https://YOUR_BACKEND_HOST

The WebSocket URL is derived from the same base URL (ws:// or wss://).

Dev: wipe all chats/users (reset database)

This is destructive and intended for local development.

  • Option A (fastest): wipe the local Postgres Docker volume

    • docker compose down -v
    • docker compose up -d
  • Option B (no volume delete): call the backend admin wipe endpoint

    • Set ADMIN_RESET_TOKEN in your environment (docker-compose passes it through)
    • Find your backend port with docker compose port backend 8080
    • Then run: ./tool/reset_dev_db.ps1 -ViaEndpoint -BaseUrl http://localhost:<PORT> -IUnderstandThisWillDeleteEverything