How anudit/convo works
Purpose and Runtime
The Convo Space is a Next.js application providing a decentralized conversation layer: public thread views, embeddable comments, site-scoped discussions, and a signed-in developer/dashboard experience. Its main runtime combines React pages/components with Next.js API routes.
• pages/_app.js
• pages/index.js
• next.config.js
UI Entry Points and Rendering
Route-based pages expose the primary user surfaces: thread and site conversation views, lightweight embeds, identity links, and dashboard areas. Shared shells, navigation, cards, and thread rendering keep those surfaces consistent.
• pages/thread/[threadId].js
• pages/site/[siteUrlEncoded].js
• pages/embed/c/[commentId].js
• components/ThreadView.js
• components/DashboardShell.js
Conversation and Identity API Boundary
Server-side API routes are the application boundary for thread retrieval, comments, votes, authentication, identity, API-key management, and authorization validation. Clients should interact through these endpoints rather than directly with persistence or external providers.
• pages/api/threads.js
• pages/api/threads/[threadIds].js
• pages/api/comment.js
• pages/api/auth.js
• pages/api/identity.js
• pages/api/apikey.js
Persistence, Publishing, and Access Control
The core backend library layer separates database operations, legacy thread compatibility, publishing/bridging behavior, API-key enforcement, and auth validation from route handlers. MongoDB is the apparent primary persistence integration.
• lib/mongo-db.js
• lib/thread-db.js
• lib/thread-db-old.js
• lib/publish.js
• lib/bridge.js
• lib/validateAuth.js
Web3 and Credential Capabilities
A React Web3 context supports wallet- or chain-aware client behavior. The /api/omnid namespace implements credential issuance/verification and kit safety checks, making credentials a distinct capability surface from ordinary conversations.
• contexts/Web3Context.js
• pages/api/omnid/credentials/issue.js
• pages/api/omnid/credentials/verify.js
• pages/api/omnid/kits/isMalicious.js
• utils/rpc.js
Realtime and External Message Integrations
Ably authentication enables realtime client connectivity. Webhook-style endpoints and dedicated middleware integrate Discord, Slack, and Telegram while isolating interaction parsing and error handling from application routes.
• pages/api/getAblyAuth.js
• hooks/Ably.js
• pages/api/discord.js
• pages/api/slack.js
• pages/api/telegram.js
• middlewares/discordInteraction.js
Background Operations and Deployment
Scheduled cache/restore work supports retained or regenerated Omnid data. The repository is containerized and contains deployment descriptors for multiple hosting targets, plus GitHub automation including a Heroku deployment workflow.
• cron/cacheV2.js
• cron/restore.js
• Dockerfile
• vercel.json
• netlify.toml
• .github/workflows/HerokuDeploy.yml
Main entry points: _app.js Next.js runtime · threads.js Conversation API · [threadId].js Conversation pages · DashboardShell.js Developer dashboard
Components 18
Next.js application
- Next.js runtime · Hosts React pages and API routes.
pages/_app.js - Conversation pages · Thread, site, and embed conversation surfaces.
pages/thread/[threadId].js - Thread rendering
components/ThreadView.js - Developer dashboard
components/DashboardShell.js - Web3 context · Provides wallet- and chain-aware client state.
contexts/Web3Context.js
Backend services
- Conversation API · Retrieves threads and processes comments.
pages/api/threads.js - Identity and key API · Handles authentication, identity, and API keys.
pages/api/auth.js - Thread data layer · Supports current and legacy thread access.
lib/thread-db.js - MongoDB · Primary persistence integration.
lib/mongo-db.js - Publishing bridge · Publishes and bridges conversation activity.
lib/publish.js - Access validation · Validates authentication and API-key access.
lib/validateAuth.js
External capabilities
- Omnid credentials · Issues, verifies, and safety-checks credentials and kits.
pages/api/omnid/credentials/issue.js - Chain RPC
utils/rpc.js - Ably realtime · Authenticates clients for live connectivity.
pages/api/getAblyAuth.js - Message webhooks · Receives Discord, Slack, and Telegram interactions.
pages/api/discord.js - Discord interaction parser
middlewares/discordInteraction.js
Operations
- Cache and restore jobs · Maintains retained or regenerated Omnid data.
cron/cacheV2.js - Multi-target deployment · Supports Docker, Vercel, Netlify, and Heroku automation.
Dockerfile
Connections 19
- Next.js runtime → Conversation pages: serves
- Conversation pages → Thread rendering: renders
- Next.js runtime → Developer dashboard: serves
- Next.js runtime → Web3 context: provides
- Conversation pages → Conversation API: calls
- Developer dashboard → Conversation API: calls
- Developer dashboard → Identity and key API: calls
- Conversation API → Thread data layer: uses
- Thread data layer → MongoDB: persists to
- Conversation API → Publishing bridge: publishes through
- Identity and key API → Access validation: enforces
- Web3 context → Chain RPC: uses
- Next.js runtime → Omnid credentials: exposes
- Omnid credentials → Chain RPC: uses
- Next.js runtime → Ably realtime: exposes
- Next.js runtime → Message webhooks: receives
- Message webhooks → Discord interaction parser: parses with
- Cache and restore jobs → MongoDB: caches and restores
- Multi-target deployment → Next.js runtime: deploys