# aungphyooo182/sr-eimaung-project architecture

> Architecture diagram of the GitHub repository aungphyooo182/sr-eimaung-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aungphyooo182/sr-eimaung-project
- Repository: https://github.com/aungphyooo182/sr-eimaung-project

## Overview

This Laravel application is a small post-and-comment site with a category API. The main workflow routes visitors to a paginated post list or a post detail page; authenticated users can create, edit, and delete posts and add or delete comments, subject to controller middleware and Gate checks. Post views display category, author, and comment data. The excerpts show controller-to-view and route-to-controller links, but not model implementations or framework database wiring, so those relationships are kept at the documented code boundaries.

Main entry points: [`PostController.php`](https://github.com/aungphyooo182/sr-eimaung-project/blob/master/PostController.php) (Post actions), [`web.php`](https://github.com/aungphyooo182/sr-eimaung-project/blob/master/web.php) (Web routes), [`app.blade.php`](https://github.com/aungphyooo182/sr-eimaung-project/blob/master/app.blade.php) (Shared page layout), [`CommentController.php`](https://github.com/aungphyooo182/sr-eimaung-project/blob/master/CommentController.php) (Comment actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Post site"]
  node_routes["Web routes<br/>[web.php]"]
  node_posts["Post actions<br/>[PostController.php]"]
  node_comments["Comment actions"]
  node_layout["Shared page layout<br/>[app.blade.php]"]
  node_postlist["Post listing<br/>[index.blade.php]"]
  node_postview["Post detail<br/>[view.blade.php]"]
  node_postform["Create post form<br/>[add.blade.php]"]
  node_editform["Edit post form<br/>[edit.blade.php]"]
end

subgraph group_api["Category API"]
  node_api_routes["API routes<br/>[api.php]"]
  node_categories["Category actions"]
end

subgraph group_storage["Persistence"]
  node_post_table[("Posts table")]
  node_category_table[("Categories table")]
  node_comment_table[("Comments table")]
end

node_visitor(("Visitor"))
node_member(("Authenticated member"))

node_visitor -->|"requests pages"| node_routes
node_member -->|"submits actions"| node_routes
node_routes -->|"dispatches post routes"| node_posts
node_routes -->|"dispatches comment routes"| node_comments
node_posts -->|"renders listing"| node_postlist
node_posts -->|"renders detail"| node_postview
node_posts -->|"renders create form"| node_postform
node_posts -->|"renders edit form"| node_editform
node_postlist -->|"extends layout"| node_layout
node_postview -->|"extends layout"| node_layout
node_postform -->|"extends layout"| node_layout
node_editform -->|"extends layout"| node_layout
node_api_routes -->|"dispatches category routes"| node_categories
node_posts -.->|"reads and writes posts"| node_post_table
node_categories -.->|"reads and writes categories"| node_category_table
node_comments -.->|"reads and writes comments"| node_comment_table

click node_routes "https://github.com/aungphyooo182/sr-eimaung-project/blob/master/web.php"
click node_posts "https://github.com/aungphyooo182/sr-eimaung-project/blob/master/PostController.php"
click node_comments "https://github.com/aungphyooo182/sr-eimaung-project/blob/master/CommentController.php"
click node_layout "https://github.com/aungphyooo182/sr-eimaung-project/blob/master/app.blade.php"
click node_postlist "https://github.com/aungphyooo182/sr-eimaung-project/blob/master/index.blade.php"
click node_postview "https://github.com/aungphyooo182/sr-eimaung-project/blob/master/view.blade.php"
click node_postform "https://github.com/aungphyooo182/sr-eimaung-project/blob/master/add.blade.php"
click node_editform "https://github.com/aungphyooo182/sr-eimaung-project/blob/master/edit.blade.php"
click node_api_routes "https://github.com/aungphyooo182/sr-eimaung-project/blob/master/api.php"
click node_categories "https://github.com/aungphyooo182/sr-eimaung-project/blob/master/CategoryController.php"
click node_post_table "https://github.com/aungphyooo182/sr-eimaung-project/blob/master/2019_10_01_045614_create_posts_table.php"
click node_category_table "https://github.com/aungphyooo182/sr-eimaung-project/blob/master/2019_10_02_034458_create_categories_table.php"
click node_comment_table "https://github.com/aungphyooo182/sr-eimaung-project/blob/master/2019_10_02_034531_create_comments_table.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_routes,node_posts,node_comments,node_layout,node_postlist,node_postview,node_postform,node_editform toneBlue
class node_api_routes,node_categories toneAmber
class node_post_table,node_category_table,node_comment_table toneMint
class node_visitor,node_member toneIndigo
```

## Components

### Post site

- [Web routes](https://github.com/aungphyooo182/sr-eimaung-project/blob/master/web.php): `web.php`
- [Post actions](https://github.com/aungphyooo182/sr-eimaung-project/blob/master/PostController.php): `PostController.php`
- [Comment actions](https://github.com/aungphyooo182/sr-eimaung-project/blob/master/CommentController.php): `CommentController.php`
- [Shared page layout](https://github.com/aungphyooo182/sr-eimaung-project/blob/master/app.blade.php): `app.blade.php`
- [Post listing](https://github.com/aungphyooo182/sr-eimaung-project/blob/master/index.blade.php): `index.blade.php`
- [Post detail](https://github.com/aungphyooo182/sr-eimaung-project/blob/master/view.blade.php): `view.blade.php`
- [Create post form](https://github.com/aungphyooo182/sr-eimaung-project/blob/master/add.blade.php): `add.blade.php`
- [Edit post form](https://github.com/aungphyooo182/sr-eimaung-project/blob/master/edit.blade.php): `edit.blade.php`

### Category API

- [API routes](https://github.com/aungphyooo182/sr-eimaung-project/blob/master/api.php): `api.php`
- [Category actions](https://github.com/aungphyooo182/sr-eimaung-project/blob/master/CategoryController.php): `CategoryController.php`

### Persistence

- [Posts table](https://github.com/aungphyooo182/sr-eimaung-project/blob/master/2019_10_01_045614_create_posts_table.php): `2019_10_01_045614_create_posts_table.php`
- [Categories table](https://github.com/aungphyooo182/sr-eimaung-project/blob/master/2019_10_02_034458_create_categories_table.php): `2019_10_02_034458_create_categories_table.php`
- [Comments table](https://github.com/aungphyooo182/sr-eimaung-project/blob/master/2019_10_02_034531_create_comments_table.php): `2019_10_02_034531_create_comments_table.php`

### Other components

- **Visitor**
- **Authenticated member**

## Connections

- Visitor → Web routes: requests pages (evidence: `web.php`)
- Authenticated member → Web routes: submits actions (evidence: `web.php`)
- Web routes → Post actions: dispatches post routes (evidence: `web.php`)
- Web routes → Comment actions: dispatches comment routes (evidence: `web.php`)
- Post actions → Post listing: renders listing (evidence: `PostController.php`)
- Post actions → Post detail: renders detail (evidence: `PostController.php`)
- Post actions → Create post form: renders create form (evidence: `PostController.php`)
- Post actions → Edit post form: renders edit form (evidence: `PostController.php`)
- Post listing → Shared page layout: extends layout (evidence: `index.blade.php`)
- Post detail → Shared page layout: extends layout (evidence: `view.blade.php`)
- Create post form → Shared page layout: extends layout (evidence: `add.blade.php`)
- Edit post form → Shared page layout: extends layout (evidence: `edit.blade.php`)
- API routes → Category actions: dispatches category routes (evidence: `api.php`)
- Post actions → Posts table: reads and writes posts
- Category actions → Categories table: reads and writes categories
- Comment actions → Comments table: reads and writes comments
