Skip to content
OpScaleHubPublic

Repository files navigation

بناداد (Banadad) — offline building management & accounting

«شفافیت در حساب، انصاف در سهم» — مدیریت مالی، محاسبه شارژ و تقسیم شفاف هزینه‌های ساختمان؛ بدون نیاز به اینترنت.

بناداد از «بنا» (ساختمان) و «داد» (انصاف) ساخته شده. این برنامه اندرویدی هزینه‌های ساختمان را بر اساس قواعدی که مدیر ساختمان تعیین می‌کند (مساوی، تعداد ساکنان، متراژ، کنتور آب، پارکینگ یا ضریب) بین واحدها تقسیم می‌کند، دفتر مالی دوطرفه نگه می‌دارد و بدون اینترنت، حساب کاربری یا سرور کار می‌کند.

Banadad (بناداد) is an offline-first Android app (Persian, right-to-left) for residential building management and expense accounting. It runs entirely on the phone: no backend, no account, no analytics. The only network use is checking for and downloading a new version of the app (can be switched off in Settings).

What it does

Day to day the app is organised around the manager's month: the home screen «این ماه» shows a step checklist with live progress, key figures and a collection ring. Buildings with a fixed monthly charge (the wizard's default) bill it in advance: each unit is charged on day 1 and has until the 10th to pay, the next month starts by itself, and the building's bills are paid from that one fund instead of being charged to units again (send → collect → enter bills → close). Buildings that split each month's bills charge units when the month is closed (meter readings, if any → enter bills → review & close → send → collect).

The app is deliberately simple (0.6.0): one building fund, one cash box, a handful of named split choices. The engine below still supports more (several funds, tariffs, formula policies); buildings that already use those keep working, but the UI no longer offers them. Feedback goes by email from «بیشتر ← نظر یا گزارش مشکل». Bills go to residents as an image through the phone's share sheet (WhatsApp, Telegram, Eitaa…), with a ready-made reminder text. Amounts are shown in تومان or ریال (per-building setting) while stored exactly in ریال. Reports include collection rate, debt aging, a monthly cash-flow waterfall, expenses by category vs. last month, a 12-month billed/collected trend, reserve growth, water use per unit vs. the building average and an unexplained-water (leak) trend — all drawn in-app, offline.

  • Buildings & units — several independent buildings; units with floor, area, active flag and an occupancy history with effective dates.
  • Parking — spaces independent of units; owned/assigned/rented and "in use" tracked separately, with effective dates.
  • Water — main and unit meters, historical readings, corrections that keep the original, rollover, meter replacement, main-meter reconciliation (the unexplained difference is shown and only allocated if a policy says how), tiered tariffs with fixed fee and surcharge, double-charge guard.
  • Expenses — configurable categories with default policies, suppliers, partial supplier payments, credit notes. Void is one step with a reason: it reverses the expense's payments and the units' shares; in a closed month it posts a correction dated today instead of touching the closed month.
  • Allocation engine — equal, per occupant (occupant-days), area, measured consumption, weighted, explicit amounts, parking spaces; subsets of units; fixed + percentage + remainder components. Shares always sum exactly to the amount (largest-remainder rounding to a configurable increment) and every share is explained.
  • Billing periods — live preview with Persian validation messages, finalization that freezes inputs, rules and results, and post-finalization correction runs that post only the differences, linked to the period.
  • Ledger — double-entry, append-only, with linked reversals, opening balances, operating/reserve funds, cash/bank accounts and an audit log. Resident debt is kept separate from building cash.
  • Residents — bills carry the month's due date and the building's card number or IBAN (Settings); a payment receipt image can be sent right after a payment is recorded, or later from the unit's history; after the due date Home lists who still owes with a ready reminder.
  • Safety nets — undo right after saving a payment or an expense (as a reversal/void, never a delete); a backup reminder on Home (none yet, or 30+ days) and right after closing a month; «این صفحه چیست؟» help on the main screens.
  • Reports & files — dashboard, unit statements, expenses by category, period comparison, water reconciliation; export an XLSX workbook, a journal CSV, a printable HTML monthly statement; backup/restore with checksum, validation, preview and duplicate-safe import.

Install

Users: Cafe Bazaar or the APK from the landing page.

Debug APK (built and tested): app/build/outputs/apk/debug/app-debug.apk

./gradlew assembleDebug
adb install -r app/build/outputs/apk/debug/app-debug.apk

./gradlew assembleRelease produces an unsigned release APK (app/build/outputs/apk/release/app-release-unsigned.apk); configure your own signing before distributing.

Requirements to build: JDK 17, Android SDK 35. Android 8.0 (API 26) or newer to run.

Use

  1. Open the app → راه‌اندازی ساختمان (setup wizard: details → units, generated from floors × units → optional opening balances), or load the 9-unit demo building (synthetic data, clearly labelled).
  2. خانه — follow the month checklist: enter all meter readings on one screen, add the month's bills (presets + a live «چه کسی چقدر می‌پردازد» preview), then بستن ماه و صدور شارژ.
  3. واحدها — see who owes what (with debt aging); on a unit, record a payment, ارسال قبض (share the bill image) or send a reminder.
  4. گزارش — charts for the month and the trend; export the XLSX workbook or CSV. بیشتر — meters, parking, expense types, the monthly charge, all transactions, settings (Toman/Rial, updates) and backup (do it regularly), and feedback by email.

Data, backup and sharing

  • Data lives only on the phone and is excluded from Android cloud backup and device transfer. Take regular backups (Settings → تهیه فایل پشتیبان) and keep them somewhere safe; they contain financial data and unit notes.
  • Restore works from the first screen too (new phone / reinstall).
  • Saving a file to Google Drive is a manual, user-controlled action. It does not synchronize phones; one phone should be the source of truth for a building.

Test

./gradlew testDebugUnitTest                      # 165 JVM + Robolectric tests
ANDROID_SERIAL=emulator-5554 ./gradlew connectedDebugAndroidTest   # UI end-to-end (wipes app data!)
python workbook/verify_workbook.py               # needs openpyxl + formulas

Results and what they cover: docs/05-test-results.md.

Repository layout

app/src/main/java/com/github/opscalehub/dong/
  domain/   pure-Kotlin financial engine (allocation, water, period, ledger, calendar)
  data/     Room entities/DAOs/migrations, repositories, sample data, backup
  io/       XLSX writer, CSV, HTML statement, backup codec
  i18n/     Persian labels and number/date formatting
  ui/       Jetpack Compose screens (Persian, RTL); ui/charts = in-app charts
  share/    bill image rendering + share sheet (FileProvider, no permissions)
app/schemas/   exported Room schemas (v1–v6)
workbook/      accounting prototype workbook + generator + verifier
docs/          requirements, domain model, plan, architecture, tests, roadmap

Documentation

  1. Requirements, assumptions, open decisions
  2. Domain model, schema, invariants
  3. Implementation plan
  4. Architecture and extension points
  5. Test results
  6. Known limitations and roadmap
  7. UX & reporting overhaul plan
  8. Branding and renames
  9. Usability review (0.3.2)
  10. UX research plan and Persian test kit
  11. 0.4 "simple by default" design, 0.4.1–0.4.4
  12. Message for testers
  13. Project history, decisions and lessons — start here when resuming
  14. Usability test protocol and KPIs

All sample data in this repository is synthetic.

Font: Vazirmatn, SIL Open Font License 1.1 (see licenses/Vazirmatn-OFL.txt).

Landing page and releases

  • Landing page: https://banadad.opscale.ir/ (static files in site/, deployed by .github/workflows/pages.yml on every push to main that touches site/).

  • Releases are cut locally, no CI build:

    scripts/release.sh            # patch bump: 0.2.0 -> 0.2.1
    scripts/release.sh minor      # or major, or an explicit 1.0.0
    scripts/release.sh --dry-run  # build and show notes, change nothing

    The script bumps version.properties, runs the unit tests, builds a signed release APK, writes site/release.json (version, size, SHA-256, Jalali date), commits and tags vX.Y.Z, pushes, and publishes a GitHub Release with banadad.apk, banadad-X.Y.Z.apk and banadad-bazaar-X.Y.Z.apk attached (plus dang.apk, the same file under its pre-0.12 name, for old links). The landing page's download button always points at releases/latest/download/banadad.apk. The Bazaar build build/release/banadad-bazaar-X.Y.Z.apk (-Pstore=bazaar: adds «امتیاز در بازار»), which is uploaded to Cafe Bazaar by hand in the Pishkhan panel. Use --skip-tests when the tests were just run.

  • The signing key is created on the first run in ~/.config/dong/ (override with DONG_SIGNING=/path/to/signing.properties). Back it up: without it, later versions cannot update installed copies.

Releases

Packages

Contributors

Languages