openalice-social
**Paused product; structure consolidated 2026-07-06 (embed pattern), builds get fixed AT WAKE** (deps → kellnr/Verdaccio registries, env canon, composes).
Architecture rating
19 numbered migrations covering bans, audit_log, channel_permissions, cascade deletes — decent schema evolution; but no RLS or tenant isolation, no GDPR signals, and env-drift on DATABASE_URL/PLATFORM_DB_PASSWORD means connection config is untracked.
Manifest present+valid with 44 features, AGENTS.md and README exist; but README states 'paused product', 534 missing docstrings, 1 TODO; no in-code architecture notes or @feature annotations beyond manifest.
17 star imports, 327 format issues, 44 god modules, 5 duplicate signatures, 31 missing key props, max complexity 134 vs avg 6.09 — extreme variance; migration numbering is consistent but code conventions are not enforced.
validate_jwt middleware is unreferenced/dead code; JWT_SECRET and INTERNAL_BROADCAST_SECRET are undeclared env-drift vars with no canonical source; 87 bare/broad excepts can silently swallow auth failures; no evidence of rate-limiting, SSRF guards, or security headers.
Health probe returns 404, uptime 0%, CI conclusion=failure; 87 bare/broad excepts mask real errors; max cyclomatic complexity 134; no evidence of graceful shutdown, timeouts, retries, or idempotency; product is paused and non-functional.
25 console.log statements (unstructured); health endpoint exists but is broken (404); no evidence of metrics export, distributed tracing, or structured logging; monitoring is effectively absent.
e2e directory exists but no unit/integration test files visible in repo structure; validate_jwt and two other definitions are unreferenced suggesting zero coverage of auth middleware; CI is failing so even e2e is non-functional.
source · auto-grader-2026-07-07
Ecosystem manifest
.atlas-deps.ymlDiscord-style chat + voice frontend (Next.js 16 + React 19) for the OpenAlice social layer.
- openalice-authhttpvia NEXT_PUBLIC_API_URL (AuthProvider)SSO — AuthProvider validates oa_session JWTs and issues the shared OpenAliceClient.
- via NEXT_PUBLIC_API_URLAll CRUD: servers, channels, messages, friends, DMs, file uploads, presence, push subscriptions.
- via VOICE_WS_URL (wss://voice.blal.pro/ws)P2P-mesh WebRTC signalling — join/leave rooms, relay ICE/SDP between peers.
- via NEXT_PUBLIC_API_URL (upload path)Serve uploaded files and user avatars returned as URLs from social-api.
- 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
- docker_image: openalice-social-web
- http_endpoint: https://social.blal.pro
Atlas grepped the repo's source for env reads (rust env::var · ts process.env · py os.environ · shell $VAR) and diffed against the manifest's consumes_env. Two lists below: stale declarations and undeclared reads.
- 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
Code composition
tokei · loc- TSX57.5%
- Rust27.3%
- TypeScript12.1%
- CSS1.2%
- SQL1.1%
- Other0.8%
- TSX57.5%
- Rust27.3%
- TypeScript12.1%
- CSS1.2%
- SQL1.1%
- Other0.8%
- TSX57.5%· 16,403
- Rust27.3%· 7,784
- TypeScript12.1%· 3,446
- CSS1.2%· 347
- SQL1.1%· 320
- JSON0.4%· 101
- JavaScript0.2%· 56
- TOML0.1%· 41
- +2 more0.1%· 34 · 6 files
| Language | % code | code | comments | blanks | files |
|---|---|---|---|---|---|
| TSX | 57.5% | 16,403 | 629 | 1,267 | 68 |
| Rust | 27.3% | 7,784 | 320 | 938 | 37 |
| TypeScript | 12.1% | 3,446 | 504 | 489 | 21 |
| CSS | 1.2% | 347 | 37 | 65 | 1 |
| SQL | 1.1% | 320 | 45 | 38 | 19 |
| JSON | 0.4% | 101 | 0 | 0 | 3 |
| JavaScript | 0.2% | 56 | 2 | 6 | 3 |
| TOML | 0.1% | 41 | 11 | 3 | 2 |
| Dockerfile | 0.1% | 29 | 16 | 8 | 1 |
| SVG | 0.0% | 5 | 0 | 0 | 5 |
| Markdown | 0.0% | 0 | 124 | 50 | 4 |
Telemetry ribbon · last 90 days
9 eventssocial/agents
4 features- social.agents.add-dialogsocial-web/src/components/social/AddAgentDialog.tsx:1Dialog 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.agents.cardsocial-web/src/components/social/AgentCard.tsx:1Agent management card in the server agents list. Shows name, online/offline status, trigger keywords, assigned channels, vision config summary, and configure/remove actions.
- social.agents.mention-badgesocial-web/src/components/social/AgentMentionBadge.tsx:1Inline badge rendered inside message content when a @agent name is detected. Visually distinguishes agent mentions from user mentions with a Bot icon.
- social.agents.mention-detectionsocial-web/src/hooks/useAgentReactions.ts:1Reads 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/api
3 features- social.api.clientsocial-web/src/lib/sdk-client.ts:1Thin 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.api.hookssocial-web/src/hooks/useSocial.ts:1Async 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.api.typessocial-web/src/lib/sdk-types.ts:1Re-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/calls
3 features- social.calls.controlssocial-web/src/components/social/CallControls.tsx:1In-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.calls.dm-voicesocial-web/src/hooks/useCall.ts:11-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.calls.incoming-overlaysocial-web/src/components/social/CallOverlay.tsx:1Floating 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/channels
4 features- social.channels.headersocial-web/src/components/social/ChannelHeader.tsx:1Channel 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.channels.member-listsocial-web/src/components/social/MemberList.tsx:1Right-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.channels.settingssocial-web/src/components/social/ChannelSettings.tsx:1Per-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.channels.sidebarsocial-web/src/components/social/ChannelSidebar.tsx:1Per-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/chat
5 features- social.chat.emoji-pickersocial-web/src/components/social/EmojiPicker.tsx:1Full 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.chat.link-embedsocial-web/src/components/social/LinkEmbed.tsx:1Auto-fetches OpenGraph metadata for URLs in messages via the social-api /og endpoint and renders title/description/image previews inline beneath the message.
- social.chat.message-areasocial-web/src/components/social/MessageArea.tsx:1Virtualised 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.chat.message-inputsocial-web/src/components/social/MessageInput.tsx:1Rich 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.chat.thread-sidebarsocial-web/src/components/social/ThreadSidebar.tsx:1Slide-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/friends
2 features- social.friends.listsocial-web/src/components/social/FriendsContent.tsx:1Friends 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.friends.requestsocial-api/src/routes/friends.rs:12Send a friend request to another user — they accept or decline.api:POST /api/v1/friends/requestsince 0.1.0
social/layout
1 feature- social.layout.rootsocial-web/src/components/social/SocialLayout.tsx:1Top-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/messaging
3 features- social.dms.createsocial-api/src/routes/dms.rs:14Create a 1:1 or group DM channel between two or more users.api:POST /api/v1/dmssince 0.1.0
- social.messages.searchsocial-api/src/routes/messages.rs:13Case-insensitive content search within a channel, paged by limit.api:GET /api/v1/servers/:server_id/channels/:channel_id/messages/searchsince 0.1.0
- social.messages.sendsocial-api/src/routes/messages.rs:282Send a message into a server channel — broadcast over WebSocket to channel subscribers.api:POST /api/v1/servers/:server_id/channels/:channel_id/messagessince 0.1.0
social/moderation
1 feature- social.moderation.capability-matrixsocial-web/src/components/social/ModerationCapabilityMatrix.tsx:1Static 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/notifications
1 feature- social.notifications.pushsocial-web/src/hooks/useNotifications.ts:1Browser 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/presence
1 feature- social.presence.user-cardsocial-web/src/components/social/UserCard.tsx:1Hover/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/realtime
2 features- social.realtime.platform-wssocial-web/src/hooks/usePlatformWs.ts:595Realtime WebSocket bridging messages, typing, presence, pins, reactions, calls into the social store.hook:usePlatformWssince 0.1.0
- social.realtime.wssocial-api/src/ws.rs:222WebSocket gateway pushing channel events (message, edit, delete, presence) with JWT auth.api:WS /wssince 0.1.0
social/servers
5 features- social.channels.createsocial-api/src/routes/channels.rs:14Create a text/voice/announcement channel inside a server.api:POST /api/v1/servers/:server_id/channelssince 0.1.0
- social.servers.barsocial-web/src/components/social/ServerBar.tsx:1Left-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.servers.createsocial-api/src/routes/servers.rs:13Create a new server (Discord-like) — owner becomes first member with admin role.api:POST /api/v1/serverssince 0.1.0
- social.servers.folderssocial-web/src/components/social/ServerFolder.tsx:1Collapsible 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.servers.settingssocial-web/src/components/social/ServerSettings.tsx:1Server 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/settings
5 features- social.settings.appearancesocial-web/src/app/settings/appearance/page.tsx:1Appearance 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.settings.notificationssocial-web/src/app/settings/notifications/page.tsx:1Notification 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.settings.preferencessocial-web/src/hooks/usePreferences.ts:1User 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.settings.profilesocial-web/src/app/settings/profile/page.tsx:1User 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.settings.voicesocial-web/src/app/settings/voice/page.tsx:1Voice & 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/state
1 feature- social.state.storesocial-web/src/stores/social.ts:1Central 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/uploads
1 feature- social.upload.filesocial-api/src/routes/upload.rs:166Upload an attachment with MIME validation via magic bytes; S3 (MinIO) primary, local-disk fallback.api:POST /api/v1/uploadsince 0.1.0
social/voice
2 features- social.voice.channelsocial-web/src/hooks/useVoiceChannel.ts:1244P2P-mesh WebRTC voice channel with mute/deafen, screen share, webcam, noise suppression.hook:useVoiceChannelsince 0.2.0
- social.voice.video-gridsocial-web/src/components/social/VideoGrid.tsx:1Video 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.