# megasush1/iohiki architecture

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

- Interactive diagram: https://gitdiagram.com/megasush1/iohiki
- Repository: https://github.com/megasush1/iohiki

## Overview

IOHIKI is a PHP music-inspired social site with separate client and artist accounts. Visitors can register or log in; authenticated users reach profiles and settings, while the shared navigation exposes search and other site destinations. The shown search page is only a placeholder, and the README describes SQL-backed accounts without detailing broader music features. The graph reflects visible account, profile, and shared-page behavior; artist registration and several destinations are present in the tree but their implementation was not sampled.

Main entry points: [`src/login/index.php`](https://github.com/megasush1/iohiki/blob/master/src/login/index.php) (Client login), [`src/search.php`](https://github.com/megasush1/iohiki/blob/master/src/search.php) (Search page), [`src/src/phpcomponent/header.php`](https://github.com/megasush1/iohiki/blob/master/src/src/phpcomponent/header.php) (Navigation header), [`src/src/phpscript/login_check_no_redirect.php`](https://github.com/megasush1/iohiki/blob/master/src/src/phpscript/login_check_no_redirect.php) (Optional session check)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_account["Accounts"]
  node_client_signup["Client signup<br/>[index.php]"]
  node_artist_signup["Artist signup<br/>[artiste.php]"]
  node_client_login["Client login<br/>[index.php]"]
  node_artist_login["Artist login<br/>[artiste.php]"]
  node_logout["Logout<br/>[logout.php]"]
  node_session_gate["Session checks<br/>[login_check.php]"]
  node_session_optional["Optional session check"]
  node_auth_helpers["Auth helpers<br/>[functions.php]"]
  node_db_connection["SQL connection<br/>[connection.php]"]
  node_accounts_db[("Account database<br/>[create.sql]")]
end

subgraph group_site["Site pages"]
  node_home["Home page<br/>[index.php]"]
  node_search["Search page<br/>[search.php]"]
  node_discover["Discovery destination"]
  node_events["Events destination"]
end

subgraph group_profile["Profiles"]
  node_profile["Profile page<br/>[index.php]"]
  node_settings["Profile settings<br/>[setting.php]"]
  node_client_files[("Client images")]
  node_artist_files[("Artist images")]
end

subgraph group_shared["Shared presentation"]
  node_header["Navigation header<br/>[header.php]"]
  node_head_assets["Page assets<br/>[head.php]"]
  node_footer_script["Footer interactions<br/>[foot.php]"]
end

node_visitor(("Visitor"))

node_visitor -->|"registers"| node_client_signup
node_visitor -->|"logs in"| node_client_login
node_visitor -->|"logs in"| node_artist_login
node_client_signup -->|"checks session"| node_session_optional
node_client_signup -->|"queries and inserts"| node_accounts_db
node_client_login -->|"checks session"| node_session_optional
node_client_login -->|"queries account"| node_accounts_db
node_artist_login -->|"checks session"| node_session_optional
node_artist_login -->|"queries account"| node_accounts_db
node_session_optional -->|"calls check_login"| node_auth_helpers
node_session_gate -->|"calls check_login"| node_auth_helpers
node_session_optional -->|"includes connection"| node_db_connection
node_session_gate -->|"includes connection"| node_db_connection
node_visitor -->|"opens"| node_home
node_visitor -->|"searches"| node_search
node_header -->|"routes search"| node_search
node_header -->|"links destination"| node_discover
node_header -->|"links destination"| node_events
node_profile -->|"checks access"| node_session_gate
node_search -->|"checks access"| node_session_gate
node_settings -->|"checks access"| node_session_gate
node_settings -->|"writes images"| node_client_files
node_settings -->|"writes images"| node_artist_files
node_profile -->|"reads profile image"| node_client_files
node_home -->|"checks session"| node_session_optional
node_home -->|"includes navigation"| node_header
node_home -->|"includes assets"| node_head_assets
node_home -->|"includes interactions"| node_footer_script
node_search -->|"includes navigation"| node_header
node_search -->|"includes assets"| node_head_assets
node_search -->|"includes interactions"| node_footer_script
node_client_login -->|"includes navigation"| node_header
node_client_login -->|"includes assets"| node_head_assets
node_client_login -->|"includes interactions"| node_footer_script
node_artist_signup -.->|"may use accounts"| node_accounts_db

click node_client_signup "https://github.com/megasush1/iohiki/blob/master/src/signup/index.php"
click node_artist_signup "https://github.com/megasush1/iohiki/blob/master/src/signup/artiste.php"
click node_client_login "https://github.com/megasush1/iohiki/blob/master/src/login/index.php"
click node_artist_login "https://github.com/megasush1/iohiki/blob/master/src/login/artiste.php"
click node_logout "https://github.com/megasush1/iohiki/blob/master/src/logout.php"
click node_session_gate "https://github.com/megasush1/iohiki/blob/master/src/src/phpscript/login_check.php"
click node_session_optional "https://github.com/megasush1/iohiki/blob/master/src/src/phpscript/login_check_no_redirect.php"
click node_auth_helpers "https://github.com/megasush1/iohiki/blob/master/src/src/phpscript/functions.php"
click node_db_connection "https://github.com/megasush1/iohiki/blob/master/src/src/phpscript/connection.php"
click node_accounts_db "https://github.com/megasush1/iohiki/blob/master/src/src/db/create.sql"
click node_home "https://github.com/megasush1/iohiki/blob/master/src/index.php"
click node_search "https://github.com/megasush1/iohiki/blob/master/src/search.php"
click node_discover "https://github.com/megasush1/iohiki/tree/master/src"
click node_events "https://github.com/megasush1/iohiki/tree/master/src"
click node_profile "https://github.com/megasush1/iohiki/blob/master/src/profile/index.php"
click node_settings "https://github.com/megasush1/iohiki/blob/master/src/profile/setting.php"
click node_client_files "https://github.com/megasush1/iohiki/tree/master/src/src/userData"
click node_artist_files "https://github.com/megasush1/iohiki/tree/master/src/src/artisteData"
click node_header "https://github.com/megasush1/iohiki/blob/master/src/src/phpcomponent/header.php"
click node_head_assets "https://github.com/megasush1/iohiki/blob/master/src/src/phpcomponent/head.php"
click node_footer_script "https://github.com/megasush1/iohiki/blob/master/src/src/phpcomponent/foot.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_client_signup,node_artist_signup,node_client_login,node_artist_login,node_logout,node_session_gate,node_session_optional,node_auth_helpers,node_db_connection,node_accounts_db toneBlue
class node_home,node_search,node_discover,node_events toneAmber
class node_profile,node_settings,node_client_files,node_artist_files toneMint
class node_header,node_head_assets,node_footer_script toneRose
class node_visitor toneIndigo
```

## Components

### Accounts

- [Client signup](https://github.com/megasush1/iohiki/blob/master/src/signup/index.php): `src/signup/index.php`
- [Artist signup](https://github.com/megasush1/iohiki/blob/master/src/signup/artiste.php): `src/signup/artiste.php`
- [Client login](https://github.com/megasush1/iohiki/blob/master/src/login/index.php): `src/login/index.php`
- [Artist login](https://github.com/megasush1/iohiki/blob/master/src/login/artiste.php): `src/login/artiste.php`
- [Logout](https://github.com/megasush1/iohiki/blob/master/src/logout.php): `src/logout.php`
- [Session checks](https://github.com/megasush1/iohiki/blob/master/src/src/phpscript/login_check.php): `src/src/phpscript/login_check.php`
- [Optional session check](https://github.com/megasush1/iohiki/blob/master/src/src/phpscript/login_check_no_redirect.php): `src/src/phpscript/login_check_no_redirect.php`
- [Auth helpers](https://github.com/megasush1/iohiki/blob/master/src/src/phpscript/functions.php): `src/src/phpscript/functions.php`
- [SQL connection](https://github.com/megasush1/iohiki/blob/master/src/src/phpscript/connection.php): `src/src/phpscript/connection.php`
- [Account database](https://github.com/megasush1/iohiki/blob/master/src/src/db/create.sql): `src/src/db/create.sql`

### Site pages

- [Home page](https://github.com/megasush1/iohiki/blob/master/src/index.php): `src/index.php`
- [Search page](https://github.com/megasush1/iohiki/blob/master/src/search.php): `src/search.php`
- [Discovery destination](https://github.com/megasush1/iohiki/tree/master/src): `src`
- [Events destination](https://github.com/megasush1/iohiki/tree/master/src): `src`

### Profiles

- [Profile page](https://github.com/megasush1/iohiki/blob/master/src/profile/index.php): `src/profile/index.php`
- [Profile settings](https://github.com/megasush1/iohiki/blob/master/src/profile/setting.php): `src/profile/setting.php`
- [Client images](https://github.com/megasush1/iohiki/tree/master/src/src/userData): `src/src/userData`
- [Artist images](https://github.com/megasush1/iohiki/tree/master/src/src/artisteData): `src/src/artisteData`

### Shared presentation

- [Navigation header](https://github.com/megasush1/iohiki/blob/master/src/src/phpcomponent/header.php): `src/src/phpcomponent/header.php`
- [Page assets](https://github.com/megasush1/iohiki/blob/master/src/src/phpcomponent/head.php): `src/src/phpcomponent/head.php`
- [Footer interactions](https://github.com/megasush1/iohiki/blob/master/src/src/phpcomponent/foot.php): `src/src/phpcomponent/foot.php`

### Other components

- **Visitor**

## Connections

- Visitor → Client signup: registers (evidence: `src/signup/index.php`)
- Visitor → Client login: logs in (evidence: `src/login/index.php`)
- Visitor → Artist login: logs in (evidence: `src/login/artiste.php`)
- Client signup → Optional session check: checks session (evidence: `src/signup/index.php`)
- Client signup → Account database: queries and inserts (evidence: `src/signup/index.php`)
- Client login → Optional session check: checks session (evidence: `src/login/index.php`)
- Client login → Account database: queries account (evidence: `src/login/index.php`)
- Artist login → Optional session check: checks session (evidence: `src/login/artiste.php`)
- Artist login → Account database: queries account (evidence: `src/login/artiste.php`)
- Optional session check → Auth helpers: calls check_login (evidence: `src/src/phpscript/login_check_no_redirect.php`)
- Session checks → Auth helpers: calls check_login (evidence: `src/src/phpscript/login_check.php`)
- Optional session check → SQL connection: includes connection (evidence: `src/src/phpscript/login_check_no_redirect.php`)
- Session checks → SQL connection: includes connection (evidence: `src/src/phpscript/login_check.php`)
- Visitor → Home page: opens (evidence: `src/index.php`)
- Visitor → Search page: searches
- Navigation header → Search page: routes search (evidence: `src/src/phpcomponent/header.php`)
- Navigation header → Discovery destination: links destination (evidence: `src/src/phpcomponent/header.php`)
- Navigation header → Events destination: links destination (evidence: `src/src/phpcomponent/header.php`)
- Profile page → Session checks: checks access (evidence: `src/profile/index.php`)
- Search page → Session checks: checks access (evidence: `src/search.php`)
- Profile settings → Session checks: checks access (evidence: `src/profile/setting.php`)
- Profile settings → Client images: writes images (evidence: `src/profile/setting.php`)
- Profile settings → Artist images: writes images (evidence: `src/profile/setting.php`)
- Profile page → Client images: reads profile image (evidence: `src/profile/index.php`)
- Home page → Optional session check: checks session (evidence: `src/index.php`)
- Home page → Navigation header: includes navigation (evidence: `src/index.php`)
- Home page → Page assets: includes assets (evidence: `src/index.php`)
- Home page → Footer interactions: includes interactions (evidence: `src/index.php`)
- Search page → Navigation header: includes navigation (evidence: `src/search.php`)
- Search page → Page assets: includes assets (evidence: `src/search.php`)
- Search page → Footer interactions: includes interactions (evidence: `src/search.php`)
- Client login → Navigation header: includes navigation (evidence: `src/login/index.php`)
- Client login → Page assets: includes assets (evidence: `src/login/index.php`)
- Client login → Footer interactions: includes interactions (evidence: `src/login/index.php`)
- Artist signup → Account database: may use accounts
