Property Management Solutions
← All docs

Configuration files

╔══════════════════════════════════════════════════════════════════════════════╗
║                  CONFIGURATION & PROJECT LAYOUT                              ║
╚══════════════════════════════════════════════════════════════════════════════╝

Generated : 2026-07-11 (lib/date.sh · QA Lab libs)
Project   : /Users/mark/Projects/property_management

DIRECTORY LAYOUT
════════════════

  property_management/
  ├── scripts/          Main menu (38 .sh scripts) — start here: pm-menu.sh
  ├── sql/              SQL query files (35 total, 11 workorder queries)
  ├── lib/              Shared libraries (colors, tui, db_helper, navigation)
  ├── docs/             Wiki content (wiki-*.txt, auto-refreshed by update_docs.sh)
  ├── migrations/       Database schema versions (if present)
  └── owner_statements/ Generated owner reports

KEY FILES
═════════

  scripts/pm-menu.sh         Main application menu (primary entry point)
  scripts/update_docs.sh     Regenerates all wiki-*.txt files
  scripts/wiki.sh            Documentation browser ([wi] from menu)
  scripts/colors.sh          Compatibility shim → lib/colors.sh + lib/tui.sh
  lib/db_helper.sh           SQL file loader (USER=pmuser, DB=pmdb)
  lib/tui.sh                 Arrow-key navigation (macOS Bash 3.2 + Linux)

DATABASE CONNECTION
═══════════════════

  Default credentials (scripts):
    User     : pmuser
    Database : pmdb

  Production deployment may use /etc/pms/db.conf — see docs/pms.file_folder_layout.txt

SHARED LIBRARIES
════════════════

  lib/colors.sh           Terminal color constants (macOS + Linux)
  lib/tui.sh              Interactive list navigation (arrow keys); mapfile polyfill;
                          portable ESC sequences on macOS/Linux (stty on /dev/tty)
  lib/date.sh             Portable date math (GNU / BSD / gdate) — Lab + rent/statements
  lib/runsql.sh           Manifest-aware SQL execution
  lib/ledger.sh           Owner ledger posts
  lib/manifest.sh         Authorized inventory helpers
  lib/reports.sh          Statement path helpers
  lib/qa_guard.sh         QA Lab safety rails (PM_QA_MODE + DB allowlist)
  lib/qa_battle_common.sh Shared battle helpers (invoice / pay / WO spike /
                          debrief / ensure_core_leases / free_u3 re-fight heal)
  lib/db_helper.sh        Legacy SQL file loader
  lib/navigation.sh       Menu return helpers
  lib/common.sh           Miscellaneous shared functions

PLATFORM NOTES
══════════════

  • Primary UI: Bash menu (pm-menu.sh) with optional Nushell legacy scripts in backup/
  • Common functions live in lib/ (not pm-lib.sh — strategy doc name is outdated)
  • Forum/notes stored in the notes table — accessed via [fo] Forum (commentorium.sh)
  • Do not use GNU-only date -d in new scripts — use lib/date.sh (Linux + macOS)
  • Interactive menus: source lib/tui.sh, call tui_setup, use read_key; key="${TUI_KEY}"
    (never key=$(read_key); never declare -A / fractional read -t in TUI code)
  • Login shell may be zsh — scripts still run under bash via #!/usr/bin/env bash
  • QA Lab: export PM_QA_MODE=1 PMS_DB_NAME=pmdb_qa ; bin/run qa-bootstrap-sandbox
    Seed once; re-fight without wipe. Wipe [7] only if corrupt. Guide: docs/qa-regression-framework.md