← Back to Architecture

UI/Channels Architecture

User interfaces, interaction channels, and front-end architecture

Multi-Channel Architecture

graph TB
    Users[👥 Users]
    
    subgraph "Web Channel"
        WebApp[Next.js 15 Web App<br/>chat.mysakura.ca]
        Pages[40+ Pages<br/>Dashboard, Chat, Tracking]
        Components[100+ Components<br/>Reusable UI]
    end
    
    subgraph "Mobile Channel"
        RN[React Native App<br/>iOS & Android]
        MobilePages[Mobile-Optimized Pages]
        MobileComp[Mobile Components]
    end
    
    subgraph "Native Channel"
        iOS[iOS Native App<br/>Swift/SwiftUI]
        Android[Android Native App<br/>Kotlin/Jetpack]
    end
    
    subgraph "Communication Protocols"
        HTTP[HTTP/HTTPS<br/>REST API]
        WS[WebSocket<br/>Real-time]
        SSE[Server-Sent Events<br/>Streaming]
    end
    
    subgraph "Backend Services"
        FastAPI[FastAPI Backend<br/>40+ Endpoints]
        AgentSystem[Multi-Agent System<br/>18+ Agents]
    end
    
    subgraph "State Management"
        Context[React Context<br/>Global State]
        LocalStorage[Browser Storage<br/>Persistence]
        Cache[Client-side Cache<br/>Performance]
    end

    Users --> WebApp
    Users --> RN
    Users --> iOS
    Users --> Android
    
    WebApp --> Pages
    WebApp --> Components
    RN --> MobilePages
    RN --> MobileComp
    
    WebApp --> HTTP
    WebApp --> WS
    WebApp --> SSE
    RN --> HTTP
    RN --> WS
    iOS --> HTTP
    iOS --> WS
    Android --> HTTP
    Android --> WS
    
    HTTP --> FastAPI
    WS --> FastAPI
    SSE --> FastAPI
    
    FastAPI --> AgentSystem
    
    WebApp --> Context
    WebApp --> LocalStorage
    WebApp --> Cache
    RN --> Context
    RN --> LocalStorage

    style Users fill:#e3f2fd
    style WebApp fill:#c8e6c9
    style RN fill:#fff3e0
    style iOS fill:#f3e5f5
    style Android fill:#e1f5fe
    style HTTP fill:#ffebee
    style WS fill:#fce4ec
    style FastAPI fill:#f0f4c3

Web Application (Next.js 15)

🌐 Page Structure (40+ Pages)

Core: Landing, Auth, Profile, Settings
Chat: Main Chat, Mobile Chat, Trace
Wellness: Dashboard, Progress, Preferences
Domains: Nutrition, Exercise, Sleep, Stress
Tracking: Goals, Habits, Supplements
Integrations: Oura Insights, Dexcom, Calendar
Legal: Terms, Privacy, Cookies

🎨 Component Library (100+)

Navigation: Header, Footer, Sidebar, Breadcrumbs
Chat: MessageList, InputBox, StreamingMessage
Common: Card, Modal, Button, Input, Select
Visualizations: Charts, Progress Bars, Stats
Domain: NutritionPanel, ExerciseTracker, etc.
Forms: WizardFlow, OnboardingForm, Uploads

⚛️ Technology Stack

Framework:Next.js 15.3.1
UI Library:React 18.2.0
Styling:Tailwind CSS
HTTP Client:Axios 1.9.0
Charts:Recharts 2.15.3
Icons:Lucide + Heroicons

🔄 State Management

AuthContext: Authentication & user state
ChatContext: Chat history & active conversations
WellnessContext: Health data & metrics
PreferencesContext: User preferences & settings
AppContext: Global application state

User Interaction Patterns

💬 Conversational Interface

  • • Natural language chat
  • • Real-time streaming responses
  • • Message reactions & feedback
  • • Context-aware suggestions
  • • Multi-turn conversations

📊 Data Visualization

  • • Interactive charts & graphs
  • • Progress tracking displays
  • • Trend visualizations
  • • Goal completion metrics
  • • Biometric data dashboards

📝 Form Interactions

  • • Quick data entry forms
  • • Wizard-based onboarding
  • • Auto-complete suggestions
  • • Image upload & processing
  • • Real-time validation

Mobile & Responsive Design

📱 Mobile-First Approach

  • Responsive Breakpoints: Mobile, tablet, desktop optimized
  • Touch Gestures: Swipe, tap, long-press interactions
  • Mobile Chat: Dedicated mobile-optimized chat interface
  • Fast Agents: Mobile-specific lightweight AI agents
  • Offline Support: Progressive Web App capabilities

⚡ Performance Optimization

  • Code Splitting: Dynamic imports for faster loads
  • Image Optimization: Next.js Image component
  • SSR/SSG: Server-side rendering for SEO
  • Lazy Loading: Components loaded on demand
  • Caching Strategy: Browser caching + service workers

Accessibility & UX

WCAG 2.1 AA

Accessible design standards

⌨️

Keyboard Navigation

Full keyboard support

🎨

High Contrast

Color accessibility

📱

Screen Readers

ARIA labels & roles