# maaz-319/yapp_web_project architecture

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

- Interactive diagram: https://gitdiagram.com/maaz-319/yapp_web_project
- Repository: https://github.com/maaz-319/yapp_web_project

## Overview

Yapp is a small Twitter-style social app. A signed-in user works through browser pages to an API operation; the PHP endpoints authenticate and validate requests, query or update MySQL, and return JSON for the interface. The graph keeps account access, social actions, and administration distinct, with shared session/database support and tweet presentation as internal layers. README capabilities establish the product branches; source excerpts and the index support the cited implementation links. Frontend request wiring is not sampled, so those links are left unverified.

Main entry points: [`src/common.php`](https://github.com/maaz-319/yapp_web_project/blob/main/src/common.php) (API utilities), [`database/schema.sql`](https://github.com/maaz-319/yapp_web_project/blob/main/database/schema.sql) (MySQL database), [`public/assets/js/api.js`](https://github.com/maaz-319/yapp_web_project/blob/main/public/assets/js/api.js) (API client), [`public/api/feed.php`](https://github.com/maaz-319/yapp_web_project/blob/main/public/api/feed.php) (Home feed)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser interface"]
  node_pages["App pages<br/>[index.html]"]
  node_client_api["API client<br/>[api.js]"]
  node_auth_pages["Access pages<br/>[login.html]"]
end

subgraph group_account["Accounts and access"]
  node_auth_api["Login and registration<br/>[login.php]"]
  node_auth_runtime["Session and RBAC<br/>[common.php]"]
  node_admin_api["Admin accounts<br/>[users.php]"]
end

subgraph group_social["Social features"]
  node_feed_api["Home feed<br/>[feed.php]"]
  node_tweet_api["Post management<br/>[tweets.php]"]
  node_likes_api["Post likes<br/>[like.php]"]
  node_profiles_api["Profiles and posts<br/>[users.php]"]
  node_discovery_api["People search<br/>[search.php]"]
  node_follow_api["Follow actions<br/>[follow.php]"]
  node_connections_api["Connections lists<br/>[followers.php]"]
end

subgraph group_backend["Shared runtime and data"]
  node_tweet_helpers["Post query and view<br/>[tweet_helpers.php]"]
  node_database[("MySQL database<br/>[schema.sql]")]
  node_api_runtime["API utilities<br/>[common.php]"]
end

node_user(("User"))

node_user -->|"uses"| node_pages
node_user -->|"signs in"| node_auth_pages
node_pages -.->|"uses"| node_client_api
node_auth_pages -.->|"uses"| node_client_api
node_client_api -.->|"requests"| node_feed_api
node_client_api -.->|"requests"| node_tweet_api
node_client_api -.->|"requests"| node_auth_api
node_auth_api -->|"uses"| node_api_runtime
node_admin_api -->|"checks access"| node_api_runtime
node_admin_api -->|"reads and writes"| node_database
node_feed_api -->|"authenticates"| node_api_runtime
node_feed_api -->|"reads"| node_database
node_feed_api -->|"formats posts"| node_tweet_helpers
node_tweet_api -->|"authenticates"| node_api_runtime
node_tweet_api -->|"reads and writes"| node_database
node_tweet_api -->|"loads and formats"| node_tweet_helpers
node_likes_api -->|"authenticates"| node_api_runtime
node_likes_api -->|"reads and writes"| node_database
node_profiles_api -->|"uses"| node_api_runtime
node_profiles_api -->|"reads"| node_database
node_discovery_api -->|"authenticates"| node_api_runtime
node_discovery_api -->|"searches"| node_database
node_follow_api -->|"uses"| node_api_runtime
node_follow_api -.->|"reads and writes"| node_database
node_connections_api -->|"reads"| node_database
node_api_runtime -->|"connects"| node_database

click node_pages "https://github.com/maaz-319/yapp_web_project/blob/main/public/index.html"
click node_client_api "https://github.com/maaz-319/yapp_web_project/blob/main/public/assets/js/api.js"
click node_auth_pages "https://github.com/maaz-319/yapp_web_project/blob/main/public/login.html"
click node_auth_api "https://github.com/maaz-319/yapp_web_project/blob/main/public/api/auth/login.php"
click node_auth_runtime "https://github.com/maaz-319/yapp_web_project/blob/main/src/common.php"
click node_admin_api "https://github.com/maaz-319/yapp_web_project/blob/main/public/api/admin/users.php"
click node_feed_api "https://github.com/maaz-319/yapp_web_project/blob/main/public/api/feed.php"
click node_tweet_api "https://github.com/maaz-319/yapp_web_project/blob/main/public/api/tweets.php"
click node_tweet_helpers "https://github.com/maaz-319/yapp_web_project/blob/main/src/tweet_helpers.php"
click node_likes_api "https://github.com/maaz-319/yapp_web_project/blob/main/public/api/tweets/like.php"
click node_profiles_api "https://github.com/maaz-319/yapp_web_project/blob/main/public/api/users.php"
click node_discovery_api "https://github.com/maaz-319/yapp_web_project/blob/main/public/api/users/search.php"
click node_follow_api "https://github.com/maaz-319/yapp_web_project/blob/main/public/api/users/follow.php"
click node_connections_api "https://github.com/maaz-319/yapp_web_project/blob/main/public/api/users/followers.php"
click node_database "https://github.com/maaz-319/yapp_web_project/blob/main/database/schema.sql"
click node_api_runtime "https://github.com/maaz-319/yapp_web_project/blob/main/src/common.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_pages,node_client_api,node_auth_pages,node_user toneBlue
class node_auth_api,node_auth_runtime,node_admin_api toneAmber
class node_feed_api,node_tweet_api,node_likes_api,node_profiles_api,node_discovery_api,node_follow_api,node_connections_api toneMint
class node_tweet_helpers,node_database,node_api_runtime toneRose
```

## Components

### Browser interface

- [App pages](https://github.com/maaz-319/yapp_web_project/blob/main/public/index.html): `public/index.html`
- [API client](https://github.com/maaz-319/yapp_web_project/blob/main/public/assets/js/api.js): `public/assets/js/api.js`
- [Access pages](https://github.com/maaz-319/yapp_web_project/blob/main/public/login.html): `public/login.html`

### Accounts and access

- [Login and registration](https://github.com/maaz-319/yapp_web_project/blob/main/public/api/auth/login.php): `public/api/auth/login.php`
- [Session and RBAC](https://github.com/maaz-319/yapp_web_project/blob/main/src/common.php): `src/common.php`
- [Admin accounts](https://github.com/maaz-319/yapp_web_project/blob/main/public/api/admin/users.php): `public/api/admin/users.php`

### Social features

- [Home feed](https://github.com/maaz-319/yapp_web_project/blob/main/public/api/feed.php): `public/api/feed.php`
- [Post management](https://github.com/maaz-319/yapp_web_project/blob/main/public/api/tweets.php): `public/api/tweets.php`
- [Post likes](https://github.com/maaz-319/yapp_web_project/blob/main/public/api/tweets/like.php): `public/api/tweets/like.php`
- [Profiles and posts](https://github.com/maaz-319/yapp_web_project/blob/main/public/api/users.php): `public/api/users.php`
- [People search](https://github.com/maaz-319/yapp_web_project/blob/main/public/api/users/search.php): `public/api/users/search.php`
- [Follow actions](https://github.com/maaz-319/yapp_web_project/blob/main/public/api/users/follow.php): `public/api/users/follow.php`
- [Connections lists](https://github.com/maaz-319/yapp_web_project/blob/main/public/api/users/followers.php): `public/api/users/followers.php`

### Shared runtime and data

- [Post query and view](https://github.com/maaz-319/yapp_web_project/blob/main/src/tweet_helpers.php): `src/tweet_helpers.php`
- [MySQL database](https://github.com/maaz-319/yapp_web_project/blob/main/database/schema.sql): `database/schema.sql`
- [API utilities](https://github.com/maaz-319/yapp_web_project/blob/main/src/common.php): `src/common.php`

### Other components

- **User**

## Connections

- User → App pages: uses (evidence: `README.md`)
- User → Access pages: signs in (evidence: `README.md`)
- App pages → API client: uses
- Access pages → API client: uses
- API client → Home feed: requests
- API client → Post management: requests
- API client → Login and registration: requests
- Login and registration → API utilities: uses (evidence: `public/api/auth/login.php`)
- Admin accounts → API utilities: checks access (evidence: `public/api/admin/users.php`)
- Admin accounts → MySQL database: reads and writes (evidence: `public/api/admin/users.php`)
- Home feed → API utilities: authenticates (evidence: `public/api/feed.php`)
- Home feed → MySQL database: reads (evidence: `public/api/feed.php`)
- Home feed → Post query and view: formats posts (evidence: `public/api/feed.php`)
- Post management → API utilities: authenticates (evidence: `public/api/tweets.php`)
- Post management → MySQL database: reads and writes (evidence: `public/api/tweets.php`)
- Post management → Post query and view: loads and formats (evidence: `public/api/tweets.php`)
- Post likes → API utilities: authenticates (evidence: `public/api/tweets/like.php`)
- Post likes → MySQL database: reads and writes (evidence: `public/api/tweets/like.php`)
- Profiles and posts → API utilities: uses (evidence: `public/api/users.php`)
- Profiles and posts → MySQL database: reads (evidence: `public/api/users.php`)
- People search → API utilities: authenticates (evidence: `public/api/users/search.php`)
- People search → MySQL database: searches (evidence: `public/api/users/search.php`)
- Follow actions → API utilities: uses (evidence: `public/api/users/follow.php`)
- Follow actions → MySQL database: reads and writes
- Connections lists → MySQL database: reads (evidence: `public/api/users/followers.php`)
- API utilities → MySQL database: connects (evidence: `src/common.php`)
