# boudihamed/urconnection architecture

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

- Interactive diagram: https://gitdiagram.com/boudihamed/urconnection
- Repository: https://github.com/boudihamed/urconnection

## Overview

UrConnection is a social platform for discovering and creating interest-based groups, with authenticated profiles and avatar management. The main user journey is browsing and filtering groups, opening a group, or signing in to create one; signed-in users can also edit their profile and manage their avatar. The graph captures documented profile, storage, and server-state capabilities. Some group hooks and UI internals were not excerpted, so their links rely on SOURCE INDEX references rather than inspected implementations.

Main entry points: [`src/App.jsx`](https://github.com/boudihamed/urconnection/blob/main/src/App.jsx) (Router and guards), [`src/features/profile/components/ProfilePage.jsx`](https://github.com/boudihamed/urconnection/blob/main/src/features/profile/components/ProfilePage.jsx) (Profile management), [`src/features/groups/components/GroupList.jsx`](https://github.com/boudihamed/urconnection/blob/main/src/features/groups/components/GroupList.jsx) (Group list), [`src/services/auth.service.js`](https://github.com/boudihamed/urconnection/blob/main/src/services/auth.service.js) (Auth service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_app["Router and guards<br/>[App.jsx]"]
  node_layout["Main layout<br/>[MainLayout.jsx]"]
  node_query["Query cache<br/>[queryClient.js]"]
end

subgraph group_groups["Group discovery"]
  node_group_list["Group list<br/>[GroupList.jsx]"]
  node_filters["Filter controls<br/>[FilterBar.jsx]"]
  node_filter_cache["Filter cache<br/>[useFilterCache.js]"]
  node_location["Location detection<br/>[useUserLocation.js]"]
  node_group_card["Group card<br/>[GroupCard.jsx]"]
  node_group_detail["Group detail<br/>[GroupDetail.jsx]"]
  node_create_form["Create group form"]
  node_group_hooks["Group data hooks"]
  node_groups_api["Groups API<br/>[groupsApi.js]"]
end

subgraph group_identity["Identity and profiles"]
  node_auth_page["Sign-in and signup<br/>[AuthPage.jsx]"]
  node_session["Session state<br/>[useUser.js]"]
  node_auth_service["Auth service<br/>[auth.service.js]"]
  node_profile["Profile management<br/>[ProfilePage.jsx]"]
  node_profile_hook["Profile updates"]
  node_avatar["Avatar interface<br/>[ProfileAvatar.jsx]"]
  node_avatar_hook["Avatar operations<br/>[useAvatar.js]"]
end

subgraph group_backend["Backend services"]
  node_storage_service["Image compression and storage<br/>[storage.service.js]"]
  node_countries["Country and city data<br/>[countries.js]"]
  node_platforms["Platform definitions<br/>[platforms.js]"]
  node_supabase_client["Supabase client<br/>[supabase.js]"]
end

node_visitor(("Visitor"))
node_supabase[("Supabase Auth, Storage, PostgreSQL")]
node_geolocation["IP geolocation API"]

node_visitor -->|"opens app"| node_app
node_app -->|"routes through"| node_layout
node_app -->|"routes to"| node_group_list
node_app -->|"routes to"| node_group_detail
node_app -->|"guards route"| node_create_form
node_app -->|"guards route"| node_profile
node_app -->|"routes to"| node_auth_page
node_app -->|"reads cache"| node_query
node_group_list -->|"loads groups"| node_group_hooks
node_group_list -->|"renders"| node_filters
node_group_list -->|"renders"| node_group_card
node_group_list -->|"detects location"| node_location
node_group_list -->|"restores filters"| node_filter_cache
node_filters -->|"uses locations"| node_countries
node_filters -->|"uses options"| node_platforms
node_location -->|"matches names"| node_countries
node_location -->|"fetches location"| node_geolocation
node_create_form -->|"creates group"| node_group_hooks
node_create_form -->|"uses locations"| node_countries
node_create_form -->|"uses options"| node_platforms
node_group_card -->|"uses options"| node_platforms
node_group_detail -->|"uses options"| node_platforms
node_group_hooks -->|"calls data API"| node_groups_api
node_groups_api -->|"queries client"| node_supabase_client
node_group_hooks -.->|"uses server cache"| node_query
node_auth_page -->|"performs auth"| node_auth_service
node_session -->|"loads session"| node_auth_service
node_layout -->|"reads user state"| node_session
node_profile -->|"reads session"| node_session
node_profile -->|"loads user groups"| node_group_hooks
node_profile -->|"updates profile"| node_profile_hook
node_profile -->|"signs out"| node_auth_service
node_profile -->|"renders"| node_avatar
node_profile -->|"renders groups"| node_group_card
node_avatar -->|"manages avatar"| node_avatar_hook
node_avatar_hook -->|"calls storage"| node_storage_service
node_profile_hook -->|"updates metadata"| node_auth_service
node_auth_service -->|"uses client"| node_supabase_client
node_storage_service -->|"uploads and updates"| node_supabase_client
node_supabase_client -->|"connects to"| node_supabase
node_auth_service -->|"clears on signout"| node_filter_cache
node_profile -->|"uses locations"| node_countries

click node_app "https://github.com/boudihamed/urconnection/blob/main/src/App.jsx"
click node_layout "https://github.com/boudihamed/urconnection/blob/main/src/GenealComponents/MainLayout.jsx"
click node_query "https://github.com/boudihamed/urconnection/blob/main/src/lib/queryClient.js"
click node_group_list "https://github.com/boudihamed/urconnection/blob/main/src/features/groups/components/GroupList.jsx"
click node_filters "https://github.com/boudihamed/urconnection/blob/main/src/features/groups/components/FilterBar.jsx"
click node_filter_cache "https://github.com/boudihamed/urconnection/blob/main/src/features/groups/hooks/useFilterCache.js"
click node_location "https://github.com/boudihamed/urconnection/blob/main/src/features/groups/hooks/useUserLocation.js"
click node_group_card "https://github.com/boudihamed/urconnection/blob/main/src/features/groups/components/GroupCard.jsx"
click node_group_detail "https://github.com/boudihamed/urconnection/blob/main/src/features/groups/components/GroupDetail.jsx"
click node_create_form "https://github.com/boudihamed/urconnection/blob/main/src/features/groups/components/CreateGroupForm.jsx"
click node_group_hooks "https://github.com/boudihamed/urconnection/tree/main/src/features/groups/hooks"
click node_groups_api "https://github.com/boudihamed/urconnection/blob/main/src/features/groups/api/groupsApi.js"
click node_auth_page "https://github.com/boudihamed/urconnection/blob/main/src/features/auth/components/AuthPage.jsx"
click node_session "https://github.com/boudihamed/urconnection/blob/main/src/features/auth/hooks/useUser.js"
click node_auth_service "https://github.com/boudihamed/urconnection/blob/main/src/services/auth.service.js"
click node_profile "https://github.com/boudihamed/urconnection/blob/main/src/features/profile/components/ProfilePage.jsx"
click node_profile_hook "https://github.com/boudihamed/urconnection/blob/main/src/features/profile/hooks/useUpdateProfile.js"
click node_avatar "https://github.com/boudihamed/urconnection/blob/main/src/features/profile/components/ProfileAvatar.jsx"
click node_avatar_hook "https://github.com/boudihamed/urconnection/blob/main/src/features/profile/hooks/useAvatar.js"
click node_storage_service "https://github.com/boudihamed/urconnection/blob/main/src/services/storage.service.js"
click node_countries "https://github.com/boudihamed/urconnection/blob/main/src/lib/countries.js"
click node_platforms "https://github.com/boudihamed/urconnection/blob/main/src/lib/platforms.js"
click node_supabase_client "https://github.com/boudihamed/urconnection/blob/main/src/lib/supabase.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_layout,node_query toneBlue
class node_group_list,node_filters,node_filter_cache,node_location,node_group_card,node_group_detail,node_create_form,node_group_hooks,node_groups_api,node_supabase toneAmber
class node_auth_page,node_session,node_auth_service,node_profile,node_profile_hook,node_avatar,node_avatar_hook,node_geolocation toneMint
class node_storage_service,node_countries,node_platforms,node_supabase_client toneRose
class node_visitor toneIndigo
```

## Components

### Application shell

- [Router and guards](https://github.com/boudihamed/urconnection/blob/main/src/App.jsx): `src/App.jsx`
- [Main layout](https://github.com/boudihamed/urconnection/blob/main/src/GenealComponents/MainLayout.jsx): `src/GenealComponents/MainLayout.jsx`
- [Query cache](https://github.com/boudihamed/urconnection/blob/main/src/lib/queryClient.js): `src/lib/queryClient.js`

### Group discovery

- [Group list](https://github.com/boudihamed/urconnection/blob/main/src/features/groups/components/GroupList.jsx): `src/features/groups/components/GroupList.jsx`
- [Filter controls](https://github.com/boudihamed/urconnection/blob/main/src/features/groups/components/FilterBar.jsx): `src/features/groups/components/FilterBar.jsx`
- [Filter cache](https://github.com/boudihamed/urconnection/blob/main/src/features/groups/hooks/useFilterCache.js): `src/features/groups/hooks/useFilterCache.js`
- [Location detection](https://github.com/boudihamed/urconnection/blob/main/src/features/groups/hooks/useUserLocation.js): `src/features/groups/hooks/useUserLocation.js`
- [Group card](https://github.com/boudihamed/urconnection/blob/main/src/features/groups/components/GroupCard.jsx): `src/features/groups/components/GroupCard.jsx`
- [Group detail](https://github.com/boudihamed/urconnection/blob/main/src/features/groups/components/GroupDetail.jsx): `src/features/groups/components/GroupDetail.jsx`
- [Create group form](https://github.com/boudihamed/urconnection/blob/main/src/features/groups/components/CreateGroupForm.jsx): `src/features/groups/components/CreateGroupForm.jsx`
- [Group data hooks](https://github.com/boudihamed/urconnection/tree/main/src/features/groups/hooks): `src/features/groups/hooks`
- [Groups API](https://github.com/boudihamed/urconnection/blob/main/src/features/groups/api/groupsApi.js): `src/features/groups/api/groupsApi.js`

### Identity and profiles

- [Sign-in and signup](https://github.com/boudihamed/urconnection/blob/main/src/features/auth/components/AuthPage.jsx): `src/features/auth/components/AuthPage.jsx`
- [Session state](https://github.com/boudihamed/urconnection/blob/main/src/features/auth/hooks/useUser.js): `src/features/auth/hooks/useUser.js`
- [Auth service](https://github.com/boudihamed/urconnection/blob/main/src/services/auth.service.js): `src/services/auth.service.js`
- [Profile management](https://github.com/boudihamed/urconnection/blob/main/src/features/profile/components/ProfilePage.jsx): `src/features/profile/components/ProfilePage.jsx`
- [Profile updates](https://github.com/boudihamed/urconnection/blob/main/src/features/profile/hooks/useUpdateProfile.js): `src/features/profile/hooks/useUpdateProfile.js`
- [Avatar interface](https://github.com/boudihamed/urconnection/blob/main/src/features/profile/components/ProfileAvatar.jsx): `src/features/profile/components/ProfileAvatar.jsx`
- [Avatar operations](https://github.com/boudihamed/urconnection/blob/main/src/features/profile/hooks/useAvatar.js): `src/features/profile/hooks/useAvatar.js`

### Backend services

- [Image compression and storage](https://github.com/boudihamed/urconnection/blob/main/src/services/storage.service.js): `src/services/storage.service.js`
- [Country and city data](https://github.com/boudihamed/urconnection/blob/main/src/lib/countries.js): `src/lib/countries.js`
- [Platform definitions](https://github.com/boudihamed/urconnection/blob/main/src/lib/platforms.js): `src/lib/platforms.js`
- [Supabase client](https://github.com/boudihamed/urconnection/blob/main/src/lib/supabase.js): `src/lib/supabase.js`

### Other components

- **Visitor**
- **Supabase Auth, Storage, PostgreSQL**
- **IP geolocation API**

## Connections

- Visitor → Router and guards: opens app (evidence: `src/App.jsx`)
- Router and guards → Main layout: routes through (evidence: `src/App.jsx`)
- Router and guards → Group list: routes to (evidence: `src/App.jsx`)
- Router and guards → Group detail: routes to (evidence: `src/App.jsx`)
- Router and guards → Create group form: guards route (evidence: `src/App.jsx`)
- Router and guards → Profile management: guards route (evidence: `src/App.jsx`)
- Router and guards → Sign-in and signup: routes to (evidence: `src/App.jsx`)
- Router and guards → Query cache: reads cache (evidence: `src/App.jsx`)
- Group list → Group data hooks: loads groups (evidence: `src/features/groups/components/GroupList.jsx`)
- Group list → Filter controls: renders (evidence: `src/features/groups/components/GroupList.jsx`)
- Group list → Group card: renders (evidence: `src/features/groups/components/GroupList.jsx`)
- Group list → Location detection: detects location (evidence: `src/features/groups/components/GroupList.jsx`)
- Group list → Filter cache: restores filters (evidence: `src/features/groups/components/GroupList.jsx`)
- Filter controls → Country and city data: uses locations (evidence: `src/features/groups/components/FilterBar.jsx`)
- Filter controls → Platform definitions: uses options (evidence: `src/features/groups/components/FilterBar.jsx`)
- Location detection → Country and city data: matches names (evidence: `src/features/groups/hooks/useUserLocation.js`)
- Location detection → IP geolocation API: fetches location (evidence: `src/features/groups/hooks/useUserLocation.js`)
- Create group form → Group data hooks: creates group (evidence: `src/features/groups/components/CreateGroupForm.jsx`)
- Create group form → Country and city data: uses locations (evidence: `src/features/groups/components/CreateGroupForm.jsx`)
- Create group form → Platform definitions: uses options (evidence: `src/features/groups/components/CreateGroupForm.jsx`)
- Group card → Platform definitions: uses options (evidence: `src/features/groups/components/GroupCard.jsx`)
- Group detail → Platform definitions: uses options (evidence: `src/features/groups/components/GroupDetail.jsx`)
- Group data hooks → Groups API: calls data API (evidence: `src/features/groups/hooks/useCreateGroup.js`)
- Groups API → Supabase client: queries client (evidence: `src/features/groups/api/groupsApi.js`)
- Group data hooks → Query cache: uses server cache
- Sign-in and signup → Auth service: performs auth (evidence: `src/features/auth/components/AuthPage.jsx`)
- Session state → Auth service: loads session (evidence: `src/features/auth/hooks/useUser.js`)
- Main layout → Session state: reads user state (evidence: `src/GenealComponents/MainLayout.jsx`)
- Profile management → Session state: reads session (evidence: `src/features/profile/components/ProfilePage.jsx`)
- Profile management → Group data hooks: loads user groups (evidence: `src/features/profile/components/ProfilePage.jsx`)
- Profile management → Profile updates: updates profile (evidence: `src/features/profile/components/ProfilePage.jsx`)
- Profile management → Auth service: signs out (evidence: `src/features/profile/components/ProfilePage.jsx`)
- Profile management → Avatar interface: renders (evidence: `src/features/profile/components/ProfilePage.jsx`)
- Profile management → Group card: renders groups (evidence: `src/features/profile/components/ProfilePage.jsx`)
- Avatar interface → Avatar operations: manages avatar (evidence: `src/features/profile/components/ProfileAvatar.jsx`)
- Avatar operations → Image compression and storage: calls storage (evidence: `src/features/profile/hooks/useAvatar.js`)
- Profile updates → Auth service: updates metadata (evidence: `src/features/profile/hooks/useUpdateProfile.js`)
- Auth service → Supabase client: uses client (evidence: `src/services/auth.service.js`)
- Image compression and storage → Supabase client: uploads and updates (evidence: `src/services/storage.service.js`)
- Supabase client → Supabase Auth, Storage, PostgreSQL: connects to (evidence: `src/lib/supabase.js`)
- Auth service → Filter cache: clears on signout (evidence: `src/services/auth.service.js`)
- Profile management → Country and city data: uses locations (evidence: `src/features/profile/components/ProfilePage.jsx`)
