# thinkandcodefocus/xalass-web-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/thinkandcodefocus/xalass-web-frontend
- Repository: https://github.com/thinkandcodefocus/xalass-web-frontend

## Overview

Xalass is an anonymous story-sharing social network. Users create or access an UUID-based identity, browse and search posts, then publish stories and interact through reactions and comments; profiles and notifications surface activity. The frontend is vanilla HTML/JavaScript, with `js/api.js` providing the HTTP client and a Laravel backend described in the README. The tree and excerpts do not expose backend internals, so backend capabilities are represented at the documented API boundary; UI-to-client wiring is not shown and is omitted where unverified.

Main entry points: [`Xalass_Backend`](https://github.com/thinkandcodefocus/xalass-web-frontend/tree/main/Xalass_Backend) (Posts API), [`js/api.js`](https://github.com/thinkandcodefocus/xalass-web-frontend/blob/main/js/api.js) (API client), [`xalass-feed.html`](https://github.com/thinkandcodefocus/xalass-web-frontend/blob/main/xalass-feed.html) (Story feed), [`sw.js`](https://github.com/thinkandcodefocus/xalass-web-frontend/blob/main/sw.js) (Offline and push worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and access"]
  node_login["Login page<br/>[xalass-login.html]"]
  node_api["API client<br/>[api.js]"]
  node_auth["Identity API"]
end

subgraph group_stories["Stories and discovery"]
  node_feed["Story feed<br/>[xalass-feed.html]"]
  node_story["Story detail<br/>[xalass-story.html]"]
  node_search["Story search<br/>[xalass-search.html]"]
  node_posts["Posts API"]
  node_moderation["Content moderation<br/>[xalass-v2.js]"]
end

subgraph group_community["Community activity"]
  node_social["Comments and reactions"]
  node_profile["User profile"]
  node_notifications["Notifications page"]
  node_notification_api["Notifications API"]
  node_admin["Admin console<br/>[xalass-admin.html]"]
end

subgraph group_platform["App platform"]
  node_push["Push subscription"]
  node_pwa["Install prompt<br/>[pwa-install.js]"]
  node_worker["Offline and push worker<br/>[sw.js]"]
end

node_person(("Anonymous visitor"))
node_mysql[("MySQL database")]

node_person -->|"starts session"| node_login
node_login -.->|"authenticates"| node_auth
node_api -->|"requests identity"| node_auth
node_api -->|"requests posts"| node_posts
node_api -->|"requests comments"| node_social
node_person -->|"browses stories"| node_feed
node_feed -.->|"loads stories"| node_posts
node_person -->|"opens story"| node_story
node_story -.->|"interacts"| node_social
node_person -->|"searches stories"| node_search
node_search -.->|"filters stories"| node_posts
node_feed -.->|"validates content"| node_moderation
node_person -->|"views profile"| node_profile
node_person -->|"checks activity"| node_notifications
node_notifications -.->|"fetches updates"| node_notification_api
node_person -.->|"manages settings"| node_admin
node_push -->|"registers worker"| node_worker
node_push -->|"submits subscription"| node_notification_api
node_pwa -->|"registers worker"| node_worker
node_worker -->|"shows push alert"| node_person
node_auth -.->|"persists identity"| node_mysql
node_posts -.->|"stores posts"| node_mysql
node_social -.->|"stores interactions"| node_mysql
node_notification_api -.->|"stores notifications"| node_mysql

click node_login "https://github.com/thinkandcodefocus/xalass-web-frontend/blob/main/xalass-login.html"
click node_api "https://github.com/thinkandcodefocus/xalass-web-frontend/blob/main/js/api.js"
click node_auth "https://github.com/thinkandcodefocus/xalass-web-frontend/tree/main/Xalass_Backend"
click node_feed "https://github.com/thinkandcodefocus/xalass-web-frontend/blob/main/xalass-feed.html"
click node_story "https://github.com/thinkandcodefocus/xalass-web-frontend/blob/main/xalass-story.html"
click node_search "https://github.com/thinkandcodefocus/xalass-web-frontend/blob/main/xalass-search.html"
click node_posts "https://github.com/thinkandcodefocus/xalass-web-frontend/tree/main/Xalass_Backend"
click node_moderation "https://github.com/thinkandcodefocus/xalass-web-frontend/blob/main/js/xalass-v2.js"
click node_social "https://github.com/thinkandcodefocus/xalass-web-frontend/tree/main/Xalass_Backend"
click node_profile "https://github.com/thinkandcodefocus/xalass-web-frontend/blob/main/xalass-profile.html"
click node_notifications "https://github.com/thinkandcodefocus/xalass-web-frontend/blob/main/xalass-notifications.html"
click node_notification_api "https://github.com/thinkandcodefocus/xalass-web-frontend/tree/main/Xalass_Backend"
click node_admin "https://github.com/thinkandcodefocus/xalass-web-frontend/blob/main/xalass-admin.html"
click node_push "https://github.com/thinkandcodefocus/xalass-web-frontend/blob/main/js/push-notifications.js"
click node_pwa "https://github.com/thinkandcodefocus/xalass-web-frontend/blob/main/js/pwa-install.js"
click node_worker "https://github.com/thinkandcodefocus/xalass-web-frontend/blob/main/sw.js"

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_login,node_api,node_auth toneBlue
class node_feed,node_story,node_search,node_posts,node_moderation,node_mysql toneAmber
class node_social,node_profile,node_notifications,node_notification_api,node_admin toneMint
class node_push,node_pwa,node_worker toneRose
class node_person toneIndigo
```

## Components

### Identity and access

- [Login page](https://github.com/thinkandcodefocus/xalass-web-frontend/blob/main/xalass-login.html): `xalass-login.html`
- [API client](https://github.com/thinkandcodefocus/xalass-web-frontend/blob/main/js/api.js): `js/api.js`
- [Identity API](https://github.com/thinkandcodefocus/xalass-web-frontend/tree/main/Xalass_Backend): `Xalass_Backend`

### Stories and discovery

- [Story feed](https://github.com/thinkandcodefocus/xalass-web-frontend/blob/main/xalass-feed.html): `xalass-feed.html`
- [Story detail](https://github.com/thinkandcodefocus/xalass-web-frontend/blob/main/xalass-story.html): `xalass-story.html`
- [Story search](https://github.com/thinkandcodefocus/xalass-web-frontend/blob/main/xalass-search.html): `xalass-search.html`
- [Posts API](https://github.com/thinkandcodefocus/xalass-web-frontend/tree/main/Xalass_Backend): `Xalass_Backend`
- [Content moderation](https://github.com/thinkandcodefocus/xalass-web-frontend/blob/main/js/xalass-v2.js): `js/xalass-v2.js`

### Community activity

- [Comments and reactions](https://github.com/thinkandcodefocus/xalass-web-frontend/tree/main/Xalass_Backend): `Xalass_Backend`
- [User profile](https://github.com/thinkandcodefocus/xalass-web-frontend/blob/main/xalass-profile.html): `xalass-profile.html`
- [Notifications page](https://github.com/thinkandcodefocus/xalass-web-frontend/blob/main/xalass-notifications.html): `xalass-notifications.html`
- [Notifications API](https://github.com/thinkandcodefocus/xalass-web-frontend/tree/main/Xalass_Backend): `Xalass_Backend`
- [Admin console](https://github.com/thinkandcodefocus/xalass-web-frontend/blob/main/xalass-admin.html): `xalass-admin.html`

### App platform

- [Push subscription](https://github.com/thinkandcodefocus/xalass-web-frontend/blob/main/js/push-notifications.js): `js/push-notifications.js`
- [Install prompt](https://github.com/thinkandcodefocus/xalass-web-frontend/blob/main/js/pwa-install.js): `js/pwa-install.js`
- [Offline and push worker](https://github.com/thinkandcodefocus/xalass-web-frontend/blob/main/sw.js): `sw.js`

### Other components

- **Anonymous visitor**
- **MySQL database**

## Connections

- Anonymous visitor → Login page: starts session (evidence: `README.md`)
- Login page → Identity API: authenticates
- API client → Identity API: requests identity (evidence: `js/api.js`)
- API client → Posts API: requests posts (evidence: `js/api.js`)
- API client → Comments and reactions: requests comments (evidence: `js/api.js`)
- Anonymous visitor → Story feed: browses stories (evidence: `README.md`)
- Story feed → Posts API: loads stories
- Anonymous visitor → Story detail: opens story (evidence: `README.md`)
- Story detail → Comments and reactions: interacts
- Anonymous visitor → Story search: searches stories (evidence: `README.md`)
- Story search → Posts API: filters stories
- Story feed → Content moderation: validates content
- Anonymous visitor → User profile: views profile (evidence: `README.md`)
- Anonymous visitor → Notifications page: checks activity (evidence: `README.md`)
- Notifications page → Notifications API: fetches updates
- Anonymous visitor → Admin console: manages settings
- Push subscription → Offline and push worker: registers worker (evidence: `js/push-notifications.js`)
- Push subscription → Notifications API: submits subscription (evidence: `js/push-notifications.js`)
- Install prompt → Offline and push worker: registers worker (evidence: `js/pwa-install.js`)
- Offline and push worker → Anonymous visitor: shows push alert (evidence: `sw.js`)
- Identity API → MySQL database: persists identity
- Posts API → MySQL database: stores posts
- Comments and reactions → MySQL database: stores interactions
- Notifications API → MySQL database: stores notifications
