How orcasound/orcasite works
Main Components
a. Frontend Layer:
• Next.js application (ui/ directory)
• Components for audio player, detection system, and user interface
• GraphQL client for data fetching
• WebSocket connections for real-time updates
b. Backend Layer:
• Phoenix Framework (server/ directory)
• GraphQL API endpoint
• WebSocket channels for real-time communication
• Authentication system
• JSON API endpoints
c. Database Layer:
• PostgreSQL with PostGIS extension
• Multiple data models (feeds, detections, users, notifications)
d. External Services:
• Audio streaming service
• AWS services (indicated by AWS client in radio/)
• Email service (via mailer component)
[Client Layer]
• Next.js Frontend (Port 3000)
• Audio Player Components
• Real-time Updates (WebSocket)
• GraphQL Client
• User Interface Components
• [API Layer]
• ┴─────────────────────┐
• Phoenix Backend (Port 4000) │
• GraphQL API │
• JSON API │
• WebSocket Channels │
• Authentication │
• Business Logic │
• [Service Layer] │
• ┴────────────────┐ │
• ┌─ Audio Processing ─┐ │ │
• Spectrogram │ │ │
• Feed Segments │ │ │
• ┘ │ │
• ┌─ Notification System ─┐ │ │
• Email │ │ │
• Subscriptions │ │ │
• ┘ │ │
• ┘ │
• [Storage Layer] │
• ┌───────────┴───────────┐ │
• PostgreSQL + PostGIS │ │
• Feeds │ │
• Detections │ │
• Users │ │
• Notifications │ │
• ┘ │
• [External Services] │
• ┴────────────┘
• ┌────────┴─────────┐
• AWS Services Email Service
Important Relationships to Highlight
• WebSocket connections between frontend and backend for real-time updates
• GraphQL/JSON API communication paths
• Database interactions
• External service integrations
• Authentication flow
Additional Elements
• Data flow direction indicators
• Scalability points
• Security boundaries
• Deployment environments (development/production)
Technical Details
• Port numbers (3000 for UI, 4000 for API)
• Database extensions (PostGIS)
• Key technologies (Elixir, Phoenix, Next.js)
• Authentication mechanisms
• API protocols (GraphQL, JSON API, WebSocket)