# vishaals-cloud/photogram architecture

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

- Interactive diagram: https://gitdiagram.com/vishaals-cloud/photogram
- Repository: https://github.com/vishaals-cloud/photogram

## Overview

This is a small PHP website with a static landing/gallery page and signup/login flows backed by MySQL and PHP sessions. The visible signup workflow is page → signup template → User::signup → Database connection. Login rendering is visible, but the login template’s implementation was not excerpted, so its authentication link is not asserted. Mic is included by the shared loader, but no product role is evident in the sampled code.

Main entry points: [`libs/load.php`](https://github.com/vishaals-cloud/photogram/blob/main/libs/load.php) (Shared loader), [`libs/includes/User.class.php`](https://github.com/vishaals-cloud/photogram/blob/main/libs/includes/User.class.php) (User authentication), [`logintest.php`](https://github.com/vishaals-cloud/photogram/blob/main/logintest.php) (Login test endpoint), [`index.php`](https://github.com/vishaals-cloud/photogram/blob/main/index.php) (Landing page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web pages"]
  node_home["Landing page<br/>[index.php]"]
  node_gallery["Photogram gallery<br/>[photogram.php]"]
  node_signup_page["Signup page<br/>[signup.php]"]
  node_login_page["Login page<br/>[login.php]"]
end

subgraph group_auth["Authentication"]
  node_signup_view["Signup form<br/>[_signup.php]"]
  node_login_view["Login form<br/>[_login.php]"]
  node_login_test["Login test endpoint<br/>[logintest.php]"]
  node_user["User authentication<br/>[User.class.php]"]
end

subgraph group_core["Shared runtime"]
  node_database["Database connector<br/>[Database.class.php]"]
  node_loader["Shared loader<br/>[load.php]"]
  node_session["Session manager<br/>[Session.class.php]"]
  node_mic["Mic utility<br/>[Mic.class.php]"]
end

node_visitor(("Visitor"))
node_mysql[("MySQL database")]

node_visitor -->|"opens"| node_home
node_visitor -->|"opens"| node_signup_page
node_visitor -->|"opens"| node_login_page
node_home -->|"includes"| node_loader
node_home -->|"renders"| node_gallery
node_signup_page -->|"includes"| node_loader
node_signup_page -->|"renders"| node_signup_view
node_signup_view -->|"calls signup"| node_user
node_login_page -->|"includes"| node_loader
node_login_page -->|"renders"| node_login_view
node_login_test -->|"includes"| node_loader
node_login_test -->|"calls login"| node_user
node_login_test -->|"uses session"| node_session
node_loader -->|"starts"| node_session
node_loader -->|"includes"| node_mic
node_loader -->|"includes"| node_user
node_loader -->|"includes"| node_database
node_user -->|"gets connection"| node_database
node_database -->|"connects"| node_mysql

click node_home "https://github.com/vishaals-cloud/photogram/blob/main/index.php"
click node_gallery "https://github.com/vishaals-cloud/photogram/blob/main/_templates/photogram.php"
click node_signup_page "https://github.com/vishaals-cloud/photogram/blob/main/signup.php"
click node_signup_view "https://github.com/vishaals-cloud/photogram/blob/main/_templates/_signup.php"
click node_login_page "https://github.com/vishaals-cloud/photogram/blob/main/login.php"
click node_login_view "https://github.com/vishaals-cloud/photogram/blob/main/_templates/_login.php"
click node_login_test "https://github.com/vishaals-cloud/photogram/blob/main/logintest.php"
click node_user "https://github.com/vishaals-cloud/photogram/blob/main/libs/includes/User.class.php"
click node_database "https://github.com/vishaals-cloud/photogram/blob/main/libs/includes/Database.class.php"
click node_loader "https://github.com/vishaals-cloud/photogram/blob/main/libs/load.php"
click node_session "https://github.com/vishaals-cloud/photogram/blob/main/libs/includes/Session.class.php"
click node_mic "https://github.com/vishaals-cloud/photogram/blob/main/libs/includes/Mic.class.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_gallery,node_signup_page,node_login_page toneBlue
class node_signup_view,node_login_view,node_login_test,node_user,node_mysql toneAmber
class node_database,node_loader,node_session,node_mic toneMint
class node_visitor toneIndigo
```

## Components

### Web pages

- [Landing page](https://github.com/vishaals-cloud/photogram/blob/main/index.php): `index.php`
- [Photogram gallery](https://github.com/vishaals-cloud/photogram/blob/main/_templates/photogram.php): `_templates/photogram.php`
- [Signup page](https://github.com/vishaals-cloud/photogram/blob/main/signup.php): `signup.php`
- [Login page](https://github.com/vishaals-cloud/photogram/blob/main/login.php): `login.php`

### Authentication

- [Signup form](https://github.com/vishaals-cloud/photogram/blob/main/_templates/_signup.php): `_templates/_signup.php`
- [Login form](https://github.com/vishaals-cloud/photogram/blob/main/_templates/_login.php): `_templates/_login.php`
- [Login test endpoint](https://github.com/vishaals-cloud/photogram/blob/main/logintest.php): `logintest.php`
- [User authentication](https://github.com/vishaals-cloud/photogram/blob/main/libs/includes/User.class.php): `libs/includes/User.class.php`

### Shared runtime

- [Database connector](https://github.com/vishaals-cloud/photogram/blob/main/libs/includes/Database.class.php): `libs/includes/Database.class.php`
- [Shared loader](https://github.com/vishaals-cloud/photogram/blob/main/libs/load.php): `libs/load.php`
- [Session manager](https://github.com/vishaals-cloud/photogram/blob/main/libs/includes/Session.class.php): `libs/includes/Session.class.php`
- [Mic utility](https://github.com/vishaals-cloud/photogram/blob/main/libs/includes/Mic.class.php): `libs/includes/Mic.class.php`

### Other components

- **Visitor**
- **MySQL database**

## Connections

- Visitor → Landing page: opens (evidence: `index.php`)
- Visitor → Signup page: opens (evidence: `signup.php`)
- Visitor → Login page: opens (evidence: `login.php`)
- Landing page → Shared loader: includes (evidence: `index.php`)
- Landing page → Photogram gallery: renders (evidence: `index.php`)
- Signup page → Shared loader: includes (evidence: `signup.php`)
- Signup page → Signup form: renders (evidence: `signup.php`)
- Signup form → User authentication: calls signup (evidence: `_templates/_signup.php`)
- Login page → Shared loader: includes (evidence: `login.php`)
- Login page → Login form: renders (evidence: `login.php`)
- Login test endpoint → Shared loader: includes (evidence: `logintest.php`)
- Login test endpoint → User authentication: calls login (evidence: `logintest.php`)
- Login test endpoint → Session manager: uses session (evidence: `logintest.php`)
- Shared loader → Session manager: starts (evidence: `libs/load.php`)
- Shared loader → Mic utility: includes (evidence: `libs/load.php`)
- Shared loader → User authentication: includes (evidence: `libs/load.php`)
- Shared loader → Database connector: includes (evidence: `libs/load.php`)
- User authentication → Database connector: gets connection (evidence: `libs/includes/User.class.php`)
- Database connector → MySQL database: connects (evidence: `libs/includes/Database.class.php`)
