How chojs23/concord works
Concord is a Rust terminal client for Discord. The main workflow is terminal input, command dispatch, Discord requests/events, state updates, and dashboard rendering. Separate branches cover authentication, search and messaging, notifications, image/media handling, voice calls and screen broadcasting, and Rich Presence. The README documents these capabilities; sampled source confirms app startup, TUI entry, Discord client responsibilities, and media-preview behavior, but not every subsystem’s internal wiring.
Main entry points: client.rs Discord client · app.rs App lifecycle · command_loop.rs Command dispatch · ui.rs Terminal rendering
Components 26
Terminal interface
- Dashboard runtime
src/tui/runtime/mod.rs - Keyboard and pointer
src/tui/input.rs - Dashboard state
src/tui/state.rs - Terminal rendering
src/tui/ui.rs - Login flow
src/tui/login.rs - Message presentation
src/tui/message/mod.rs - Image previews
src/tui/media/preview.rs
Application orchestration
- App lifecycle
src/app.rs - Command dispatch
src/app/command_loop.rs - Command handlers
src/app/command_dispatch.rs - Configuration
src/config.rs - Message search
src/tui/state/popups/search.rs - Notification inbox
src/app/inbox_commands.rs
Discord client
- Discord client
src/discord/client.rs - Gateway events
src/discord/gateway.rs - REST operations
src/discord/rest.rs - Discord state cache
src/discord/state.rs - Rich Presence RPC
src/discord/rpc/mod.rs
Voice and media
- Voice runtime
src/discord/voice/runtime.rs - Screen capture
src/discord/voice/capture.rs
Local integrations
- Credential storage
src/support/token_store.rs
Other components
- User
- Terminal
- RPC applications
- Media player
- Discord service
Connections 31
- User → Terminal: uses
- Terminal → App lifecycle: starts
- App lifecycle → Configuration: loads options
- App lifecycle → Discord client: creates
- App lifecycle → Dashboard runtime: starts dashboard
- App lifecycle → Command dispatch: starts
- Dashboard runtime → Keyboard and pointer: handles input
- Keyboard and pointer → Dashboard state: updates
- Dashboard state → Terminal rendering: provides view
- Terminal rendering → Terminal: draws
- Dashboard runtime → Command dispatch: sends commands
- Command dispatch → Command handlers: dispatches
- Command handlers → Discord client: requests actions
- Login flow → Discord service: authenticates
- Login flow → Credential storage: stores token
- Discord client → Gateway events: connects
- Discord client → REST operations: issues requests
- Gateway events → Discord service: exchanges events
- REST operations → Discord service: sends requests
- Gateway events → Discord state cache: updates cache
- REST operations → Discord state cache: updates cache
- Discord state cache → Dashboard state: supplies snapshots
- Message search → Command dispatch: requests search
- Message presentation → Terminal rendering: formats messages
- Notification inbox → Command dispatch: requests inbox data
- Voice runtime → Discord client: uses client
- Voice runtime → Screen capture: captures stream
- Voice runtime → Media player: plays audio
- Image previews → Terminal rendering: renders previews
- Rich Presence RPC → RPC applications: serves RPC
- Rich Presence RPC → Discord client: updates activity