# dineshrepostry/post-chat architecture

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

- Interactive diagram: https://gitdiagram.com/dineshrepostry/post-chat
- Repository: https://github.com/dineshrepostry/post-chat

## Overview

#### Purpose and Entry Points
POST-chat is a PHP/MySQL chat site for global room chat and one-to-one private chat. Apache serves the static/PHP pages; MySQL is initialized from `postdb.sql`. The public landing page is `index.html`; authentication begins at `loginpage/loginpage.php`, and account registration at `createaccount/createaccount.html`.

#### Authentication and Account Lifecycle
Account creation and login are handled by PHP endpoints under `php/`, backed by the shared database configuration in `php/config.php`. Core flows are registration through `php/createacc.php`, credential processing through `php/login.php`, and account/database validation through `php/tablevalidate.php`.

#### Global Chat Room
The primary global-chat UI is `chat/chat.php`, styled by `chat/chat3.css`. Its server-side chat data boundary is the root PHP API layer: message submission/storage uses `php/insert.php` and `php/store.php`, while retrieval uses `php/get.php`. This separates the rendered chat page from persistence operations.

#### Private Messaging
Private conversation functionality is served from `privatechat/privatechat.php` with presentation in `privatechat/privatechat.css`. It shares the application’s PHP/MySQL backend model but remains a distinct UI/control boundary from the global room in `chat/chat.php`.

#### Rooms and User-Managed State
Room assignment/creation is represented by `roomassign/roomassign.php` and `php/createroom.php`; deletion is handled by `php/delete.php`. User preferences include theme persistence via `php/settheme.php`. These endpoints form the mutable user/room state layer around the chat experience.

#### Feedback and Supporting Content
Feedback is collected through `feedback/feedback.html`, written via `php/writefeed.php`, and retrieved through `php/getfeed.php`. Documentation, policies, and static informational pages are independent content surfaces: `documentation/documentation.html`, `policies/Policies.html`, and `post-documentation.pdf`.

#### Separate End-Semester Scheduling Module
The repository also contains an instructor slot-management subsystem, separate from chat: `endsem/instructor-slot.html`, `endsem/php/instructor-slot.php`, and `endsem/php/slot.php`. It has its own connection configuration and schema artifacts in `endsem/php/config.php` and `endsem/it5211.sql`, indicating an independent scheduling database/domain boundary.

#### Runtime and Infrastructure
The application requires an Apache-compatible PHP runtime and MySQL. Main chat schema/data is imported from `postdb.sql`; the scheduling module provides `endsem/it5211.sql`. No client-side framework, build system, or external hosted service is represented; interaction is page/PHP-endpoint driven, with local assets including `images/` and `songs/`.

Main entry points: [`postdb.sql`](https://github.com/dineshrepostry/post-chat/blob/main/postdb.sql) (Main chat database), [`loginpage/loginpage.php`](https://github.com/dineshrepostry/post-chat/blob/main/loginpage/loginpage.php) (Login and registration), [`php/createacc.php`](https://github.com/dineshrepostry/post-chat/blob/main/php/createacc.php) (Registration endpoint), [`chat/chat.php`](https://github.com/dineshrepostry/post-chat/blob/main/chat/chat.php) (Global chat room)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_chat["Chat application"]
  node_landing["Public landing page<br/>static page<br/>[index.html]"]
  node_auth_ui["Login and registration<br/>account UI<br/>[loginpage.php]"]
  node_registration["Registration endpoint<br/>PHP endpoint<br/>[createacc.php]"]
  node_login["Login endpoint<br/>PHP endpoint<br/>[login.php]"]
  node_account_validation["Account validation<br/>PHP endpoint<br/>[tablevalidate.php]"]
  node_chat_ui["Global chat room<br/>PHP page<br/>[chat.php]"]
  node_chat_write["Message write APIs<br/>PHP persistence<br/>[insert.php]"]
  node_chat_read["Message retrieval API<br/>PHP endpoint<br/>[get.php]"]
  node_private_ui["Private chat<br/>PHP page<br/>[privatechat.php]"]
  node_room_state["Room and user state APIs<br/>PHP endpoints<br/>[roomassign.php]"]
  node_feedback["Feedback flow<br/>static page + APIs<br/>[feedback.html]"]
  node_content["Documentation and policies<br/>static content<br/>[documentation.html]"]
end

subgraph group_schedule["Scheduling module"]
  node_schedule_ui["Instructor slot page<br/>static page"]
  node_schedule_service["Slot management service<br/>PHP endpoints"]
  node_schedule_db[("Scheduling database<br/>MySQL schema<br/>[it5211.sql]")]
  node_schedule_config["Scheduling DB config<br/>PHP configuration<br/>[config.php]"]
end

subgraph group_infra["Runtime and data"]
  node_apache{{"Apache + PHP runtime"}}
  node_main_db[("Main chat database<br/>MySQL schema<br/>[postdb.sql]")]
end

node_apache -->|"serves"| node_landing
node_apache -->|"serves"| node_auth_ui
node_apache -->|"serves"| node_chat_ui
node_auth_ui -->|"registers via"| node_registration
node_auth_ui -->|"authenticates via"| node_login
node_registration -->|"validates"| node_account_validation
node_registration -->|"creates account"| node_main_db
node_login -->|"checks credentials"| node_main_db
node_chat_ui -->|"submits messages"| node_chat_write
node_chat_ui -->|"loads messages"| node_chat_read
node_chat_write -->|"persists"| node_main_db
node_chat_read -->|"queries"| node_main_db
node_private_ui -.->|"uses shared backend data"| node_main_db
node_room_state -->|"updates rooms and preferences"| node_main_db
node_feedback -->|"stores feedback"| node_main_db
node_apache -->|"serves"| node_schedule_ui
node_schedule_ui -->|"manages slots"| node_schedule_service
node_schedule_service -->|"uses connection"| node_schedule_config
node_schedule_service -->|"reads and writes slots"| node_schedule_db

click node_main_db "https://github.com/dineshrepostry/post-chat/blob/main/postdb.sql"
click node_landing "https://github.com/dineshrepostry/post-chat/blob/main/index.html"
click node_auth_ui "https://github.com/dineshrepostry/post-chat/blob/main/loginpage/loginpage.php"
click node_registration "https://github.com/dineshrepostry/post-chat/blob/main/php/createacc.php"
click node_login "https://github.com/dineshrepostry/post-chat/blob/main/php/login.php"
click node_account_validation "https://github.com/dineshrepostry/post-chat/blob/main/php/tablevalidate.php"
click node_chat_ui "https://github.com/dineshrepostry/post-chat/blob/main/chat/chat.php"
click node_chat_write "https://github.com/dineshrepostry/post-chat/blob/main/php/insert.php"
click node_chat_read "https://github.com/dineshrepostry/post-chat/blob/main/php/get.php"
click node_private_ui "https://github.com/dineshrepostry/post-chat/blob/main/privatechat/privatechat.php"
click node_room_state "https://github.com/dineshrepostry/post-chat/blob/main/roomassign/roomassign.php"
click node_feedback "https://github.com/dineshrepostry/post-chat/blob/main/feedback/feedback.html"
click node_content "https://github.com/dineshrepostry/post-chat/blob/main/documentation/documentation.html"
click node_schedule_ui "https://github.com/dineshrepostry/post-chat/blob/main/endsem/instructor-slot.html"
click node_schedule_service "https://github.com/dineshrepostry/post-chat/blob/main/endsem/php/instructor-slot.php"
click node_schedule_db "https://github.com/dineshrepostry/post-chat/blob/main/endsem/it5211.sql"
click node_schedule_config "https://github.com/dineshrepostry/post-chat/blob/main/endsem/php/config.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_landing,node_auth_ui,node_registration,node_login,node_account_validation,node_chat_ui,node_chat_write,node_chat_read,node_private_ui,node_room_state,node_feedback,node_content toneBlue
class node_schedule_ui,node_schedule_service,node_schedule_db,node_schedule_config toneAmber
class node_apache,node_main_db toneMint
```

## Components

### Chat application

- [Public landing page](https://github.com/dineshrepostry/post-chat/blob/main/index.html): static page · `index.html`
- [Login and registration](https://github.com/dineshrepostry/post-chat/blob/main/loginpage/loginpage.php): account UI · `loginpage/loginpage.php`
- [Registration endpoint](https://github.com/dineshrepostry/post-chat/blob/main/php/createacc.php): PHP endpoint · `php/createacc.php`
- [Login endpoint](https://github.com/dineshrepostry/post-chat/blob/main/php/login.php): PHP endpoint · `php/login.php`
- [Account validation](https://github.com/dineshrepostry/post-chat/blob/main/php/tablevalidate.php): PHP endpoint · `php/tablevalidate.php`
- [Global chat room](https://github.com/dineshrepostry/post-chat/blob/main/chat/chat.php): PHP page · `chat/chat.php`
- [Message write APIs](https://github.com/dineshrepostry/post-chat/blob/main/php/insert.php): PHP persistence · Submission and storage endpoints. · `php/insert.php`
- [Message retrieval API](https://github.com/dineshrepostry/post-chat/blob/main/php/get.php): PHP endpoint · `php/get.php`
- [Private chat](https://github.com/dineshrepostry/post-chat/blob/main/privatechat/privatechat.php): PHP page · Separate one-to-one conversation surface. · `privatechat/privatechat.php`
- [Room and user state APIs](https://github.com/dineshrepostry/post-chat/blob/main/roomassign/roomassign.php): PHP endpoints · Room creation, deletion, assignment, and theme persistence. · `roomassign/roomassign.php`
- [Feedback flow](https://github.com/dineshrepostry/post-chat/blob/main/feedback/feedback.html): static page + APIs · Feedback is written and retrieved through PHP endpoints. · `feedback/feedback.html`
- [Documentation and policies](https://github.com/dineshrepostry/post-chat/blob/main/documentation/documentation.html): static content · `documentation/documentation.html`

### Scheduling module

- [Instructor slot page](https://github.com/dineshrepostry/post-chat/blob/main/endsem/instructor-slot.html): static page · `endsem/instructor-slot.html`
- [Slot management service](https://github.com/dineshrepostry/post-chat/blob/main/endsem/php/instructor-slot.php): PHP endpoints · Instructor and slot processing layer. · `endsem/php/instructor-slot.php`
- [Scheduling database](https://github.com/dineshrepostry/post-chat/blob/main/endsem/it5211.sql): MySQL schema · Independent scheduling schema. · `endsem/it5211.sql`
- [Scheduling DB config](https://github.com/dineshrepostry/post-chat/blob/main/endsem/php/config.php): PHP configuration · Separate database connection configuration. · `endsem/php/config.php`

### Runtime and data

- **Apache + PHP runtime**: runtime
- [Main chat database](https://github.com/dineshrepostry/post-chat/blob/main/postdb.sql): MySQL schema · Initialized from the primary chat schema. · `postdb.sql`

## Connections

- Apache + PHP runtime → Public landing page: serves
- Apache + PHP runtime → Login and registration: serves
- Apache + PHP runtime → Global chat room: serves
- Login and registration → Registration endpoint: registers via
- Login and registration → Login endpoint: authenticates via
- Registration endpoint → Account validation: validates
- Registration endpoint → Main chat database: creates account
- Login endpoint → Main chat database: checks credentials
- Global chat room → Message write APIs: submits messages
- Global chat room → Message retrieval API: loads messages
- Message write APIs → Main chat database: persists
- Message retrieval API → Main chat database: queries
- Private chat → Main chat database: uses shared backend data
- Room and user state APIs → Main chat database: updates rooms and preferences
- Feedback flow → Main chat database: stores feedback
- Apache + PHP runtime → Instructor slot page: serves
- Instructor slot page → Slot management service: manages slots
- Slot management service → Scheduling DB config: uses connection
- Slot management service → Scheduling database: reads and writes slots
