# openalice-social

> Discord-style chat + voice frontend (Next.js 16 + React 19) for the OpenAlice social layer.

## At a glance
| field | value |
|---|---|
| kind | `product` |
| priority | `P1` |
| default branch | `mvp` |
| last activity | 2026-07-06T03:19:00+00:00 |
| features catalogued | **44** |
| runtime deps declared | **4** |

## Manifest
`.atlas-deps.yml` — parsed cleanly: **yes**

### Runtime deps
- **`openalice-auth`** · `http` · via `NEXT_PUBLIC_API_URL (AuthProvider)` — SSO — AuthProvider validates oa_session JWTs and issues the shared OpenAliceClient.
- **`openalice-social-api`** · `http` · via `NEXT_PUBLIC_API_URL` — All CRUD: servers, channels, messages, friends, DMs, file uploads, presence, push subscriptions.
- **`openalice-voice`** · `ws` · via `VOICE_WS_URL (wss://voice.blal.pro/ws)` — P2P-mesh WebRTC signalling — join/leave rooms, relay ICE/SDP between peers.
- **`openalice-cdn`** · `http` · via `NEXT_PUBLIC_API_URL (upload path)` · _optional_ — Serve uploaded files and user avatars returned as URLs from social-api.

### Consumed env
- `NEXT_PUBLIC_API_URL`
- `NEXT_PUBLIC_VAPID_PUBLIC_KEY`
- `NEXT_PUBLIC_TURN_URLS`
- `NEXT_PUBLIC_TURN_USERNAME`
- `NEXT_PUBLIC_TURN_CREDENTIAL`
- `NEXT_PUBLIC_USE_MOCKS`

### Exposes
- `docker_image` — openalice-social-web
- `http_endpoint` — https://social.blal.pro

## Env drift

**Code reads, manifest omits (18):**
- `AUTH_INTERNAL_URL`
- `DATABASE_URL`
- `E2E_BASE_URL`
- `INTERNAL_BROADCAST_SECRET`
- `JWT_SECRET`
- `NEXT_PUBLIC_AUTH_URL`
- `NEXT_PUBLIC_WORLD_URL`
- `OPENALICE_AUTH_URL`
- `PLATFORM_DB_PASSWORD`
- `S3_ENDPOINT`
- `S3_PUBLIC_URL`
- `S3_UPLOAD_PREFIX`
- `SOCIAL_API_PORT`
- `UPDATES_DATA_DIR`
- `UPLOAD_DIR`
- `UPLOAD_MAX_SIZE`
- `UPLOAD_URL_PREFIX`
- `VOICE_SFU_URL`

## Live reachability
- last probe: **down** · `https://social.blal.pro` · HTTP 404 · 35ms
- uptime 24h: **0.0%**

## Features (44)

### social/agents
- **`social.agents.add-dialog`** — Dialog for adding an AI agent to a server. Configures agent URL, trigger keywords, target channels, and optional vision capture (frame interval, quality, collage mode). Persists agent list to localStorage under openalice:agents:{serverId}.  
  *social-web/src/components/social/AddAgentDialog.tsx:1*
- **`social.agents.card`** — Agent management card in the server agents list. Shows name, online/offline status, trigger keywords, assigned channels, vision config summary, and configure/remove actions.  
  *social-web/src/components/social/AgentCard.tsx:1*
- **`social.agents.mention-badge`** — Inline badge rendered inside message content when a @agent name is detected. Visually distinguishes agent mentions from user mentions with a Bot icon.  
  *social-web/src/components/social/AgentMentionBadge.tsx:1*
- **`social.agents.mention-detection`** — Reads agent names from localStorage (openalice:agents:{serverId} keys) and exposes useAgentReactions to detect @agent mentions in outgoing messages. Used by MessageInput to auto-trigger agent reply flows.  
  *social-web/src/hooks/useAgentReactions.ts:1*

### social/api
- **`social.api.client`** — Thin re-export of OpenAliceClient from @openalicelabs/sdk (promoted from a local 780-line copy in sdk 0.4.0). All server/channel/friend/DM/agent CRUD calls flow through this client, authenticated via localStorage JWT.  
  *social-web/src/lib/sdk-client.ts:1*
- **`social.api.hooks`** — Async data-fetching hooks built on @openalicelabs/sdk: useMe, useServers, useServer, useServerMembers, useChannels, useFriends, useDmChannels, useDmMessages, useRoles, usePublicUser. Each wraps a generic useAsync helper with loading/error/refetch state.  
  *social-web/src/hooks/useSocial.ts:1*
- **`social.api.types`** — Re-export of all Rust-API wire types from @openalicelabs/sdk. Covers Server, Channel, ChannelMessage, DmChannel, DmMessage, Friendship, PublicUser, Role, Webhook, Invite, IncomingCallEvent, SearchResult, and more.  
  *social-web/src/lib/sdk-types.ts:1*

### social/calls
- **`social.calls.controls`** — In-call control bar with mute/unmute, camera on/off, screen-share toggle, and hang-up button. Rendered inside the active-call panel during a DM voice call.  
  *social-web/src/components/social/CallControls.tsx:1*
- **`social.calls.dm-voice`** — 1-on-1 DM voice call lifecycle hook. Handles incoming call events from the platform WS (incoming_call, call_accepted, call_declined, call_ended, call_missed), exposes initiateCall/acceptCall/declineCall/endCall, and tracks callDuration.  
  *social-web/src/hooks/useCall.ts:1*
- **`social.calls.incoming-overlay`** — Floating incoming-call notification overlay. Plays a procedural Web Audio ringtone (oscillator, no audio file), shows caller name/avatar, and exposes accept/decline buttons wired to useCall accept/declineCall.  
  *social-web/src/components/social/CallOverlay.tsx:1*

### social/channels
- **`social.channels.header`** — Channel top bar showing channel name, topic, pinned-message count, member-list toggle, global search trigger, and channel settings modal access. Adapts between text-channel and DM contexts.  
  *social-web/src/components/social/ChannelHeader.tsx:1*
- **`social.channels.member-list`** — Right-rail member panel. Groups members by role (Admin, Moderator, Member, Bot), shows online/idle/dnd/invisible status dots, supports kick/ban via confirm dialog, and opens UserCard popover on click. Virtualized via ScrollArea.  
  *social-web/src/components/social/MemberList.tsx:1*
- **`social.channels.settings`** — Per-channel settings modal. Covers channel name/topic edit, NSFW toggle, per-role permission overrides (view/send/manage), and channel delete. Supports both text and voice channel types.  
  *social-web/src/components/social/ChannelSettings.tsx:1*
- **`social.channels.sidebar`** — Per-server channel list sidebar. Groups channels by category (Text/Voice), shows voice-channel occupancy via useVoiceRoomParticipants, renders unread badges, exposes mute toggles, and hosts the voice-control footer (mute/deafen/leave).  
  *social-web/src/components/social/ChannelSidebar.tsx:1*

### social/chat
- **`social.chat.emoji-picker`** — Full emoji picker with category tabs, search, recent-emoji tracking, and skin-tone modifier. Lazy-loaded via next/dynamic to keep the initial bundle light. Used by both MessageInput (send emoji) and MessageArea (add reaction).  
  *social-web/src/components/social/EmojiPicker.tsx:1*
- **`social.chat.link-embed`** — Auto-fetches OpenGraph metadata for URLs in messages via the social-api /og endpoint and renders title/description/image previews inline beneath the message.  
  *social-web/src/components/social/LinkEmbed.tsx:1*
- **`social.chat.message-area`** — Virtualised message list with infinite scroll / load-more, read-receipt marking, reaction picker (EmojiPicker lazy-loaded), reply-to preview, message edit/delete context menu, typing indicator, link embeds, attachment thumbnails, thread open, and user-card popover on avatar click.  
  *social-web/src/components/social/MessageArea.tsx:1*
- **`social.chat.message-input`** — Rich message composer with typing-indicator debounce (wsSendTyping), reply-to banner, emoji/GIF/sticker pickers (all lazy-loaded), file attachment button, scheduled-send (clock picker), unsent-message queue to localStorage on failure, and keyboard shortcut to edit last own message.  
  *social-web/src/components/social/MessageInput.tsx:1*
- **`social.chat.thread-sidebar`** — Slide-in thread panel for channel message replies. Loads thread history from API, subscribes to real-time APPEND_THREAD_MESSAGE actions, and renders a compact message + reply composer. Closes via CLOSE_THREAD action.  
  *social-web/src/components/social/ThreadSidebar.tsx:1*

### social/friends
- **`social.friends.list`** — Friends panel with All / Online / Pending / Blocked tabs. Supports add-friend by username#discriminator, accept/decline incoming requests, remove friends, and open DM directly from the friend entry. Filters by search query.  
  *social-web/src/components/social/FriendsContent.tsx:1*
- **`social.friends.request`** · _stable_ · since 0.1.0 — Send a friend request to another user — they accept or decline.  
  *social-api/src/routes/friends.rs:12*

### social/layout
- **`social.layout.root`** — Top-level shell that mounts SocialContext provider, bootstraps API data (servers, channels, DMs, friends), wires usePlatformWs and useNotifications, and renders the three-panel layout (ServerBar + ChannelSidebar + main content area) with global search, call overlay, toast, and persona sidebar.  
  *social-web/src/components/social/SocialLayout.tsx:1*

### social/messaging
- **`social.dms.create`** · _stable_ · since 0.1.0 — Create a 1:1 or group DM channel between two or more users.  
  *social-api/src/routes/dms.rs:14*
- **`social.messages.search`** · _stable_ · since 0.1.0 — Case-insensitive content search within a channel, paged by limit.  
  *social-api/src/routes/messages.rs:13*
- **`social.messages.send`** · _stable_ · since 0.1.0 — Send a message into a server channel — broadcast over WebSocket to channel subscribers.  
  *social-api/src/routes/messages.rs:282*

### social/moderation
- **`social.moderation.capability-matrix`** — Static reference matrix that surfaces which chat-moderation capabilities are available on which platform. Replaces the old transient "not supported here" runtime toast with a persistent, scannable table so moderators can see the full support picture at a glance instead of discovering limits by trial.  
  *social-web/src/components/social/ModerationCapabilityMatrix.tsx:1*

### social/notifications
- **`social.notifications.push`** — Browser push notification hook. Subscribes to Web Push via service worker, sends subscription to API, and fires desktop notifications + optional sound on incoming messages when the tab is backgrounded or blurred.  
  *social-web/src/hooks/useNotifications.ts:1*

### social/presence
- **`social.presence.user-card`** — Hover/click popover showing user avatar, display name, status, custom status text, join date, and shared servers. Actions: send DM, add/remove friend, view full profile. Rendered via portal to escape z-index stacking contexts.  
  *social-web/src/components/social/UserCard.tsx:1*

### social/realtime
- **`social.realtime.platform-ws`** · _stable_ · since 0.1.0 — Realtime WebSocket bridging messages, typing, presence, pins, reactions, calls into the social store.  
  *social-web/src/hooks/usePlatformWs.ts:595*
- **`social.realtime.ws`** · _stable_ · since 0.1.0 — WebSocket gateway pushing channel events (message, edit, delete, presence) with JWT auth.  
  *social-api/src/ws.rs:222*

### social/servers
- **`social.channels.create`** · _stable_ · since 0.1.0 — Create a text/voice/announcement channel inside a server.  
  *social-api/src/routes/channels.rs:14*
- **`social.servers.bar`** — Left-rail server icon strip. Renders server icons with unread badges, supports server folders (drag-to-group), create-server modal, server discovery, and jump-to-DMs. Navigates via Next.js router on server select.  
  *social-web/src/components/social/ServerBar.tsx:1*
- **`social.servers.create`** · _stable_ · since 0.1.0 — Create a new server (Discord-like) — owner becomes first member with admin role.  
  *social-api/src/routes/servers.rs:13*
- **`social.servers.folders`** — Collapsible server-folder grouping in the ServerBar. Drag-to-group servers, persist folder structure to localStorage, expand/collapse with animated chevron. Exports useServerFolders hook for folder CRUD.  
  *social-web/src/components/social/ServerFolder.tsx:1*
- **`social.servers.settings`** — Server management modal with tabs for Overview (name/icon/description), Roles (create/edit/delete RBAC roles), Members (search, kick, ban, role assignment), Invites (create/revoke), Webhooks (create/list), and Danger Zone (delete server).  
  *social-web/src/components/social/ServerSettings.tsx:1*

### social/settings
- **`social.settings.appearance`** — Appearance settings page. Choose theme (dark/light/system), font size, and message display density (cozy/compact). Persisted via useTheme hook and applied globally via CSS variables through ThemeInitializer.  
  *social-web/src/app/settings/appearance/page.tsx:1*
- **`social.settings.notifications`** — Notification settings page. Toggle desktop notifications and sound globally, configure email notification categories, and set a per-server notification level (all / mentions / mute) for each server the user is in. Global toggles persist via getNotificationSettings / saveNotificationSettings; email and per-server overrides persist via usePreferences (localStorage + API).  
  *social-web/src/app/settings/notifications/page.tsx:1*
- **`social.settings.preferences`** — User preferences hook. Persists voice device IDs, volume, noise suppression, echo cancellation, appearance theme/font-size, and notification toggles to both localStorage and the API for cross-device sync.  
  *social-web/src/hooks/usePreferences.ts:1*
- **`social.settings.profile`** — User profile settings page. Edit display name, username, bio, avatar URL, and presence status (online/idle/dnd/invisible). Changes are persisted via API and propagated to the social store on save.  
  *social-web/src/app/settings/profile/page.tsx:1*
- **`social.settings.voice`** — Voice & audio settings page. Select input/output devices, adjust input volume, toggle noise suppression and echo cancellation, and run a microphone test. Settings persisted to localStorage and synced via usePreferences.  
  *social-web/src/app/settings/voice/page.tsx:1*

### social/state
- **`social.state.store`** — Central useReducer-based state store for the entire social UI. Owns all normalized types (SocialUser, SocialServer, SocialChannel, SocialMessage, SocialDm) and the full action set covering messages, threads, pins, reactions, unread tracking, mute, DM/friend mutations, channel reorder, and toasts. Exposed via SocialContext.  
  *social-web/src/stores/social.ts:1*

### social/uploads
- **`social.upload.file`** · _stable_ · since 0.1.0 — Upload an attachment with MIME validation via magic bytes; S3 (MinIO) primary, local-disk fallback.  
  *social-api/src/routes/upload.rs:166*

### social/voice
- **`social.voice.channel`** · _beta_ · since 0.2.0 — P2P-mesh WebRTC voice channel with mute/deafen, screen share, webcam, noise suppression.  
  *social-web/src/hooks/useVoiceChannel.ts:1244*
- **`social.voice.video-grid`** — Video tile grid for voice channels. Renders local (screen share / webcam) and remote P2P video streams, adapts layout (1–N tiles), shows mute/deafen badges, speaking-ring highlight, and fullscreen expand per tile.  
  *social-web/src/components/social/VideoGrid.tsx:1*

---

*Generated by [openalice-atlas](https://atlas.blal.pro) — single source of truth for the openalicelabs ecosystem.*
