# pogg2k5/minisocial_beta architecture

> Architecture diagram of the GitHub repository pogg2k5/minisocial_beta, 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/pogg2k5/minisocial_beta
- Repository: https://github.com/pogg2k5/minisocial_beta

## Overview

Mini Social Network is a React/Django modular-monolith social platform. The main user path runs from authenticated web pages through the shared HTTP client to backend domain services, which read and update social data; media uses a separate object-storage path. Major branches include profiles and friendships, posts and feed, groups, chat/realtime, notifications, authentication, and moderation. The README documents the broader feature set; source excerpts and the index support only selected internal calls, so other links are documented at the product level rather than inferred from folder names.

Main entry points: [`frontend/src/api/client.js`](https://github.com/pogg2k5/minisocial_beta/blob/main/frontend/src/api/client.js) (HTTP client), [`backend/apps/posts/services.py`](https://github.com/pogg2k5/minisocial_beta/blob/main/backend/apps/posts/services.py) (Posts and feed), [`backend/apps/users/services.py`](https://github.com/pogg2k5/minisocial_beta/blob/main/backend/apps/users/services.py) (Profiles and friends), [`backend/common/models.py`](https://github.com/pogg2k5/minisocial_beta/blob/main/backend/common/models.py) (Relational data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web client"]
  node_app["Route shell<br/>[App.jsx]"]
  node_pages["Feature pages"]
  node_http["HTTP client<br/>[client.js]"]
  node_authui["Auth state<br/>[auth.js]"]
  node_wsclient["Realtime hook"]
end

subgraph group_identity["Identity and users"]
  node_auth["Authentication<br/>[services.py]"]
  node_users["Profiles and friends<br/>[services.py]"]
end

subgraph group_social["Social content"]
  node_posts["Posts and feed<br/>[services.py]"]
  node_media["Media processing<br/>[services.py]"]
  node_storage["Object storage<br/>[storage.py]"]
  node_groups["Groups and roles<br/>[services.py]"]
end

subgraph group_realtime["Realtime and alerts"]
  node_chat["Chat service<br/>[services.py]"]
  node_notifications["Notifications<br/>[services.py]"]
end

subgraph group_platform["Shared platform"]
  node_moderation["Moderation<br/>[services.py]"]
  node_events["Event bus<br/>[events.py]"]
  node_redis["Redis utilities<br/>[redis_client.py]"]
  node_database[("Relational data<br/>[models.py]")]
end

node_person(("Member"))
node_objectstore[("S3 / local store")]
node_websocket["WebSocket server"]

node_person -->|"uses"| node_app
node_app -->|"routes to"| node_pages
node_app -->|"restores session"| node_http
node_http -->|"updates session"| node_authui
node_pages -->|"requests API"| node_http
node_http -->|"calls API"| node_auth
node_http -->|"calls API"| node_users
node_http -->|"calls API"| node_posts
node_http -->|"calls API"| node_groups
node_http -->|"calls API"| node_chat
node_http -->|"calls API"| node_notifications
node_http -->|"calls API"| node_moderation
node_posts -->|"uses"| node_media
node_media -->|"stores files"| node_storage
node_storage -->|"writes objects"| node_objectstore
node_posts -->|"reads group data"| node_groups
node_posts -->|"reads user data"| node_users
node_groups -->|"uses user service"| node_users
node_chat -->|"checks relationships"| node_users
node_users -->|"uses auth service"| node_auth
node_users -->|"publishes events"| node_events
node_groups -->|"publishes events"| node_events
node_posts -->|"publishes events"| node_events
node_events -->|"dispatches alerts"| node_notifications
node_chat -->|"tracks presence"| node_redis
node_posts -->|"caches feed"| node_redis
node_wsclient -->|"opens connection"| node_websocket
node_wsclient -->|"reads token"| node_authui
node_wsclient -->|"fetches presence"| node_chat
node_chat -->|"serves realtime"| node_websocket
node_auth -->|"persists identity"| node_database
node_users -->|"persists profiles"| node_database
node_posts -->|"persists content"| node_database
node_groups -->|"persists membership"| node_database
node_chat -->|"persists messages"| node_database
node_notifications -->|"stores alerts"| node_database
node_moderation -->|"records reports"| node_database

click node_app "https://github.com/pogg2k5/minisocial_beta/blob/main/frontend/src/App.jsx"
click node_pages "https://github.com/pogg2k5/minisocial_beta/tree/main/frontend/src/pages"
click node_http "https://github.com/pogg2k5/minisocial_beta/blob/main/frontend/src/api/client.js"
click node_authui "https://github.com/pogg2k5/minisocial_beta/blob/main/frontend/src/store/auth.js"
click node_wsclient "https://github.com/pogg2k5/minisocial_beta/blob/main/frontend/src/hooks/useRealtimeConnection.js"
click node_auth "https://github.com/pogg2k5/minisocial_beta/blob/main/backend/apps/authentication/services.py"
click node_users "https://github.com/pogg2k5/minisocial_beta/blob/main/backend/apps/users/services.py"
click node_posts "https://github.com/pogg2k5/minisocial_beta/blob/main/backend/apps/posts/services.py"
click node_media "https://github.com/pogg2k5/minisocial_beta/blob/main/backend/apps/media_files/services.py"
click node_storage "https://github.com/pogg2k5/minisocial_beta/blob/main/backend/apps/media_files/storage.py"
click node_groups "https://github.com/pogg2k5/minisocial_beta/blob/main/backend/apps/groups/services.py"
click node_chat "https://github.com/pogg2k5/minisocial_beta/blob/main/backend/apps/chat/services.py"
click node_notifications "https://github.com/pogg2k5/minisocial_beta/blob/main/backend/apps/notifications/services.py"
click node_moderation "https://github.com/pogg2k5/minisocial_beta/blob/main/backend/apps/admin_management/services.py"
click node_events "https://github.com/pogg2k5/minisocial_beta/blob/main/backend/common/events.py"
click node_redis "https://github.com/pogg2k5/minisocial_beta/blob/main/backend/common/redis_client.py"
click node_database "https://github.com/pogg2k5/minisocial_beta/blob/main/backend/common/models.py"

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_pages,node_http,node_authui,node_wsclient toneBlue
class node_auth,node_users,node_objectstore toneAmber
class node_posts,node_media,node_storage,node_groups,node_websocket toneMint
class node_chat,node_notifications toneRose
class node_moderation,node_events,node_redis,node_database,node_person toneIndigo
```

## Components

### Web client

- [Route shell](https://github.com/pogg2k5/minisocial_beta/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Feature pages](https://github.com/pogg2k5/minisocial_beta/tree/main/frontend/src/pages): `frontend/src/pages`
- [HTTP client](https://github.com/pogg2k5/minisocial_beta/blob/main/frontend/src/api/client.js): `frontend/src/api/client.js`
- [Auth state](https://github.com/pogg2k5/minisocial_beta/blob/main/frontend/src/store/auth.js): `frontend/src/store/auth.js`
- [Realtime hook](https://github.com/pogg2k5/minisocial_beta/blob/main/frontend/src/hooks/useRealtimeConnection.js): `frontend/src/hooks/useRealtimeConnection.js`

### Identity and users

- [Authentication](https://github.com/pogg2k5/minisocial_beta/blob/main/backend/apps/authentication/services.py): `backend/apps/authentication/services.py`
- [Profiles and friends](https://github.com/pogg2k5/minisocial_beta/blob/main/backend/apps/users/services.py): `backend/apps/users/services.py`

### Social content

- [Posts and feed](https://github.com/pogg2k5/minisocial_beta/blob/main/backend/apps/posts/services.py): `backend/apps/posts/services.py`
- [Media processing](https://github.com/pogg2k5/minisocial_beta/blob/main/backend/apps/media_files/services.py): `backend/apps/media_files/services.py`
- [Object storage](https://github.com/pogg2k5/minisocial_beta/blob/main/backend/apps/media_files/storage.py): `backend/apps/media_files/storage.py`
- [Groups and roles](https://github.com/pogg2k5/minisocial_beta/blob/main/backend/apps/groups/services.py): `backend/apps/groups/services.py`

### Realtime and alerts

- [Chat service](https://github.com/pogg2k5/minisocial_beta/blob/main/backend/apps/chat/services.py): `backend/apps/chat/services.py`
- [Notifications](https://github.com/pogg2k5/minisocial_beta/blob/main/backend/apps/notifications/services.py): `backend/apps/notifications/services.py`

### Shared platform

- [Moderation](https://github.com/pogg2k5/minisocial_beta/blob/main/backend/apps/admin_management/services.py): `backend/apps/admin_management/services.py`
- [Event bus](https://github.com/pogg2k5/minisocial_beta/blob/main/backend/common/events.py): `backend/common/events.py`
- [Redis utilities](https://github.com/pogg2k5/minisocial_beta/blob/main/backend/common/redis_client.py): `backend/common/redis_client.py`
- [Relational data](https://github.com/pogg2k5/minisocial_beta/blob/main/backend/common/models.py): `backend/common/models.py`

### Other components

- **Member**
- **S3 / local store**
- **WebSocket server**

## Connections

- Member → Route shell: uses
- Route shell → Feature pages: routes to (evidence: `frontend/src/App.jsx`)
- Route shell → HTTP client: restores session (evidence: `frontend/src/App.jsx`)
- HTTP client → Auth state: updates session (evidence: `frontend/src/api/client.js`)
- Feature pages → HTTP client: requests API
- HTTP client → Authentication: calls API
- HTTP client → Profiles and friends: calls API
- HTTP client → Posts and feed: calls API
- HTTP client → Groups and roles: calls API
- HTTP client → Chat service: calls API
- HTTP client → Notifications: calls API
- HTTP client → Moderation: calls API
- Posts and feed → Media processing: uses (evidence: `backend/apps/posts/services.py`)
- Media processing → Object storage: stores files (evidence: `backend/apps/media_files/services.py`)
- Object storage → S3 / local store: writes objects (evidence: `backend/apps/media_files/storage.py`)
- Posts and feed → Groups and roles: reads group data (evidence: `backend/apps/posts/services.py`)
- Posts and feed → Profiles and friends: reads user data (evidence: `backend/apps/posts/services.py`)
- Groups and roles → Profiles and friends: uses user service (evidence: `backend/apps/groups/services.py`)
- Chat service → Profiles and friends: checks relationships (evidence: `backend/apps/chat/services.py`)
- Profiles and friends → Authentication: uses auth service (evidence: `backend/apps/users/services.py`)
- Profiles and friends → Event bus: publishes events (evidence: `backend/apps/users/services.py`)
- Groups and roles → Event bus: publishes events (evidence: `backend/apps/groups/services.py`)
- Posts and feed → Event bus: publishes events (evidence: `backend/apps/posts/services.py`)
- Event bus → Notifications: dispatches alerts
- Chat service → Redis utilities: tracks presence
- Posts and feed → Redis utilities: caches feed (evidence: `backend/apps/posts/services.py`)
- Realtime hook → WebSocket server: opens connection (evidence: `frontend/src/hooks/useRealtimeConnection.js`)
- Realtime hook → Auth state: reads token (evidence: `frontend/src/hooks/useRealtimeConnection.js`)
- Realtime hook → Chat service: fetches presence (evidence: `frontend/src/hooks/useRealtimeConnection.js`)
- Chat service → WebSocket server: serves realtime
- Authentication → Relational data: persists identity
- Profiles and friends → Relational data: persists profiles
- Posts and feed → Relational data: persists content
- Groups and roles → Relational data: persists membership
- Chat service → Relational data: persists messages
- Notifications → Relational data: stores alerts
- Moderation → Relational data: records reports
