How proposals-app/proposalsapp works
Main Components (Top Level)
Frontend Layer:
• Web Applications (apps/web and apps/web-arbitrum)
• UI Components (shadcn components)
• Client-side State Management
Backend Services Layer:
• Detective Service (Proposal Indexer)
• Discourse Service
• Email Service
• Push Service
• Mapper Service
Database Layer:
• SeaORM Models
• Kysely Migrations
Key Relationships and Data Flow
a. Data Collection Flow:
• Blockchain/External Sources -> Detective Service -> Database
• Discourse Platform -> Discourse Service -> Database
b. Notification Flow:
• Database -> Email Service -> Users
• Database -> Push Service -> Users
c. Frontend Data Flow:
• Web Apps -> Backend Services -> Database
Component Details
Detective Service:
• Multiple Chain Indexers (Arbitrum, Ethereum, etc.)
• ABI Handlers
• Chain Data Processors
Discourse Service:
• Categories Handler
• Posts Handler
• Users Handler
• Revisions Handler
Database Schema Groups:
• DAO-related tables
• User-related tables
• Discourse-related tables
• Voting/Delegation tables
Authentication Flow:
• User Sessions
• Email Verification
• Push Notification Subscriptions
Indexing Pipeline:
• Proposal Detection
• Vote Tracking
• Discussion Integration
Technical Stack Indicators
Technology labels:
Frontend: Next.js, TypeScript, Tailwind
Backend: Rust, SeaORM
Services: TypeScript (Email/Push)
Database: PostgreSQL (implied by SeaORM)
Cross-Cutting Concerns
Shared components:
• Authentication/Authorization
• Monitoring/Logging
• Configuration Management
The notification system architecture
Keep the abstraction level balanced to show both the high-level architecture and important implementation details without overwhelming the viewer.