# topiastoivonen/turunpuskaradio architecture

> Architecture diagram of the GitHub repository topiastoivonen/turunpuskaradio, 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/topiastoivonen/turunpuskaradio
- Repository: https://github.com/topiastoivonen/turunpuskaradio

## Overview

Turun puskaradio is a Finnish community message board organized around general and topic-specific feeds, message detail pages, and replies. Users browse and sort messages, publish a message to an area, or open a message and submit a response. Feed queries aggregate reply counts and support ordering by newest message, newest reply, or reply count. The excerpts show the PHP page flow and PDO access; unsampled filter helpers and JavaScript are not mapped, and no README was provided.

Main entry points: [`app/showMessages.php`](https://github.com/topiastoivonen/turunpuskaradio/blob/Main/app/showMessages.php) (Feed renderer), [`index.php`](https://github.com/topiastoivonen/turunpuskaradio/blob/Main/index.php) (Home feed), [`juorut.php`](https://github.com/topiastoivonen/turunpuskaradio/blob/Main/juorut.php) (Gossip feed), [`opiskelu.php`](https://github.com/topiastoivonen/turunpuskaradio/blob/Main/opiskelu.php) (Study feed)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pages["Pages and feeds"]
  node_home["Home feed<br/>[index.php]"]
  node_gossip["Gossip feed<br/>[juorut.php]"]
  node_study["Study feed<br/>[opiskelu.php]"]
  node_work["Work feed<br/>[tyo.php]"]
  node_detail["Message detail<br/>[message.php]"]
end

subgraph group_presentation["Forms and rendering"]
  node_header["Site navigation<br/>[header.php]"]
  node_feed["Feed renderer<br/>[showMessages.php]"]
  node_message_form["Message form<br/>[messageForm.php]"]
  node_filter_form["Sort selector<br/>[filterForm.php]"]
  node_response_form["Response form<br/>[responseForm.php]"]
end

subgraph group_posting["Post handling"]
  node_create_message["Create message<br/>[createMessage.php]"]
  node_create_response["Create response<br/>[createResponse.php]"]
end

subgraph group_persistence["Persistence"]
  node_db_access["PDO connection<br/>[database.php]"]
  node_mysql[("MySQL database")]
end

node_visitor(("Visitor"))

node_visitor -.->|"opens feed"| node_home
node_visitor -.->|"opens feed"| node_gossip
node_visitor -.->|"opens feed"| node_study
node_visitor -.->|"opens feed"| node_work
node_visitor -.->|"opens message"| node_detail
node_home -->|"includes"| node_header
node_gossip -->|"includes"| node_header
node_study -->|"includes"| node_header
node_work -->|"includes"| node_header
node_detail -->|"includes"| node_header
node_home -->|"renders feed"| node_feed
node_gossip -->|"renders feed"| node_feed
node_study -->|"renders feed"| node_feed
node_work -->|"renders feed"| node_feed
node_home -->|"includes"| node_message_form
node_gossip -->|"includes"| node_message_form
node_study -->|"includes"| node_message_form
node_work -->|"includes"| node_message_form
node_home -->|"includes"| node_filter_form
node_gossip -->|"includes"| node_filter_form
node_study -->|"includes"| node_filter_form
node_work -->|"includes"| node_filter_form
node_detail -->|"includes"| node_response_form
node_message_form -->|"posts to"| node_create_message
node_response_form -->|"posts to"| node_create_response
node_feed -->|"loads connection"| node_db_access
node_create_message -->|"loads connection"| node_db_access
node_create_response -->|"loads connection"| node_db_access
node_detail -->|"loads connection"| node_db_access
node_db_access -->|"connects to"| node_mysql
node_feed -->|"queries messages"| node_mysql
node_create_message -->|"inserts message"| node_mysql
node_create_response -.->|"writes response"| node_mysql
node_detail -->|"queries message"| node_mysql

click node_home "https://github.com/topiastoivonen/turunpuskaradio/blob/Main/index.php"
click node_gossip "https://github.com/topiastoivonen/turunpuskaradio/blob/Main/juorut.php"
click node_study "https://github.com/topiastoivonen/turunpuskaradio/blob/Main/opiskelu.php"
click node_work "https://github.com/topiastoivonen/turunpuskaradio/blob/Main/tyo.php"
click node_detail "https://github.com/topiastoivonen/turunpuskaradio/blob/Main/message.php"
click node_header "https://github.com/topiastoivonen/turunpuskaradio/blob/Main/templates/header.php"
click node_feed "https://github.com/topiastoivonen/turunpuskaradio/blob/Main/app/showMessages.php"
click node_message_form "https://github.com/topiastoivonen/turunpuskaradio/blob/Main/app/messageForm.php"
click node_filter_form "https://github.com/topiastoivonen/turunpuskaradio/blob/Main/app/filterForm.php"
click node_response_form "https://github.com/topiastoivonen/turunpuskaradio/blob/Main/app/responseForm.php"
click node_create_message "https://github.com/topiastoivonen/turunpuskaradio/blob/Main/createMessage.php"
click node_create_response "https://github.com/topiastoivonen/turunpuskaradio/blob/Main/createResponse.php"
click node_db_access "https://github.com/topiastoivonen/turunpuskaradio/blob/Main/app/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_home,node_gossip,node_study,node_work,node_detail toneBlue
class node_header,node_feed,node_message_form,node_filter_form,node_response_form toneAmber
class node_create_message,node_create_response toneMint
class node_db_access,node_mysql toneRose
class node_visitor toneIndigo
```

## Components

### Pages and feeds

- [Home feed](https://github.com/topiastoivonen/turunpuskaradio/blob/Main/index.php): `index.php`
- [Gossip feed](https://github.com/topiastoivonen/turunpuskaradio/blob/Main/juorut.php): `juorut.php`
- [Study feed](https://github.com/topiastoivonen/turunpuskaradio/blob/Main/opiskelu.php): `opiskelu.php`
- [Work feed](https://github.com/topiastoivonen/turunpuskaradio/blob/Main/tyo.php): `tyo.php`
- [Message detail](https://github.com/topiastoivonen/turunpuskaradio/blob/Main/message.php): `message.php`

### Forms and rendering

- [Site navigation](https://github.com/topiastoivonen/turunpuskaradio/blob/Main/templates/header.php): `templates/header.php`
- [Feed renderer](https://github.com/topiastoivonen/turunpuskaradio/blob/Main/app/showMessages.php): `app/showMessages.php`
- [Message form](https://github.com/topiastoivonen/turunpuskaradio/blob/Main/app/messageForm.php): `app/messageForm.php`
- [Sort selector](https://github.com/topiastoivonen/turunpuskaradio/blob/Main/app/filterForm.php): `app/filterForm.php`
- [Response form](https://github.com/topiastoivonen/turunpuskaradio/blob/Main/app/responseForm.php): `app/responseForm.php`

### Post handling

- [Create message](https://github.com/topiastoivonen/turunpuskaradio/blob/Main/createMessage.php): `createMessage.php`
- [Create response](https://github.com/topiastoivonen/turunpuskaradio/blob/Main/createResponse.php): `createResponse.php`

### Persistence

- [PDO connection](https://github.com/topiastoivonen/turunpuskaradio/blob/Main/app/database.php): `app/database.php`
- **MySQL database**

### Other components

- **Visitor**

## Connections

- Visitor → Home feed: opens feed
- Visitor → Gossip feed: opens feed
- Visitor → Study feed: opens feed
- Visitor → Work feed: opens feed
- Visitor → Message detail: opens message
- Home feed → Site navigation: includes (evidence: `index.php`)
- Gossip feed → Site navigation: includes (evidence: `juorut.php`)
- Study feed → Site navigation: includes (evidence: `opiskelu.php`)
- Work feed → Site navigation: includes (evidence: `tyo.php`)
- Message detail → Site navigation: includes (evidence: `message.php`)
- Home feed → Feed renderer: renders feed (evidence: `index.php`)
- Gossip feed → Feed renderer: renders feed (evidence: `juorut.php`)
- Study feed → Feed renderer: renders feed (evidence: `opiskelu.php`)
- Work feed → Feed renderer: renders feed (evidence: `tyo.php`)
- Home feed → Message form: includes (evidence: `index.php`)
- Gossip feed → Message form: includes (evidence: `juorut.php`)
- Study feed → Message form: includes (evidence: `opiskelu.php`)
- Work feed → Message form: includes (evidence: `tyo.php`)
- Home feed → Sort selector: includes (evidence: `index.php`)
- Gossip feed → Sort selector: includes (evidence: `juorut.php`)
- Study feed → Sort selector: includes (evidence: `opiskelu.php`)
- Work feed → Sort selector: includes (evidence: `tyo.php`)
- Message detail → Response form: includes (evidence: `message.php`)
- Message form → Create message: posts to (evidence: `app/messageForm.php`)
- Response form → Create response: posts to (evidence: `app/responseForm.php`)
- Feed renderer → PDO connection: loads connection (evidence: `app/showMessages.php`)
- Create message → PDO connection: loads connection (evidence: `createMessage.php`)
- Create response → PDO connection: loads connection (evidence: `createResponse.php`)
- Message detail → PDO connection: loads connection (evidence: `message.php`)
- PDO connection → MySQL database: connects to (evidence: `app/database.php`)
- Feed renderer → MySQL database: queries messages (evidence: `app/showMessages.php`)
- Create message → MySQL database: inserts message (evidence: `createMessage.php`)
- Create response → MySQL database: writes response
- Message detail → MySQL database: queries message (evidence: `message.php`)
