Rewaya_HQ

Rewaya HQ

Executive operations hub & hygiene audit app for Rewaya Hotels. Built with Kotlin and Jetpack Compose.

Features

Project layout

app/src/main/java/com/example/
  data/local/       Room entities, DAOs, database
  data/supabase/    Retrofit service, repositories, DTOs
  data/remote/      Gemini API helpers
  ui/screens/       Compose screens (dashboard, audits, scanner, ...)
  ui/viewmodel/     AuditViewModel (shared state)
  ui/theme/         Compose theme
setup.sql           Supabase schema — run once in the Supabase SQL editor
Order_PY.py         Optional Python helper that seeds demo orders into Supabase

Setup

1. Supabase

  1. Create a project at supabase.com
  2. Open SQL Editor, paste the full contents of setup.sql, and click RUN
  3. Copy your project URL and anon key from Project Settings → API
  4. Put them in app/src/main/java/com/example/data/supabase/SupabaseApiService.kt defaults or override at runtime (SupabaseClient.initialize(url, key))

Note: setup.sql creates per-table “Allow all” RLS policies because the app uses the anon key without user auth. Replace them with auth-scoped policies before production use.

2. Gemini API key

  1. Get a key at aistudio.google.com/apikey
  2. Copy .env.example to .env in the repo root and set GEMINI_API_KEY=...
  3. The Gradle secrets plugin injects it as BuildConfig.GEMINI_API_KEY at build time

Without a key the app still builds and runs; AI features fall back to simulated results.

3. Build

Requirements: JDK 17+, Android SDK with platform 36.1 and build-tools 37.

./gradlew assembleDebug    # debug APK  -> app/build/outputs/apk/debug/
./gradlew assembleRelease  # requires KEYSTORE_PATH, STORE_PASSWORD, KEY_PASSWORD env vars

Prebuilt APKs live on the releases branch.

Security notes

See SECURITY.md. Never commit real API keys — .env is gitignored on purpose.