# tinashe2023/the-guru-mobile-hub architecture

> Architecture diagram of the GitHub repository tinashe2023/the-guru-mobile-hub, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tinashe2023/the-guru-mobile-hub
- Repository: https://github.com/tinashe2023/the-guru-mobile-hub

## Overview

Guru Mobile Hub is a customer-and-admin portal for account access and mobile-hub services, with a web client backed by an Express API and real-time chat. The user workflow is to enter through the landing or sign-in experience, authenticate, then use the protected dashboard to browse services and products or manage tickets, chat, profile, and documents. Server route coverage also includes shop, announcements, and passkeys. The README is empty; links among unsampled feature handlers and their data stores are therefore not inferred.

Main entry points: [`server/server.js`](https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/server.js) (HTTP server), [`client/src/App.jsx`](https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/client/src/App.jsx) (Routes and guards), [`server/routes/auth.js`](https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/routes/auth.js) (Authentication API), [`server/config/db.js`](https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/config/db.js) (PostgreSQL)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Routes and guards<br/>[App.jsx]"]
  node_authctx["Auth state<br/>[AuthContext.jsx]"]
  node_api["HTTP client<br/>[api.js]"]
  node_socketctx["Socket state<br/>[SocketContext.jsx]"]
  node_login["Login and signup<br/>[LoginPage.jsx]"]
  node_dashboard["Dashboard<br/>[DashboardPage.jsx]"]
  node_servicesui["Services catalog<br/>[ServicesPage.jsx]"]
  node_ticketsui["Tickets<br/>[TicketsPage.jsx]"]
  node_chatui["Live chat<br/>[ChatPage.jsx]"]
  node_documentsui["Documents<br/>[DocumentsPage.jsx]"]
  node_productsui["Products<br/>[ProductsPage.jsx]"]
end

subgraph group_identity["Identity"]
  node_authroutes["Authentication API<br/>[auth.js]"]
  node_webauthn["Passkey API<br/>[webauthn.js]"]
  node_authmw["JWT authorization<br/>[auth.js]"]
end

subgraph group_hub["Hub features"]
  node_serviceroutes["Services API<br/>[services.js]"]
  node_shoproutes["Shop API<br/>[shop.js]"]
  node_productroutes["Products API<br/>[products.js]"]
  node_ticketroutes["Tickets API<br/>[tickets.js]"]
  node_docroutes["Documents API<br/>[documents.js]"]
  node_chatroutes["Chat API<br/>[chat.js]"]
  node_announcements["Announcements API<br/>[announcements.js]"]
  node_usersroutes["User API<br/>[users.js]"]
end

subgraph group_server["API and realtime"]
  node_serverentry["HTTP server<br/>[server.js]"]
  node_socketserver["Realtime handlers<br/>[index.js]"]
end

subgraph group_storage["Data and files"]
  node_db[("PostgreSQL<br/>[db.js]")]
  node_objectstore[("Backblaze B2")]
end

node_visitor(("Visitor or member"))
node_google(("Google OAuth"))

node_visitor -->|"opens"| node_app
node_app -->|"routes to"| node_login
node_app -->|"guards and routes"| node_dashboard
node_app -->|"routes to"| node_servicesui
node_app -->|"routes to"| node_ticketsui
node_app -->|"routes to"| node_chatui
node_app -->|"routes to"| node_documentsui
node_app -->|"routes to"| node_productsui
node_app -->|"checks access"| node_authctx
node_authctx -->|"calls"| node_api
node_servicesui -->|"calls"| node_api
node_api -->|"HTTP requests"| node_serverentry
node_socketctx -->|"Socket.IO connection"| node_socketserver
node_serverentry -->|"mounts"| node_authroutes
node_serverentry -->|"mounts"| node_webauthn
node_serverentry -->|"mounts"| node_serviceroutes
node_serverentry -->|"mounts"| node_shoproutes
node_serverentry -->|"mounts"| node_productroutes
node_serverentry -->|"mounts"| node_ticketroutes
node_serverentry -->|"mounts"| node_docroutes
node_serverentry -->|"mounts"| node_chatroutes
node_serverentry -->|"mounts"| node_announcements
node_serverentry -->|"mounts"| node_usersroutes
node_serverentry -->|"configures handlers"| node_socketserver
node_authroutes -->|"authenticates"| node_authmw
node_serviceroutes -->|"protects updates"| node_authmw
node_authroutes -->|"queries users"| node_db
node_authmw -->|"loads user"| node_db
node_serviceroutes -->|"reads and updates"| node_db
node_socketserver -->|"queries and updates"| node_db
node_authroutes -->|"signs avatar URL"| node_objectstore
node_google -.->|"OAuth exchange"| node_authroutes

click node_app "https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/client/src/App.jsx"
click node_authctx "https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/client/src/contexts/AuthContext.jsx"
click node_api "https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/client/src/services/api.js"
click node_socketctx "https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/client/src/contexts/SocketContext.jsx"
click node_login "https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/client/src/pages/LoginPage.jsx"
click node_dashboard "https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/client/src/pages/DashboardPage.jsx"
click node_servicesui "https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/client/src/pages/ServicesPage.jsx"
click node_ticketsui "https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/client/src/pages/TicketsPage.jsx"
click node_chatui "https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/client/src/pages/ChatPage.jsx"
click node_documentsui "https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/client/src/pages/DocumentsPage.jsx"
click node_productsui "https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/client/src/pages/ProductsPage.jsx"
click node_authroutes "https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/routes/auth.js"
click node_webauthn "https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/routes/webauthn.js"
click node_authmw "https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/middleware/auth.js"
click node_serverentry "https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/server.js"
click node_serviceroutes "https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/routes/services.js"
click node_shoproutes "https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/routes/shop.js"
click node_productroutes "https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/routes/products.js"
click node_ticketroutes "https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/routes/tickets.js"
click node_docroutes "https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/routes/documents.js"
click node_chatroutes "https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/routes/chat.js"
click node_announcements "https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/routes/announcements.js"
click node_usersroutes "https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/routes/users.js"
click node_socketserver "https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/sockets/index.js"
click node_db "https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/config/db.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_app,node_authctx,node_api,node_socketctx,node_login,node_dashboard,node_servicesui,node_ticketsui,node_chatui,node_documentsui,node_productsui toneBlue
class node_authroutes,node_webauthn,node_authmw toneAmber
class node_serviceroutes,node_shoproutes,node_productroutes,node_ticketroutes,node_docroutes,node_chatroutes,node_announcements,node_usersroutes toneMint
class node_serverentry,node_socketserver toneRose
class node_db,node_objectstore,node_visitor,node_google toneIndigo
```

## Components

### Web client

- [Routes and guards](https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Auth state](https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/client/src/contexts/AuthContext.jsx): `client/src/contexts/AuthContext.jsx`
- [HTTP client](https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/client/src/services/api.js): `client/src/services/api.js`
- [Socket state](https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/client/src/contexts/SocketContext.jsx): `client/src/contexts/SocketContext.jsx`
- [Login and signup](https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/client/src/pages/LoginPage.jsx): `client/src/pages/LoginPage.jsx`
- [Dashboard](https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/client/src/pages/DashboardPage.jsx): `client/src/pages/DashboardPage.jsx`
- [Services catalog](https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/client/src/pages/ServicesPage.jsx): `client/src/pages/ServicesPage.jsx`
- [Tickets](https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/client/src/pages/TicketsPage.jsx): `client/src/pages/TicketsPage.jsx`
- [Live chat](https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/client/src/pages/ChatPage.jsx): `client/src/pages/ChatPage.jsx`
- [Documents](https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/client/src/pages/DocumentsPage.jsx): `client/src/pages/DocumentsPage.jsx`
- [Products](https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/client/src/pages/ProductsPage.jsx): `client/src/pages/ProductsPage.jsx`

### Identity

- [Authentication API](https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/routes/auth.js): `server/routes/auth.js`
- [Passkey API](https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/routes/webauthn.js): `server/routes/webauthn.js`
- [JWT authorization](https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/middleware/auth.js): `server/middleware/auth.js`

### Hub features

- [Services API](https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/routes/services.js): `server/routes/services.js`
- [Shop API](https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/routes/shop.js): `server/routes/shop.js`
- [Products API](https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/routes/products.js): `server/routes/products.js`
- [Tickets API](https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/routes/tickets.js): `server/routes/tickets.js`
- [Documents API](https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/routes/documents.js): `server/routes/documents.js`
- [Chat API](https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/routes/chat.js): `server/routes/chat.js`
- [Announcements API](https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/routes/announcements.js): `server/routes/announcements.js`
- [User API](https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/routes/users.js): `server/routes/users.js`

### API and realtime

- [HTTP server](https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/server.js): `server/server.js`
- [Realtime handlers](https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/sockets/index.js): `server/sockets/index.js`

### Data and files

- [PostgreSQL](https://github.com/tinashe2023/the-guru-mobile-hub/blob/main/server/config/db.js): `server/config/db.js`
- **Backblaze B2**

### Other components

- **Visitor or member**
- **Google OAuth**

## Connections

- Visitor or member → Routes and guards: opens
- Routes and guards → Login and signup: routes to
- Routes and guards → Dashboard: guards and routes
- Routes and guards → Services catalog: routes to
- Routes and guards → Tickets: routes to
- Routes and guards → Live chat: routes to
- Routes and guards → Documents: routes to
- Routes and guards → Products: routes to
- Routes and guards → Auth state: checks access
- Auth state → HTTP client: calls
- Services catalog → HTTP client: calls
- HTTP client → HTTP server: HTTP requests
- Socket state → Realtime handlers: Socket.IO connection
- HTTP server → Authentication API: mounts
- HTTP server → Passkey API: mounts
- HTTP server → Services API: mounts
- HTTP server → Shop API: mounts
- HTTP server → Products API: mounts
- HTTP server → Tickets API: mounts
- HTTP server → Documents API: mounts
- HTTP server → Chat API: mounts
- HTTP server → Announcements API: mounts
- HTTP server → User API: mounts
- HTTP server → Realtime handlers: configures handlers
- Authentication API → JWT authorization: authenticates
- Services API → JWT authorization: protects updates
- Authentication API → PostgreSQL: queries users
- JWT authorization → PostgreSQL: loads user
- Services API → PostgreSQL: reads and updates
- Realtime handlers → PostgreSQL: queries and updates
- Authentication API → Backblaze B2: signs avatar URL
- Google OAuth → Authentication API: OAuth exchange
