# iamsayanmanna/content-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/iamsayanmanna/content-management-system
- Repository: https://github.com/iamsayanmanna/content-management-system

## Overview

PenSpace is a web-based CMS for discovering published stories and authoring and managing posts. Its main workflow runs from the home page into author registration or sign-in, then the dashboard and post editor; the frontend services call PHP endpoints, which use session checks and MySQL-backed data. The repository also contains public feature, template, pricing, and resource pages, plus profile management, uploads, and newsletter handling. The README describes the project as in progress, so some capabilities visible in the tree are not confirmed as complete.

Main entry points: [`frontend/src/pages/AuthorDashboard.jsx`](https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/pages/AuthorDashboard.jsx) (Post dashboard), [`frontend/src/HomePage.jsx`](https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/HomePage.jsx) (Home and reading), [`frontend/src/services/authService.js`](https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/services/authService.js) (Auth service), [`frontend/src/App.jsx`](https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/App.jsx) (Route shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["Route shell<br/>[App.jsx]"]
  node_home["Home and reading<br/>[HomePage.jsx]"]
  node_features["Features page<br/>[FeaturesPage.jsx]"]
  node_templates["Templates page<br/>[TemplatesPage.jsx]"]
  node_pricing["Pricing page<br/>[PricingPage.jsx]"]
  node_resources["Resources page<br/>[ResourcesPage.jsx]"]
end

subgraph group_authoring["Author workspace"]
  node_login["Author sign-in<br/>[AuthorLogin.jsx]"]
  node_register["Author registration<br/>[AuthorRegister.jsx]"]
  node_dashboard["Post dashboard"]
  node_profile["Author profile<br/>[AuthorProfile.jsx]"]
  node_create["Post editor<br/>[CreatePost.jsx]"]
  node_richtext["Rich text editor<br/>[RichTextEditor.jsx]"]
  node_authservice["Auth service<br/>[authService.js]"]
  node_postservice["Post service<br/>[postService.js]"]
end

subgraph group_backend["PHP API"]
  node_authapi["Account endpoints"]
  node_postsapi["Post endpoint<br/>[posts.php]"]
  node_otherapi["Profile and uploads"]
  node_newsletter["Newsletter endpoint<br/>[newsletter.php]"]
  node_session["Session checks<br/>[session.php]"]
  node_paymentconfig["Payment config<br/>[payment.php]"]
end

subgraph group_data["Persistence"]
  node_database[("MySQL database<br/>[database.php]")]
end

node_visitor(("Visitor"))
node_author(("Author"))

node_visitor -.->|"browses"| node_home
node_author -.->|"signs in"| node_login
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_features
node_app -->|"routes to"| node_templates
node_app -->|"routes to"| node_pricing
node_app -->|"routes to"| node_resources
node_home -->|"renders"| node_login
node_home -->|"renders"| node_register
node_home -->|"renders"| node_dashboard
node_home -->|"loads posts"| node_postservice
node_login -->|"authenticates via"| node_authservice
node_register -->|"registers via"| node_authservice
node_dashboard -->|"checks session"| node_authservice
node_dashboard -->|"logs out via"| node_authservice
node_dashboard -->|"manages posts"| node_postservice
node_dashboard -->|"renders"| node_profile
node_dashboard -->|"renders"| node_create
node_profile -->|"updates account"| node_authservice
node_create -->|"saves posts"| node_postservice
node_create -->|"uses editor"| node_richtext
node_authservice -->|"sends requests"| node_authapi
node_postservice -->|"sends requests"| node_postsapi
node_authapi -->|"checks session"| node_session
node_authapi -->|"queries authors"| node_database
node_postsapi -->|"checks session"| node_session
node_postsapi -->|"accesses posts"| node_database
node_otherapi -->|"checks session"| node_session
node_otherapi -->|"accesses accounts"| node_database
node_newsletter -->|"stores signup"| node_database

click node_app "https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/App.jsx"
click node_home "https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/HomePage.jsx"
click node_features "https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/pages/FeaturesPage.jsx"
click node_templates "https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/pages/TemplatesPage.jsx"
click node_pricing "https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/pages/PricingPage.jsx"
click node_resources "https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/pages/ResourcesPage.jsx"
click node_login "https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/pages/AuthorLogin.jsx"
click node_register "https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/pages/AuthorRegister.jsx"
click node_dashboard "https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/pages/AuthorDashboard.jsx"
click node_profile "https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/pages/AuthorProfile.jsx"
click node_create "https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/pages/CreatePost.jsx"
click node_richtext "https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/pages/RichTextEditor.jsx"
click node_authservice "https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/services/authService.js"
click node_postservice "https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/services/postService.js"
click node_authapi "https://github.com/iamsayanmanna/content-management-system/tree/main/backend/api"
click node_postsapi "https://github.com/iamsayanmanna/content-management-system/blob/main/backend/api/posts.php"
click node_otherapi "https://github.com/iamsayanmanna/content-management-system/tree/main/backend/api"
click node_newsletter "https://github.com/iamsayanmanna/content-management-system/blob/main/backend/api/newsletter.php"
click node_session "https://github.com/iamsayanmanna/content-management-system/blob/main/backend/session.php"
click node_paymentconfig "https://github.com/iamsayanmanna/content-management-system/blob/main/backend/config/payment.php"
click node_database "https://github.com/iamsayanmanna/content-management-system/blob/main/backend/config/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_app,node_home,node_features,node_templates,node_pricing,node_resources toneBlue
class node_login,node_register,node_dashboard,node_profile,node_create,node_richtext,node_authservice,node_postservice toneAmber
class node_authapi,node_postsapi,node_otherapi,node_newsletter,node_session,node_paymentconfig toneMint
class node_database toneRose
class node_visitor,node_author toneIndigo
```

## Components

### Web application

- [Route shell](https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Home and reading](https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/HomePage.jsx): `frontend/src/HomePage.jsx`
- [Features page](https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/pages/FeaturesPage.jsx): `frontend/src/pages/FeaturesPage.jsx`
- [Templates page](https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/pages/TemplatesPage.jsx): `frontend/src/pages/TemplatesPage.jsx`
- [Pricing page](https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/pages/PricingPage.jsx): `frontend/src/pages/PricingPage.jsx`
- [Resources page](https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/pages/ResourcesPage.jsx): `frontend/src/pages/ResourcesPage.jsx`

### Author workspace

- [Author sign-in](https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/pages/AuthorLogin.jsx): `frontend/src/pages/AuthorLogin.jsx`
- [Author registration](https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/pages/AuthorRegister.jsx): `frontend/src/pages/AuthorRegister.jsx`
- [Post dashboard](https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/pages/AuthorDashboard.jsx): `frontend/src/pages/AuthorDashboard.jsx`
- [Author profile](https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/pages/AuthorProfile.jsx): `frontend/src/pages/AuthorProfile.jsx`
- [Post editor](https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/pages/CreatePost.jsx): `frontend/src/pages/CreatePost.jsx`
- [Rich text editor](https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/pages/RichTextEditor.jsx): `frontend/src/pages/RichTextEditor.jsx`
- [Auth service](https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/services/authService.js): `frontend/src/services/authService.js`
- [Post service](https://github.com/iamsayanmanna/content-management-system/blob/main/frontend/src/services/postService.js): `frontend/src/services/postService.js`

### PHP API

- [Account endpoints](https://github.com/iamsayanmanna/content-management-system/tree/main/backend/api): `backend/api`
- [Post endpoint](https://github.com/iamsayanmanna/content-management-system/blob/main/backend/api/posts.php): `backend/api/posts.php`
- [Profile and uploads](https://github.com/iamsayanmanna/content-management-system/tree/main/backend/api): `backend/api`
- [Newsletter endpoint](https://github.com/iamsayanmanna/content-management-system/blob/main/backend/api/newsletter.php): `backend/api/newsletter.php`
- [Session checks](https://github.com/iamsayanmanna/content-management-system/blob/main/backend/session.php): `backend/session.php`
- [Payment config](https://github.com/iamsayanmanna/content-management-system/blob/main/backend/config/payment.php): `backend/config/payment.php`

### Persistence

- [MySQL database](https://github.com/iamsayanmanna/content-management-system/blob/main/backend/config/database.php): `backend/config/database.php`

### Other components

- **Visitor**
- **Author**

## Connections

- Visitor → Home and reading: browses
- Author → Author sign-in: signs in
- Route shell → Home and reading: routes to (evidence: `frontend/src/App.jsx`)
- Route shell → Features page: routes to (evidence: `frontend/src/App.jsx`)
- Route shell → Templates page: routes to (evidence: `frontend/src/App.jsx`)
- Route shell → Pricing page: routes to (evidence: `frontend/src/App.jsx`)
- Route shell → Resources page: routes to (evidence: `frontend/src/App.jsx`)
- Home and reading → Author sign-in: renders (evidence: `frontend/src/HomePage.jsx`)
- Home and reading → Author registration: renders (evidence: `frontend/src/HomePage.jsx`)
- Home and reading → Post dashboard: renders (evidence: `frontend/src/HomePage.jsx`)
- Home and reading → Post service: loads posts (evidence: `frontend/src/HomePage.jsx`)
- Author sign-in → Auth service: authenticates via (evidence: `frontend/src/pages/AuthorLogin.jsx`)
- Author registration → Auth service: registers via (evidence: `frontend/src/pages/AuthorRegister.jsx`)
- Post dashboard → Auth service: checks session (evidence: `frontend/src/pages/AuthorDashboard.jsx`)
- Post dashboard → Auth service: logs out via (evidence: `frontend/src/pages/AuthorDashboard.jsx`)
- Post dashboard → Post service: manages posts (evidence: `frontend/src/pages/AuthorDashboard.jsx`)
- Post dashboard → Author profile: renders (evidence: `frontend/src/pages/AuthorDashboard.jsx`)
- Post dashboard → Post editor: renders (evidence: `frontend/src/pages/AuthorDashboard.jsx`)
- Author profile → Auth service: updates account (evidence: `frontend/src/pages/AuthorProfile.jsx`)
- Post editor → Post service: saves posts (evidence: `frontend/src/pages/CreatePost.jsx`)
- Post editor → Rich text editor: uses editor (evidence: `frontend/src/pages/CreatePost.jsx`)
- Auth service → Account endpoints: sends requests (evidence: `frontend/src/services/authService.js`)
- Post service → Post endpoint: sends requests (evidence: `frontend/src/services/postService.js`)
- Account endpoints → Session checks: checks session (evidence: `backend/api/auth.php`)
- Account endpoints → MySQL database: queries authors (evidence: `backend/api/auth.php`)
- Post endpoint → Session checks: checks session (evidence: `backend/api/posts.php`)
- Post endpoint → MySQL database: accesses posts (evidence: `backend/api/posts.php`)
- Profile and uploads → Session checks: checks session (evidence: `backend/api/update-profile.php`)
- Profile and uploads → MySQL database: accesses accounts (evidence: `backend/api/update-profile.php`)
- Newsletter endpoint → MySQL database: stores signup (evidence: `backend/api/newsletter.php`)
