# sachie34/birms architecture

> Architecture diagram of the GitHub repository sachie34/birms, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sachie34/birms
- Repository: https://github.com/sachie34/birms

## Overview

BIRMS is a PHP barangay records-management application. Staff sign in, then use role-permitted pages to manage resident records, file and review document requests, issue certificates, and track incidents through hearings and resolution. Supporting branches cover visitors, reports, search, audit, and administration. The shared bootstrap loads authentication, permissions, common UI, and domain libraries. The README describes additional capabilities such as CSV import, private attachments, a cash ledger, local SQL backup, and optional SMS delivery. Several libraries and pages are unsampled, so their internal call paths are not inferred.

Main entry points: [`app/bootstrap.php`](https://github.com/sachie34/birms/blob/main/app/bootstrap.php) (Web bootstrap), [`public/index.php`](https://github.com/sachie34/birms/blob/main/public/index.php) (Sign in), [`app/certificates_lib.php`](https://github.com/sachie34/birms/blob/main/app/certificates_lib.php) (Certificate issuance), [`app/sms_provider.php`](https://github.com/sachie34/birms/blob/main/app/sms_provider.php) (SMS dispatch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web foundation"]
  node_signin["Sign in<br/>[index.php]"]
  node_auth["Authentication<br/>[auth.php]"]
  node_bootstrap["Web bootstrap<br/>[bootstrap.php]"]
  node_core["Database and helpers<br/>[core.php]"]
  node_ui["Shared UI<br/>[ui.php]"]
end

subgraph group_records["Records workflow"]
  node_residents["Resident records<br/>[index.php]"]
  node_resident_lib["Resident services<br/>[residents_lib.php]"]
  node_resident_import["CSV import"]
  node_requests["Document requests<br/>[index.php]"]
  node_request_lib["Request services<br/>[requests_lib.php]"]
  node_certificates["Certificate issuance"]
  node_ledger["Cash ledger<br/>[ledger.php]"]
  node_blotters["Blotter cases<br/>[blotters_lib.php]"]
  node_visitors["Visitor log<br/>[index.php]"]
end

subgraph group_operations["Office operations"]
  node_attachments["Private attachments"]
  node_search["Global search<br/>[search.php]"]
  node_sms["SMS dispatch<br/>[sms_provider.php]"]
  node_smsapiph["SMS API PH"]
  node_semaphore["Infobip provider"]
end

subgraph group_admin["Reporting and administration"]
  node_reports["Reports<br/>[reports_lib.php]"]
  node_dashboard["Dashboard<br/>[dashboard.php]"]
  node_audit["Audit records<br/>[audit_query.php]"]
  node_backup["SQL backup<br/>[backup_lib.php]"]
end

node_staff(("Staff user"))
node_database[("MySQL database")]
node_webdav["WebDAV backup"]

node_staff -->|"signs in"| node_signin
node_signin -->|"attempts login"| node_auth
node_signin -->|"loads"| node_bootstrap
node_residents -->|"loads"| node_bootstrap
node_requests -->|"loads"| node_bootstrap
node_bootstrap -->|"loads"| node_core
node_bootstrap -->|"loads"| node_auth
node_bootstrap -->|"loads"| node_ui
node_bootstrap -->|"loads"| node_resident_lib
node_bootstrap -->|"loads"| node_resident_import
node_bootstrap -->|"loads"| node_request_lib
node_bootstrap -->|"loads"| node_certificates
node_bootstrap -->|"loads"| node_blotters
node_bootstrap -->|"loads"| node_attachments
node_bootstrap -->|"loads"| node_sms
node_bootstrap -->|"loads"| node_reports
node_core -->|"connects to"| node_database
node_resident_import -->|"imports CSV"| node_residents
node_certificates -->|"records fees in"| node_ledger
node_certificates -->|"supports private files"| node_attachments
node_reports -->|"supplies data-derived figures"| node_dashboard
node_sms -.->|"supports provider"| node_smsapiph
node_sms -.->|"supports provider"| node_semaphore
node_backup -.->|"optionally uploads"| node_webdav
node_staff -->|"manages records"| node_residents
node_staff -->|"files and reviews"| node_requests
node_staff -->|"tracks cases"| node_blotters
node_staff -->|"logs visits"| node_visitors
node_staff -->|"searches records"| node_search
node_staff -->|"views reports"| node_reports
node_staff -->|"downloads SQL"| node_backup

click node_signin "https://github.com/sachie34/birms/blob/main/public/index.php"
click node_auth "https://github.com/sachie34/birms/blob/main/app/auth.php"
click node_bootstrap "https://github.com/sachie34/birms/blob/main/app/bootstrap.php"
click node_core "https://github.com/sachie34/birms/blob/main/app/core.php"
click node_ui "https://github.com/sachie34/birms/blob/main/app/ui.php"
click node_residents "https://github.com/sachie34/birms/blob/main/public/residents/index.php"
click node_resident_lib "https://github.com/sachie34/birms/blob/main/app/residents_lib.php"
click node_resident_import "https://github.com/sachie34/birms/blob/main/app/residents_import_lib.php"
click node_requests "https://github.com/sachie34/birms/blob/main/public/requests/index.php"
click node_request_lib "https://github.com/sachie34/birms/blob/main/app/requests_lib.php"
click node_certificates "https://github.com/sachie34/birms/blob/main/app/certificates_lib.php"
click node_ledger "https://github.com/sachie34/birms/blob/main/public/admin/ledger.php"
click node_blotters "https://github.com/sachie34/birms/blob/main/app/blotters_lib.php"
click node_visitors "https://github.com/sachie34/birms/blob/main/public/visitors/index.php"
click node_attachments "https://github.com/sachie34/birms/blob/main/app/attachments_lib.php"
click node_search "https://github.com/sachie34/birms/blob/main/public/search.php"
click node_reports "https://github.com/sachie34/birms/blob/main/app/reports_lib.php"
click node_dashboard "https://github.com/sachie34/birms/blob/main/public/dashboard.php"
click node_audit "https://github.com/sachie34/birms/blob/main/app/audit_query.php"
click node_backup "https://github.com/sachie34/birms/blob/main/app/backup_lib.php"
click node_sms "https://github.com/sachie34/birms/blob/main/app/sms_provider.php"
click node_smsapiph "https://github.com/sachie34/birms/blob/main/app/smsapiph_sms_provider.php"
click node_semaphore "https://github.com/sachie34/birms/blob/main/app/infobip_sms_provider.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_signin,node_auth,node_bootstrap,node_core,node_ui,node_staff toneBlue
class node_residents,node_resident_lib,node_resident_import,node_requests,node_request_lib,node_certificates,node_ledger,node_blotters,node_visitors,node_database toneAmber
class node_attachments,node_search,node_sms,node_smsapiph,node_semaphore toneMint
class node_reports,node_dashboard,node_audit,node_backup toneRose
class node_webdav toneIndigo
```

## Components

### Web foundation

- [Sign in](https://github.com/sachie34/birms/blob/main/public/index.php): `public/index.php`
- [Authentication](https://github.com/sachie34/birms/blob/main/app/auth.php): `app/auth.php`
- [Web bootstrap](https://github.com/sachie34/birms/blob/main/app/bootstrap.php): `app/bootstrap.php`
- [Database and helpers](https://github.com/sachie34/birms/blob/main/app/core.php): `app/core.php`
- [Shared UI](https://github.com/sachie34/birms/blob/main/app/ui.php): `app/ui.php`

### Records workflow

- [Resident records](https://github.com/sachie34/birms/blob/main/public/residents/index.php): `public/residents/index.php`
- [Resident services](https://github.com/sachie34/birms/blob/main/app/residents_lib.php): `app/residents_lib.php`
- [CSV import](https://github.com/sachie34/birms/blob/main/app/residents_import_lib.php): `app/residents_import_lib.php`
- [Document requests](https://github.com/sachie34/birms/blob/main/public/requests/index.php): `public/requests/index.php`
- [Request services](https://github.com/sachie34/birms/blob/main/app/requests_lib.php): `app/requests_lib.php`
- [Certificate issuance](https://github.com/sachie34/birms/blob/main/app/certificates_lib.php): `app/certificates_lib.php`
- [Cash ledger](https://github.com/sachie34/birms/blob/main/public/admin/ledger.php): `public/admin/ledger.php`
- [Blotter cases](https://github.com/sachie34/birms/blob/main/app/blotters_lib.php): `app/blotters_lib.php`
- [Visitor log](https://github.com/sachie34/birms/blob/main/public/visitors/index.php): `public/visitors/index.php`

### Office operations

- [Private attachments](https://github.com/sachie34/birms/blob/main/app/attachments_lib.php): `app/attachments_lib.php`
- [Global search](https://github.com/sachie34/birms/blob/main/public/search.php): `public/search.php`
- [SMS dispatch](https://github.com/sachie34/birms/blob/main/app/sms_provider.php): `app/sms_provider.php`
- [SMS API PH](https://github.com/sachie34/birms/blob/main/app/smsapiph_sms_provider.php): `app/smsapiph_sms_provider.php`
- [Infobip provider](https://github.com/sachie34/birms/blob/main/app/infobip_sms_provider.php): `app/infobip_sms_provider.php`

### Reporting and administration

- [Reports](https://github.com/sachie34/birms/blob/main/app/reports_lib.php): `app/reports_lib.php`
- [Dashboard](https://github.com/sachie34/birms/blob/main/public/dashboard.php): `public/dashboard.php`
- [Audit records](https://github.com/sachie34/birms/blob/main/app/audit_query.php): `app/audit_query.php`
- [SQL backup](https://github.com/sachie34/birms/blob/main/app/backup_lib.php): `app/backup_lib.php`

### Other components

- **Staff user**
- **MySQL database**
- **WebDAV backup**

## Connections

- Staff user → Sign in: signs in (evidence: `public/index.php`)
- Sign in → Authentication: attempts login (evidence: `public/index.php`)
- Sign in → Web bootstrap: loads (evidence: `public/index.php`)
- Resident records → Web bootstrap: loads (evidence: `public/residents/index.php`)
- Document requests → Web bootstrap: loads (evidence: `public/requests/index.php`)
- Web bootstrap → Database and helpers: loads (evidence: `app/bootstrap.php`)
- Web bootstrap → Authentication: loads (evidence: `app/bootstrap.php`)
- Web bootstrap → Shared UI: loads (evidence: `app/bootstrap.php`)
- Web bootstrap → Resident services: loads (evidence: `app/bootstrap.php`)
- Web bootstrap → CSV import: loads (evidence: `app/bootstrap.php`)
- Web bootstrap → Request services: loads (evidence: `app/bootstrap.php`)
- Web bootstrap → Certificate issuance: loads (evidence: `app/bootstrap.php`)
- Web bootstrap → Blotter cases: loads (evidence: `app/bootstrap.php`)
- Web bootstrap → Private attachments: loads (evidence: `app/bootstrap.php`)
- Web bootstrap → SMS dispatch: loads (evidence: `app/bootstrap.php`)
- Web bootstrap → Reports: loads (evidence: `app/bootstrap.php`)
- Database and helpers → MySQL database: connects to (evidence: `app/core.php`)
- CSV import → Resident records: imports CSV (evidence: `README.md`)
- Certificate issuance → Cash ledger: records fees in (evidence: `README.md`)
- Certificate issuance → Private attachments: supports private files (evidence: `README.md`)
- Reports → Dashboard: supplies data-derived figures (evidence: `README.md`)
- SMS dispatch → SMS API PH: supports provider (evidence: `app/sms_provider.php`)
- SMS dispatch → Infobip provider: supports provider (evidence: `app/sms_provider.php`)
- SQL backup → WebDAV backup: optionally uploads (evidence: `README.md`)
- Staff user → Resident records: manages records (evidence: `README.md`)
- Staff user → Document requests: files and reviews (evidence: `README.md`)
- Staff user → Blotter cases: tracks cases (evidence: `README.md`)
- Staff user → Visitor log: logs visits (evidence: `README.md`)
- Staff user → Global search: searches records (evidence: `README.md`)
- Staff user → Reports: views reports (evidence: `README.md`)
- Staff user → SQL backup: downloads SQL (evidence: `README.md`)
