# andr3wsw/pulse architecture

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

- Interactive diagram: https://gitdiagram.com/andr3wsw/pulse
- Repository: https://github.com/andr3wsw/pulse

## Overview

Pulse is a browser-based social app. Users sign up or log in, then use the app to discover people, manage friend requests, participate in global chat, and exchange direct messages; account and profile tools support editing, while moderation surfaces user reports. The client is organized around page-specific JavaScript modules backed by Firebase Authentication and Firestore, with ImageKit used for profile-picture uploads. The map follows explicit imports, calls, and data operations in the excerpts; the README is empty, and the unexcerpted network module’s role is unclear.

Main entry points: [`account.js`](https://github.com/andr3wsw/pulse/blob/main/account.js) (Account Settings), [`app.js`](https://github.com/andr3wsw/pulse/blob/main/app.js) (App Navigation), [`friends.js`](https://github.com/andr3wsw/pulse/blob/main/friends.js) (Friend Tools), [`signup.js`](https://github.com/andr3wsw/pulse/blob/main/signup.js) (Registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and Account"]
  node_signup["Sign Up<br/>[signup.html]"]
  node_signup_logic["Registration<br/>[signup.js]"]
  node_login["Log In<br/>[login.html]"]
  node_login_logic["Sign-In<br/>[login.js]"]
  node_account_page["Account Page<br/>[account.html]"]
  node_account_logic["Account Settings<br/>[account.js]"]
  node_auth_guard["Auth Guard<br/>[auth.js]"]
end

subgraph group_social["Profiles and Friends"]
  node_profile_ui["Profile View<br/>[profile.js]"]
  node_friend_tools["Friend Tools<br/>[friends.js]"]
end

subgraph group_messaging["Messaging"]
  node_global_chat["Global Chat<br/>[chat.js]"]
  node_dm_tools["Direct Messages<br/>[messages.js]"]
end

subgraph group_operations["Moderation"]
  node_moderation_ui["Moderation Page<br/>[app.html]"]
  node_moderation_logic["Report Review<br/>[moderation.js]"]
end

subgraph group_platform["Client and Services"]
  node_app_page["App Shell<br/>[app.html]"]
  node_app_logic["App Navigation<br/>[app.js]"]
  node_landing_logic["Landing Behavior<br/>[main.js]"]
  node_firebase_config["Firebase Setup<br/>[firebase.js]"]
  node_firestore[("Firestore")]
  node_firebase_auth["Firebase Auth"]
  node_imagekit["ImageKit"]
  node_image_auth["Image Auth Worker"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_signup
node_visitor -->|"opens"| node_login
node_signup -->|"submits to"| node_signup_logic
node_login -->|"submits to"| node_login_logic
node_signup_logic -->|"creates account"| node_firebase_auth
node_signup_logic -->|"checks and writes"| node_firestore
node_login_logic -->|"signs in"| node_firebase_auth
node_login_logic -->|"redirects to"| node_app_page
node_account_page -->|"loads"| node_account_logic
node_account_logic -->|"checks access"| node_auth_guard
node_auth_guard -->|"observes session"| node_firebase_auth
node_account_logic -->|"reads and updates"| node_firestore
node_account_logic -->|"requests upload credentials"| node_image_auth
node_account_logic -->|"uploads image"| node_imagekit
node_app_page -->|"loads"| node_app_logic
node_app_logic -->|"checks access"| node_auth_guard
node_app_logic -->|"reads user profile"| node_firestore
node_app_logic -->|"switches page"| node_moderation_ui
node_friend_tools -->|"searches and manages"| node_firestore
node_friend_tools -->|"opens profile"| node_profile_ui
node_friend_tools -->|"opens conversation"| node_dm_tools
node_profile_ui -->|"reads and writes"| node_firestore
node_global_chat -->|"streams and writes"| node_firestore
node_global_chat -->|"opens sender profile"| node_profile_ui
node_dm_tools -->|"streams and writes"| node_firestore
node_moderation_ui -->|"loads"| node_moderation_logic
node_moderation_logic -->|"reads reports and users"| node_firestore
node_firebase_config -->|"initializes"| node_firestore
node_firebase_config -->|"initializes"| node_firebase_auth

click node_signup "https://github.com/andr3wsw/pulse/blob/main/signup.html"
click node_signup_logic "https://github.com/andr3wsw/pulse/blob/main/signup.js"
click node_login "https://github.com/andr3wsw/pulse/blob/main/login.html"
click node_login_logic "https://github.com/andr3wsw/pulse/blob/main/login.js"
click node_account_page "https://github.com/andr3wsw/pulse/blob/main/account.html"
click node_account_logic "https://github.com/andr3wsw/pulse/blob/main/account.js"
click node_auth_guard "https://github.com/andr3wsw/pulse/blob/main/auth.js"
click node_profile_ui "https://github.com/andr3wsw/pulse/blob/main/profile.js"
click node_friend_tools "https://github.com/andr3wsw/pulse/blob/main/friends.js"
click node_global_chat "https://github.com/andr3wsw/pulse/blob/main/chat.js"
click node_dm_tools "https://github.com/andr3wsw/pulse/blob/main/messages.js"
click node_app_page "https://github.com/andr3wsw/pulse/blob/main/app.html"
click node_app_logic "https://github.com/andr3wsw/pulse/blob/main/app.js"
click node_landing_logic "https://github.com/andr3wsw/pulse/blob/main/main.js"
click node_firebase_config "https://github.com/andr3wsw/pulse/blob/main/firebase.js"
click node_moderation_ui "https://github.com/andr3wsw/pulse/blob/main/app.html"
click node_moderation_logic "https://github.com/andr3wsw/pulse/blob/main/moderation.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_signup,node_signup_logic,node_login,node_login_logic,node_account_page,node_account_logic,node_auth_guard toneBlue
class node_profile_ui,node_friend_tools toneAmber
class node_global_chat,node_dm_tools toneMint
class node_moderation_ui,node_moderation_logic toneRose
class node_app_page,node_app_logic,node_landing_logic,node_firebase_config,node_firestore,node_firebase_auth,node_imagekit,node_image_auth,node_visitor toneIndigo
```

## Components

### Identity and Account

- [Sign Up](https://github.com/andr3wsw/pulse/blob/main/signup.html): `signup.html`
- [Registration](https://github.com/andr3wsw/pulse/blob/main/signup.js): `signup.js`
- [Log In](https://github.com/andr3wsw/pulse/blob/main/login.html): `login.html`
- [Sign-In](https://github.com/andr3wsw/pulse/blob/main/login.js): `login.js`
- [Account Page](https://github.com/andr3wsw/pulse/blob/main/account.html): `account.html`
- [Account Settings](https://github.com/andr3wsw/pulse/blob/main/account.js): `account.js`
- [Auth Guard](https://github.com/andr3wsw/pulse/blob/main/auth.js): `auth.js`

### Profiles and Friends

- [Profile View](https://github.com/andr3wsw/pulse/blob/main/profile.js): `profile.js`
- [Friend Tools](https://github.com/andr3wsw/pulse/blob/main/friends.js): `friends.js`

### Messaging

- [Global Chat](https://github.com/andr3wsw/pulse/blob/main/chat.js): `chat.js`
- [Direct Messages](https://github.com/andr3wsw/pulse/blob/main/messages.js): `messages.js`

### Moderation

- [Moderation Page](https://github.com/andr3wsw/pulse/blob/main/app.html): `app.html`
- [Report Review](https://github.com/andr3wsw/pulse/blob/main/moderation.js): `moderation.js`

### Client and Services

- [App Shell](https://github.com/andr3wsw/pulse/blob/main/app.html): `app.html`
- [App Navigation](https://github.com/andr3wsw/pulse/blob/main/app.js): `app.js`
- [Landing Behavior](https://github.com/andr3wsw/pulse/blob/main/main.js): `main.js`
- [Firebase Setup](https://github.com/andr3wsw/pulse/blob/main/firebase.js): `firebase.js`
- **Firestore**
- **Firebase Auth**
- **ImageKit**
- **Image Auth Worker**

### Other components

- **Visitor**

## Connections

- Visitor → Sign Up: opens
- Visitor → Log In: opens
- Sign Up → Registration: submits to
- Log In → Sign-In: submits to
- Registration → Firebase Auth: creates account (evidence: `signup.js`)
- Registration → Firestore: checks and writes (evidence: `signup.js`)
- Sign-In → Firebase Auth: signs in (evidence: `login.js`)
- Sign-In → App Shell: redirects to (evidence: `login.js`)
- Account Page → Account Settings: loads
- Account Settings → Auth Guard: checks access (evidence: `account.js`)
- Auth Guard → Firebase Auth: observes session (evidence: `auth.js`)
- Account Settings → Firestore: reads and updates (evidence: `account.js`)
- Account Settings → Image Auth Worker: requests upload credentials (evidence: `account.js`)
- Account Settings → ImageKit: uploads image (evidence: `account.js`)
- App Shell → App Navigation: loads
- App Navigation → Auth Guard: checks access (evidence: `app.js`)
- App Navigation → Firestore: reads user profile (evidence: `app.js`)
- App Navigation → Moderation Page: switches page (evidence: `app.js`)
- Friend Tools → Firestore: searches and manages (evidence: `friends.js`)
- Friend Tools → Profile View: opens profile (evidence: `friends.js`)
- Friend Tools → Direct Messages: opens conversation (evidence: `friends.js`)
- Profile View → Firestore: reads and writes (evidence: `profile.js`)
- Global Chat → Firestore: streams and writes (evidence: `chat.js`)
- Global Chat → Profile View: opens sender profile (evidence: `chat.js`)
- Direct Messages → Firestore: streams and writes (evidence: `messages.js`)
- Moderation Page → Report Review: loads
- Report Review → Firestore: reads reports and users (evidence: `moderation.js`)
- Firebase Setup → Firestore: initializes (evidence: `firebase.js`)
- Firebase Setup → Firebase Auth: initializes (evidence: `firebase.js`)
