# kufudemir/apartment-management architecture

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

- Interactive diagram: https://gitdiagram.com/kufudemir/apartment-management
- Repository: https://github.com/kufudemir/apartment-management

## Overview

This is a Core PHP apartment and residential-complex management application. Users enter through the role-aware front controller, authenticate, and are sent to admin, accounting, resident, or security screens. From there, the product supports property and resident administration, fee collection and reporting, resident requests and announcements, file and note management, and visitor tracking. The sampled pages show direct PDO access and session-based role checks; several documented capabilities are represented by their existing module paths, but their internal call wiring was not sampled.

Main entry points: [`auth/login.php`](https://github.com/kufudemir/apartment-management/blob/main/auth/login.php) (Sign in), [`resident/dashboard.php`](https://github.com/kufudemir/apartment-management/blob/main/resident/dashboard.php) (Resident dashboard), [`index.php`](https://github.com/kufudemir/apartment-management/blob/main/index.php) (Role router), [`admin/dashboard.php`](https://github.com/kufudemir/apartment-management/blob/main/admin/dashboard.php) (Admin dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and sessions"]
  node_index["Role router<br/>[index.php]"]
  node_login["Sign in<br/>[login.php]"]
  node_auth["Session and role checks<br/>[auth_check.php]"]
  node_dbconfig["PDO connection<br/>[database.php]"]
end

subgraph group_property["Property administration"]
  node_admin["Admin dashboard<br/>[dashboard.php]"]
  node_apartments["Apartment records<br/>[detail.php]"]
  node_users["User management<br/>[add.php]"]
end

subgraph group_finance["Finance and reporting"]
  node_fees["Fee management<br/>[fees.php]"]
  node_payments["Payment records<br/>[payments.php]"]
  node_bulkpay["Bulk payments<br/>[bulk_payment.php]"]
  node_reports["Financial reports<br/>[reports.php]"]
end

subgraph group_community["Resident services"]
  node_resdash["Resident dashboard<br/>[dashboard.php]"]
  node_requests["Resident requests<br/>[list.php]"]
  node_announcements["Announcements<br/>[list.php]"]
  node_files["File management<br/>[list.php]"]
  node_notes["Apartment notes<br/>[list.php]"]
end

subgraph group_operations["Building operations"]
  node_security["Security dashboard<br/>[dashboard.php]"]
  node_visitors["Visitor tracking<br/>[list.php]"]
  node_logs["Audit logs<br/>[list.php]"]
  node_scheduler["Fee scheduling<br/>[scheduler.php]"]
  node_monthly["Monthly fee job<br/>[monthly_fees.php]"]
end

node_user(("User"))
node_mysql[("MySQL")]

node_user -->|"opens"| node_index
node_index -->|"redirects"| node_login
node_index -->|"routes by role"| node_admin
node_index -->|"routes by role"| node_resdash
node_index -->|"routes by role"| node_security
node_user -->|"submits credentials"| node_login
node_login -->|"checks account"| node_mysql
node_login -->|"redirects on success"| node_admin
node_login -->|"redirects on success"| node_resdash
node_login -->|"redirects on success"| node_security
node_admin -->|"checks session and role"| node_auth
node_resdash -->|"checks session and role"| node_auth
node_security -->|"checks session and role"| node_auth
node_auth -->|"loads connection"| node_dbconfig
node_dbconfig -->|"connects"| node_mysql
node_admin -->|"reads dashboard data"| node_mysql
node_resdash -->|"reads resident data"| node_mysql
node_security -->|"updates visitor status"| node_mysql
node_apartments -->|"reads apartment and fee data"| node_mysql
node_users -->|"creates user records"| node_mysql
node_fees -->|"creates and reads fees"| node_mysql
node_payments -->|"stores payment records"| node_mysql
node_reports -->|"queries financial data"| node_mysql
node_resdash -->|"links to requests"| node_requests
node_resdash -->|"links to announcements"| node_announcements
node_visitors -->|"records visitor activity"| node_mysql

click node_index "https://github.com/kufudemir/apartment-management/blob/main/index.php"
click node_login "https://github.com/kufudemir/apartment-management/blob/main/auth/login.php"
click node_auth "https://github.com/kufudemir/apartment-management/blob/main/includes/auth_check.php"
click node_dbconfig "https://github.com/kufudemir/apartment-management/blob/main/config/database.php"
click node_admin "https://github.com/kufudemir/apartment-management/blob/main/admin/dashboard.php"
click node_resdash "https://github.com/kufudemir/apartment-management/blob/main/resident/dashboard.php"
click node_security "https://github.com/kufudemir/apartment-management/blob/main/security/dashboard.php"
click node_apartments "https://github.com/kufudemir/apartment-management/blob/main/modules/apartments/detail.php"
click node_users "https://github.com/kufudemir/apartment-management/blob/main/modules/users/add.php"
click node_fees "https://github.com/kufudemir/apartment-management/blob/main/modules/finance/fees.php"
click node_payments "https://github.com/kufudemir/apartment-management/blob/main/modules/finance/payments.php"
click node_bulkpay "https://github.com/kufudemir/apartment-management/blob/main/accounting/bulk_payment.php"
click node_reports "https://github.com/kufudemir/apartment-management/blob/main/accounting/reports.php"
click node_requests "https://github.com/kufudemir/apartment-management/blob/main/modules/requests/list.php"
click node_announcements "https://github.com/kufudemir/apartment-management/blob/main/modules/announcements/list.php"
click node_files "https://github.com/kufudemir/apartment-management/blob/main/modules/files/list.php"
click node_notes "https://github.com/kufudemir/apartment-management/blob/main/modules/notes/list.php"
click node_visitors "https://github.com/kufudemir/apartment-management/blob/main/modules/visitors/list.php"
click node_logs "https://github.com/kufudemir/apartment-management/blob/main/modules/logs/list.php"
click node_scheduler "https://github.com/kufudemir/apartment-management/blob/main/admin/scheduler.php"
click node_monthly "https://github.com/kufudemir/apartment-management/blob/main/cron/monthly_fees.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_index,node_login,node_auth,node_dbconfig,node_user toneBlue
class node_admin,node_apartments,node_users,node_mysql toneAmber
class node_fees,node_payments,node_bulkpay,node_reports toneMint
class node_resdash,node_requests,node_announcements,node_files,node_notes toneRose
class node_security,node_visitors,node_logs,node_scheduler,node_monthly toneIndigo
```

## Components

### Access and sessions

- [Role router](https://github.com/kufudemir/apartment-management/blob/main/index.php): `index.php`
- [Sign in](https://github.com/kufudemir/apartment-management/blob/main/auth/login.php): `auth/login.php`
- [Session and role checks](https://github.com/kufudemir/apartment-management/blob/main/includes/auth_check.php): `includes/auth_check.php`
- [PDO connection](https://github.com/kufudemir/apartment-management/blob/main/config/database.php): `config/database.php`

### Property administration

- [Admin dashboard](https://github.com/kufudemir/apartment-management/blob/main/admin/dashboard.php): `admin/dashboard.php`
- [Apartment records](https://github.com/kufudemir/apartment-management/blob/main/modules/apartments/detail.php): `modules/apartments/detail.php`
- [User management](https://github.com/kufudemir/apartment-management/blob/main/modules/users/add.php): `modules/users/add.php`

### Finance and reporting

- [Fee management](https://github.com/kufudemir/apartment-management/blob/main/modules/finance/fees.php): `modules/finance/fees.php`
- [Payment records](https://github.com/kufudemir/apartment-management/blob/main/modules/finance/payments.php): `modules/finance/payments.php`
- [Bulk payments](https://github.com/kufudemir/apartment-management/blob/main/accounting/bulk_payment.php): `accounting/bulk_payment.php`
- [Financial reports](https://github.com/kufudemir/apartment-management/blob/main/accounting/reports.php): `accounting/reports.php`

### Resident services

- [Resident dashboard](https://github.com/kufudemir/apartment-management/blob/main/resident/dashboard.php): `resident/dashboard.php`
- [Resident requests](https://github.com/kufudemir/apartment-management/blob/main/modules/requests/list.php): `modules/requests/list.php`
- [Announcements](https://github.com/kufudemir/apartment-management/blob/main/modules/announcements/list.php): `modules/announcements/list.php`
- [File management](https://github.com/kufudemir/apartment-management/blob/main/modules/files/list.php): `modules/files/list.php`
- [Apartment notes](https://github.com/kufudemir/apartment-management/blob/main/modules/notes/list.php): `modules/notes/list.php`

### Building operations

- [Security dashboard](https://github.com/kufudemir/apartment-management/blob/main/security/dashboard.php): `security/dashboard.php`
- [Visitor tracking](https://github.com/kufudemir/apartment-management/blob/main/modules/visitors/list.php): `modules/visitors/list.php`
- [Audit logs](https://github.com/kufudemir/apartment-management/blob/main/modules/logs/list.php): `modules/logs/list.php`
- [Fee scheduling](https://github.com/kufudemir/apartment-management/blob/main/admin/scheduler.php): `admin/scheduler.php`
- [Monthly fee job](https://github.com/kufudemir/apartment-management/blob/main/cron/monthly_fees.php): `cron/monthly_fees.php`

### Other components

- **User**
- **MySQL**

## Connections

- User → Role router: opens
- Role router → Sign in: redirects
- Role router → Admin dashboard: routes by role
- Role router → Resident dashboard: routes by role
- Role router → Security dashboard: routes by role
- User → Sign in: submits credentials
- Sign in → MySQL: checks account
- Sign in → Admin dashboard: redirects on success
- Sign in → Resident dashboard: redirects on success
- Sign in → Security dashboard: redirects on success
- Admin dashboard → Session and role checks: checks session and role
- Resident dashboard → Session and role checks: checks session and role
- Security dashboard → Session and role checks: checks session and role
- Session and role checks → PDO connection: loads connection
- PDO connection → MySQL: connects
- Admin dashboard → MySQL: reads dashboard data
- Resident dashboard → MySQL: reads resident data
- Security dashboard → MySQL: updates visitor status
- Apartment records → MySQL: reads apartment and fee data
- User management → MySQL: creates user records
- Fee management → MySQL: creates and reads fees
- Payment records → MySQL: stores payment records
- Financial reports → MySQL: queries financial data
- Resident dashboard → Resident requests: links to requests
- Resident dashboard → Announcements: links to announcements
- Visitor tracking → MySQL: records visitor activity
