# nisalasxlik/hanthana architecture

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

- Interactive diagram: https://gitdiagram.com/nisalasxlik/hanthana
- Repository: https://github.com/nisalasxlik/hanthana

## Overview

Hanthana is a PHP social and academic community application. Users enter through the web app to manage accounts and profiles, connect with friends, participate in group communities, and use feeds and academic content such as questions, events, and shared resources. Controllers coordinate domain models, which persist application data through a shared database layer; server-rendered views provide the interface, with browser scripts supporting interactions. The source index documents several controller-to-model dependencies; other links are omitted where the sampled material does not establish them.

Main entry points: [`app/core/Database.php`](https://github.com/nisalasxlik/hanthana/blob/dev-main/app/core/Database.php) (Database connection), [`app/controllers/GroupController.php`](https://github.com/nisalasxlik/hanthana/blob/dev-main/app/controllers/GroupController.php) (Group management), [`app/controllers/SearchController.php`](https://github.com/nisalasxlik/hanthana/blob/dev-main/app/controllers/SearchController.php) (Search and discovery), [`app/models/FriendModel.php`](https://github.com/nisalasxlik/hanthana/blob/dev-main/app/models/FriendModel.php) (Friend records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry"]
  node_web["Web entry point<br/>[index.php]"]
end

subgraph group_people["People and accounts"]
  node_auth["Authentication<br/>[AuthController.php]"]
  node_profile["Profiles"]
  node_friendship["Friend connections"]
  node_users["User records<br/>[UserModel.php]"]
  node_friends["Friend records<br/>[FriendModel.php]"]
end

subgraph group_community["Social content"]
  node_feed["Feeds and posts<br/>[FeedController.php]"]
  node_posts["Post records<br/>[PostModel.php]"]
  node_discovery["Search and discovery"]
end

subgraph group_groups["Group communities"]
  node_groupsvc["Group management"]
  node_groupdata["Group records<br/>[GroupModel.php]"]
  node_groupposts["Group posts<br/>[GroupPostModel.php]"]
  node_channels["Group channels<br/>[ChannelModel.php]"]
  node_chat["Direct messaging<br/>[ChatController.php]"]
  node_messages["Message records<br/>[MessageModel.php]"]
end

subgraph group_academic["Academic tools"]
  node_questions["Questions and answers<br/>[QuestionModel.php]"]
  node_calendar["Calendar reminders"]
  node_events["Events"]
  node_filebank["File bank"]
end

subgraph group_platform["Persistence and services"]
  node_notifications["Notifications"]
  node_reports["Reports and moderation<br/>[ReportModel.php]"]
  node_database["Database connection<br/>[Database.php]"]
  node_sqlstore[("MySQL database")]
end

node_user(("Community user"))

node_user -.->|"uses"| node_web
node_web -.->|"dispatches"| node_auth
node_profile -->|"reads and updates"| node_users
node_profile -->|"reads"| node_friends
node_friendship -.->|"manages"| node_friends
node_feed -.->|"loads posts"| node_posts
node_discovery -->|"searches"| node_users
node_discovery -->|"searches"| node_groupdata
node_discovery -->|"searches"| node_posts
node_discovery -->|"searches"| node_questions
node_groupsvc -->|"manages"| node_groupdata
node_groupsvc -->|"loads posts"| node_groupposts
node_groupsvc -->|"uses reminders"| node_calendar
node_groupsvc -->|"uses reports"| node_reports
node_groupsvc -->|"sends notifications"| node_notifications
node_chat -->|"manages messages"| node_messages
node_chat -->|"checks connections"| node_friends
node_chat -->|"uses channels"| node_channels
node_users -->|"connects through"| node_database
node_friends -->|"connects through"| node_database
node_groupdata -->|"connects through"| node_database
node_groupposts -->|"connects through"| node_database
node_channels -->|"connects through"| node_database
node_messages -->|"connects through"| node_database
node_posts -->|"connects through"| node_database
node_questions -->|"connects through"| node_database
node_calendar -->|"connects through"| node_database
node_notifications -->|"connects through"| node_database
node_reports -->|"connects through"| node_database
node_database -->|"opens connection"| node_sqlstore

click node_web "https://github.com/nisalasxlik/hanthana/blob/dev-main/public/index.php"
click node_auth "https://github.com/nisalasxlik/hanthana/blob/dev-main/app/controllers/AuthController.php"
click node_profile "https://github.com/nisalasxlik/hanthana/blob/dev-main/app/controllers/ProfileController.php"
click node_friendship "https://github.com/nisalasxlik/hanthana/blob/dev-main/app/controllers/FriendController.php"
click node_users "https://github.com/nisalasxlik/hanthana/blob/dev-main/app/models/UserModel.php"
click node_friends "https://github.com/nisalasxlik/hanthana/blob/dev-main/app/models/FriendModel.php"
click node_feed "https://github.com/nisalasxlik/hanthana/blob/dev-main/app/controllers/FeedController.php"
click node_posts "https://github.com/nisalasxlik/hanthana/blob/dev-main/app/models/PostModel.php"
click node_discovery "https://github.com/nisalasxlik/hanthana/blob/dev-main/app/controllers/SearchController.php"
click node_groupsvc "https://github.com/nisalasxlik/hanthana/blob/dev-main/app/controllers/GroupController.php"
click node_groupdata "https://github.com/nisalasxlik/hanthana/blob/dev-main/app/models/GroupModel.php"
click node_groupposts "https://github.com/nisalasxlik/hanthana/blob/dev-main/app/models/GroupPostModel.php"
click node_channels "https://github.com/nisalasxlik/hanthana/blob/dev-main/app/models/ChannelModel.php"
click node_chat "https://github.com/nisalasxlik/hanthana/blob/dev-main/app/controllers/ChatController.php"
click node_messages "https://github.com/nisalasxlik/hanthana/blob/dev-main/app/models/MessageModel.php"
click node_questions "https://github.com/nisalasxlik/hanthana/blob/dev-main/app/models/QuestionModel.php"
click node_calendar "https://github.com/nisalasxlik/hanthana/blob/dev-main/app/models/CalendarReminderModel.php"
click node_events "https://github.com/nisalasxlik/hanthana/blob/dev-main/app/controllers/EventsController.php"
click node_filebank "https://github.com/nisalasxlik/hanthana/blob/dev-main/app/controllers/FileBankController.php"
click node_notifications "https://github.com/nisalasxlik/hanthana/blob/dev-main/app/models/NotificationsModel.php"
click node_reports "https://github.com/nisalasxlik/hanthana/blob/dev-main/app/models/ReportModel.php"
click node_database "https://github.com/nisalasxlik/hanthana/blob/dev-main/app/core/Database.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_web,node_user toneBlue
class node_auth,node_profile,node_friendship,node_users,node_friends toneAmber
class node_feed,node_posts,node_discovery toneMint
class node_groupsvc,node_groupdata,node_groupposts,node_channels,node_chat,node_messages toneRose
class node_questions,node_calendar,node_events,node_filebank toneIndigo
class node_notifications,node_reports,node_database,node_sqlstore toneTeal
```

## Components

### Web entry

- [Web entry point](https://github.com/nisalasxlik/hanthana/blob/dev-main/public/index.php): `public/index.php`

### People and accounts

- [Authentication](https://github.com/nisalasxlik/hanthana/blob/dev-main/app/controllers/AuthController.php): `app/controllers/AuthController.php`
- [Profiles](https://github.com/nisalasxlik/hanthana/blob/dev-main/app/controllers/ProfileController.php): `app/controllers/ProfileController.php`
- [Friend connections](https://github.com/nisalasxlik/hanthana/blob/dev-main/app/controllers/FriendController.php): `app/controllers/FriendController.php`
- [User records](https://github.com/nisalasxlik/hanthana/blob/dev-main/app/models/UserModel.php): `app/models/UserModel.php`
- [Friend records](https://github.com/nisalasxlik/hanthana/blob/dev-main/app/models/FriendModel.php): `app/models/FriendModel.php`

### Social content

- [Feeds and posts](https://github.com/nisalasxlik/hanthana/blob/dev-main/app/controllers/FeedController.php): `app/controllers/FeedController.php`
- [Post records](https://github.com/nisalasxlik/hanthana/blob/dev-main/app/models/PostModel.php): `app/models/PostModel.php`
- [Search and discovery](https://github.com/nisalasxlik/hanthana/blob/dev-main/app/controllers/SearchController.php): `app/controllers/SearchController.php`

### Group communities

- [Group management](https://github.com/nisalasxlik/hanthana/blob/dev-main/app/controllers/GroupController.php): `app/controllers/GroupController.php`
- [Group records](https://github.com/nisalasxlik/hanthana/blob/dev-main/app/models/GroupModel.php): `app/models/GroupModel.php`
- [Group posts](https://github.com/nisalasxlik/hanthana/blob/dev-main/app/models/GroupPostModel.php): `app/models/GroupPostModel.php`
- [Group channels](https://github.com/nisalasxlik/hanthana/blob/dev-main/app/models/ChannelModel.php): `app/models/ChannelModel.php`
- [Direct messaging](https://github.com/nisalasxlik/hanthana/blob/dev-main/app/controllers/ChatController.php): `app/controllers/ChatController.php`
- [Message records](https://github.com/nisalasxlik/hanthana/blob/dev-main/app/models/MessageModel.php): `app/models/MessageModel.php`

### Academic tools

- [Questions and answers](https://github.com/nisalasxlik/hanthana/blob/dev-main/app/models/QuestionModel.php): `app/models/QuestionModel.php`
- [Calendar reminders](https://github.com/nisalasxlik/hanthana/blob/dev-main/app/models/CalendarReminderModel.php): `app/models/CalendarReminderModel.php`
- [Events](https://github.com/nisalasxlik/hanthana/blob/dev-main/app/controllers/EventsController.php): `app/controllers/EventsController.php`
- [File bank](https://github.com/nisalasxlik/hanthana/blob/dev-main/app/controllers/FileBankController.php): `app/controllers/FileBankController.php`

### Persistence and services

- [Notifications](https://github.com/nisalasxlik/hanthana/blob/dev-main/app/models/NotificationsModel.php): `app/models/NotificationsModel.php`
- [Reports and moderation](https://github.com/nisalasxlik/hanthana/blob/dev-main/app/models/ReportModel.php): `app/models/ReportModel.php`
- [Database connection](https://github.com/nisalasxlik/hanthana/blob/dev-main/app/core/Database.php): `app/core/Database.php`
- **MySQL database**

### Other components

- **Community user**

## Connections

- Community user → Web entry point: uses
- Web entry point → Authentication: dispatches
- Profiles → User records: reads and updates (evidence: `app/controllers/ProfileController.php`)
- Profiles → Friend records: reads (evidence: `app/controllers/ProfileController.php`)
- Friend connections → Friend records: manages
- Feeds and posts → Post records: loads posts
- Search and discovery → User records: searches (evidence: `app/controllers/SearchController.php`)
- Search and discovery → Group records: searches (evidence: `app/controllers/SearchController.php`)
- Search and discovery → Post records: searches (evidence: `app/controllers/SearchController.php`)
- Search and discovery → Questions and answers: searches (evidence: `app/controllers/SearchController.php`)
- Group management → Group records: manages (evidence: `app/controllers/GroupController.php`)
- Group management → Group posts: loads posts (evidence: `app/controllers/GroupController.php`)
- Group management → Calendar reminders: uses reminders (evidence: `app/controllers/GroupController.php`)
- Group management → Reports and moderation: uses reports (evidence: `app/controllers/GroupController.php`)
- Group management → Notifications: sends notifications (evidence: `app/controllers/GroupController.php`)
- Direct messaging → Message records: manages messages (evidence: `app/controllers/ChatController.php`)
- Direct messaging → Friend records: checks connections (evidence: `app/controllers/ChatController.php`)
- Direct messaging → Group channels: uses channels (evidence: `app/controllers/ChatController.php`)
- User records → Database connection: connects through (evidence: `app/models/UserModel.php`)
- Friend records → Database connection: connects through (evidence: `app/models/FriendModel.php`)
- Group records → Database connection: connects through (evidence: `app/models/GroupModel.php`)
- Group posts → Database connection: connects through (evidence: `app/models/GroupPostModel.php`)
- Group channels → Database connection: connects through (evidence: `app/models/ChannelModel.php`)
- Message records → Database connection: connects through (evidence: `app/models/MessageModel.php`)
- Post records → Database connection: connects through (evidence: `app/models/PostModel.php`)
- Questions and answers → Database connection: connects through (evidence: `app/models/QuestionModel.php`)
- Calendar reminders → Database connection: connects through (evidence: `app/models/CalendarReminderModel.php`)
- Notifications → Database connection: connects through (evidence: `app/models/NotificationsModel.php`)
- Reports and moderation → Database connection: connects through (evidence: `app/models/ReportModel.php`)
- Database connection → MySQL database: opens connection (evidence: `app/core/Database.php`)
