# achour2003/weunity architecture

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

- Interactive diagram: https://gitdiagram.com/achour2003/weunity
- Repository: https://github.com/achour2003/weunity

## Overview

This repository implements a social network: users register and authenticate, complete profiles, discover friends, publish posts, and interact through feeds, comments, likes, chat, and notifications. The React client routes users into these experiences; Java microservices own the domain operations and persistence, with service-to-service HTTP, gRPC, WebSocket, and event integrations. The README is a generic GitLab template and documents no product capabilities. Relationships below are limited to those visible in excerpts or SOURCE INDEX references; unsampled integrations are omitted or marked unverified.

Main entry points: [`FullStackSocialMedia-main/src/App.js`](https://github.com/achour2003/weunity/blob/main/FullStackSocialMedia-main/src/App.js) (Route and session UI), [`feed-service/src/main/java/com/app/feedservice/service/FeedService.java`](https://github.com/achour2003/weunity/blob/main/feed-service/src/main/java/com/app/feedservice/service/FeedService.java) (Feed assembly), [`user-service/src/main/java/com/app/userservice/service/UserProfileService.java`](https://github.com/achour2003/weunity/blob/main/user-service/src/main/java/com/app/userservice/service/UserProfileService.java) (Profile and friendships), [`FullStackSocialMedia-main/src/pages/Profile.jsx`](https://github.com/achour2003/weunity/blob/main/FullStackSocialMedia-main/src/pages/Profile.jsx) (Profile view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Route and session UI<br/>[App.js]"]
  node_feedui["Home feed<br/>[Home.jsx]"]
  node_profileui["Profile view<br/>[Profile.jsx]"]
  node_friendsui["Friends view<br/>[FriendsPage.jsx]"]
  node_chatui["Chat view<br/>[Chat.jsx]"]
  node_wsclient["Message WebSocket client"]
end

subgraph group_identity["Identity and profiles"]
  node_auth["Authentication<br/>[AuthService.java]"]
  node_userdb[("Account records<br/>[User.java]")]
  node_profile["Profile and friendships"]
  node_friendship["Friendship operations"]
end

subgraph group_social["Social content"]
  node_post["Post management<br/>[PostService.java]"]
  node_feed["Feed assembly<br/>[FeedService.java]"]
  node_comments["Comment operations"]
  node_likes["Like operations<br/>[LikeService.java]"]
end

subgraph group_communication["Communication"]
  node_messages["Message operations"]
  node_notifications["Notification consumer"]
end

subgraph group_platform["Service platform"]
  node_gateway["API gateway"]
  node_discovery["Service discovery"]
  node_config["Central configuration"]
end

node_user(("Social network user"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_feedui
node_app -->|"routes to"| node_profileui
node_app -->|"routes to"| node_friendsui
node_app -->|"routes to"| node_chatui
node_app -->|"mounts"| node_wsclient
node_wsclient -.->|"subscribes via WebSocket"| node_messages
node_app -.->|"requests authentication"| node_auth
node_auth -->|"reads and writes"| node_userdb
node_auth -->|"requests profile creation"| node_profile
node_profileui -.->|"loads profile"| node_profile
node_friendsui -.->|"manages friends"| node_friendship
node_friendship -->|"publishes notification"| node_notifications
node_feedui -.->|"loads feed"| node_feed
node_feed -->|"fetches friend IDs"| node_friendship
node_feed -->|"fetches profiles"| node_profile
node_feed -->|"fetches like data"| node_likes
node_profileui -.->|"manages posts"| node_post
node_post -->|"requests comment counts"| node_comments
node_feed -.->|"collects post data"| node_post
node_chatui -.->|"sends and reads"| node_messages
node_messages -->|"looks up user profiles"| node_profile
node_gateway -.->|"resolves services"| node_discovery
node_gateway -.->|"loads configuration"| node_config

click node_app "https://github.com/achour2003/weunity/blob/main/FullStackSocialMedia-main/src/App.js"
click node_feedui "https://github.com/achour2003/weunity/blob/main/FullStackSocialMedia-main/src/pages/Home.jsx"
click node_profileui "https://github.com/achour2003/weunity/blob/main/FullStackSocialMedia-main/src/pages/Profile.jsx"
click node_friendsui "https://github.com/achour2003/weunity/blob/main/FullStackSocialMedia-main/src/pages/FriendsPage.jsx"
click node_chatui "https://github.com/achour2003/weunity/blob/main/FullStackSocialMedia-main/src/pages/Chat.jsx"
click node_wsclient "https://github.com/achour2003/weunity/blob/main/FullStackSocialMedia-main/src/components/webSocketManager.jsx"
click node_auth "https://github.com/achour2003/weunity/blob/main/auth-service/src/main/java/com/app/authservice/service/AuthService.java"
click node_userdb "https://github.com/achour2003/weunity/blob/main/auth-service/src/main/java/com/app/authservice/model/User.java"
click node_profile "https://github.com/achour2003/weunity/blob/main/user-service/src/main/java/com/app/userservice/service/UserProfileService.java"
click node_friendship "https://github.com/achour2003/weunity/blob/main/user-service/src/main/java/com/app/userservice/service/FriendshipService.java"
click node_post "https://github.com/achour2003/weunity/blob/main/post-service/src/main/java/com/app/postservice/service/PostService.java"
click node_feed "https://github.com/achour2003/weunity/blob/main/feed-service/src/main/java/com/app/feedservice/service/FeedService.java"
click node_comments "https://github.com/achour2003/weunity/blob/main/comment-service/src/main/java/com/app/commentservice/service/CommentService.java"
click node_likes "https://github.com/achour2003/weunity/blob/main/like-service/src/main/java/com/app/likeservice/service/LikeService.java"
click node_messages "https://github.com/achour2003/weunity/blob/main/message-service/src/main/java/com/app/messageservice/service/MessageService.java"
click node_notifications "https://github.com/achour2003/weunity/blob/main/notification-servie/src/main/java/com/app/notificationservie/service/NotificationConsumer.java"
click node_gateway "https://github.com/achour2003/weunity/blob/main/gateway-service/src/main/java/com/app/gatewayservice/filter/JwtAuthenticationFilter.java"
click node_discovery "https://github.com/achour2003/weunity/blob/main/discovery-service/src/main/java/com/app/discoveryservice/DiscoveryServiceApplication.java"
click node_config "https://github.com/achour2003/weunity/blob/main/config-service/src/main/java/com/app/configservice/ConfigServiceApplication.java"

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_feedui,node_profileui,node_friendsui,node_chatui,node_wsclient,node_user toneBlue
class node_auth,node_userdb,node_profile,node_friendship toneAmber
class node_post,node_feed,node_comments,node_likes toneMint
class node_messages,node_notifications toneRose
class node_gateway,node_discovery,node_config toneIndigo
```

## Components

### Web client

- [Route and session UI](https://github.com/achour2003/weunity/blob/main/FullStackSocialMedia-main/src/App.js): `FullStackSocialMedia-main/src/App.js`
- [Home feed](https://github.com/achour2003/weunity/blob/main/FullStackSocialMedia-main/src/pages/Home.jsx): `FullStackSocialMedia-main/src/pages/Home.jsx`
- [Profile view](https://github.com/achour2003/weunity/blob/main/FullStackSocialMedia-main/src/pages/Profile.jsx): `FullStackSocialMedia-main/src/pages/Profile.jsx`
- [Friends view](https://github.com/achour2003/weunity/blob/main/FullStackSocialMedia-main/src/pages/FriendsPage.jsx): `FullStackSocialMedia-main/src/pages/FriendsPage.jsx`
- [Chat view](https://github.com/achour2003/weunity/blob/main/FullStackSocialMedia-main/src/pages/Chat.jsx): `FullStackSocialMedia-main/src/pages/Chat.jsx`
- [Message WebSocket client](https://github.com/achour2003/weunity/blob/main/FullStackSocialMedia-main/src/components/webSocketManager.jsx): `FullStackSocialMedia-main/src/components/webSocketManager.jsx`

### Identity and profiles

- [Authentication](https://github.com/achour2003/weunity/blob/main/auth-service/src/main/java/com/app/authservice/service/AuthService.java): `auth-service/src/main/java/com/app/authservice/service/AuthService.java`
- [Account records](https://github.com/achour2003/weunity/blob/main/auth-service/src/main/java/com/app/authservice/model/User.java): `auth-service/src/main/java/com/app/authservice/model/User.java`
- [Profile and friendships](https://github.com/achour2003/weunity/blob/main/user-service/src/main/java/com/app/userservice/service/UserProfileService.java): `user-service/src/main/java/com/app/userservice/service/UserProfileService.java`
- [Friendship operations](https://github.com/achour2003/weunity/blob/main/user-service/src/main/java/com/app/userservice/service/FriendshipService.java): `user-service/src/main/java/com/app/userservice/service/FriendshipService.java`

### Social content

- [Post management](https://github.com/achour2003/weunity/blob/main/post-service/src/main/java/com/app/postservice/service/PostService.java): `post-service/src/main/java/com/app/postservice/service/PostService.java`
- [Feed assembly](https://github.com/achour2003/weunity/blob/main/feed-service/src/main/java/com/app/feedservice/service/FeedService.java): `feed-service/src/main/java/com/app/feedservice/service/FeedService.java`
- [Comment operations](https://github.com/achour2003/weunity/blob/main/comment-service/src/main/java/com/app/commentservice/service/CommentService.java): `comment-service/src/main/java/com/app/commentservice/service/CommentService.java`
- [Like operations](https://github.com/achour2003/weunity/blob/main/like-service/src/main/java/com/app/likeservice/service/LikeService.java): `like-service/src/main/java/com/app/likeservice/service/LikeService.java`

### Communication

- [Message operations](https://github.com/achour2003/weunity/blob/main/message-service/src/main/java/com/app/messageservice/service/MessageService.java): `message-service/src/main/java/com/app/messageservice/service/MessageService.java`
- [Notification consumer](https://github.com/achour2003/weunity/blob/main/notification-servie/src/main/java/com/app/notificationservie/service/NotificationConsumer.java): `notification-servie/src/main/java/com/app/notificationservie/service/NotificationConsumer.java`

### Service platform

- [API gateway](https://github.com/achour2003/weunity/blob/main/gateway-service/src/main/java/com/app/gatewayservice/filter/JwtAuthenticationFilter.java): `gateway-service/src/main/java/com/app/gatewayservice/filter/JwtAuthenticationFilter.java`
- [Service discovery](https://github.com/achour2003/weunity/blob/main/discovery-service/src/main/java/com/app/discoveryservice/DiscoveryServiceApplication.java): `discovery-service/src/main/java/com/app/discoveryservice/DiscoveryServiceApplication.java`
- [Central configuration](https://github.com/achour2003/weunity/blob/main/config-service/src/main/java/com/app/configservice/ConfigServiceApplication.java): `config-service/src/main/java/com/app/configservice/ConfigServiceApplication.java`

### Other components

- **Social network user**

## Connections

- Social network user → Route and session UI: uses
- Route and session UI → Home feed: routes to (evidence: `FullStackSocialMedia-main/src/App.js`)
- Route and session UI → Profile view: routes to (evidence: `FullStackSocialMedia-main/src/App.js`)
- Route and session UI → Friends view: routes to (evidence: `FullStackSocialMedia-main/src/App.js`)
- Route and session UI → Chat view: routes to (evidence: `FullStackSocialMedia-main/src/App.js`)
- Route and session UI → Message WebSocket client: mounts (evidence: `FullStackSocialMedia-main/src/App.js`)
- Message WebSocket client → Message operations: subscribes via WebSocket
- Route and session UI → Authentication: requests authentication
- Authentication → Account records: reads and writes (evidence: `auth-service/src/main/java/com/app/authservice/service/AuthService.java`)
- Authentication → Profile and friendships: requests profile creation (evidence: `auth-service/src/main/java/com/app/authservice/service/AuthService.java`)
- Profile view → Profile and friendships: loads profile
- Friends view → Friendship operations: manages friends
- Friendship operations → Notification consumer: publishes notification (evidence: `user-service/src/main/java/com/app/userservice/service/FriendshipService.java`)
- Home feed → Feed assembly: loads feed
- Feed assembly → Friendship operations: fetches friend IDs (evidence: `feed-service/src/main/java/com/app/feedservice/service/FeedService.java`)
- Feed assembly → Profile and friendships: fetches profiles (evidence: `feed-service/src/main/java/com/app/feedservice/service/FeedService.java`)
- Feed assembly → Like operations: fetches like data (evidence: `feed-service/src/main/java/com/app/feedservice/service/FeedService.java`)
- Profile view → Post management: manages posts
- Post management → Comment operations: requests comment counts (evidence: `post-service/src/main/java/com/app/postservice/service/PostService.java`)
- Feed assembly → Post management: collects post data
- Chat view → Message operations: sends and reads
- Message operations → Profile and friendships: looks up user profiles (evidence: `message-service/src/main/java/com/app/messageservice/service/MessageService.java`)
- API gateway → Service discovery: resolves services
- API gateway → Central configuration: loads configuration
