Prism GUI Architecture¶
Updated in v0.31.0: The GUI was rebuilt from shadcn/ui to shadcn/ui with Tailwind CSS. This document reflects the current architecture as of v0.35.3.
Overview¶
The Prism GUI is a desktop application built with Go + Wails v3 that provides a clean interface for managing cloud research environments. The frontend is a React single-page application; Wails embeds it in a native window with a Go backend bridge.
Technology Stack¶
| Layer | Technology | Version |
|---|---|---|
| Desktop shell | Wails v3 | v3.0.0-alpha.74 |
| Frontend framework | React | 19.1 |
| Language | TypeScript | 5.9 |
| Component library | shadcn/ui (Radix UI primitives) | code-owned |
| Styling | Tailwind CSS v4 | 4.2 |
| Animations | Framer Motion | 12.x |
| Toast notifications | Sonner | latest |
| Icons | Lucide React | latest |
| Terminal emulator | xterm.js | 5.5 |
| Font | Atkinson Hyperlegible Next | variable |
Component pattern: shadcn/ui¶
Prism uses the shadcn/ui approach: components are copied into the codebase under src/components/ui/ and owned by the project. They use Radix UI primitives for accessibility (focus management, keyboard navigation, ARIA) and Tailwind for styling.
This means components are fully customizable β no version lock-in to an external component library's design decisions.
Cloudscape compatibility shim¶
src/lib/cloudscape-shim.tsx provides a compatibility layer that maps Cloudscape component APIs to shadcn/ui implementations. This was used during the v0.31.0 migration and remains as a bridge while views are incrementally migrated. New views use shadcn/ui directly.
SafePrismAPI pattern¶
src/lib/api.ts exposes a SafePrismAPI class with named methods (never generic get()/post()). Each method calls the private safeRequest() helper which handles auth headers, error wrapping, and base URL. This keeps the API surface explicit and type-safe.
Design Philosophy¶
Single-Page Application (SPA)¶
- No popup windows β all interactions happen within the main window
- Toast notifications β feedback via Sonner (bottom-right)
- Content switching β navigation changes the main content area
- Consistent layout β shadcn/ui
Sidebar+SidebarInsetpattern
Modern Visual Design¶
- Card-based layouts for organized information presentation
- Grid systems for consistent spacing and alignment
- Typography hierarchy with proper bold headers and text styling
- Icon integration using web-based iconography and CSS styling
- Visual status indicators with color-coded state icons
Architecture Components¶
Main Application Layout¶
βββββββββββββββ¬βββββββββββββββββββββββββββββββββββ
β Sidebar β Main Content β
β (20% width)β (80% width) β
βββββββββββββββΌβββββββββββββββββββββββββββββββββββ€
β Navigation β ββ Notifications (inline) ββ β
β (v0.5.9+) β β β
Success/Error alerts β β
β β β βΉοΈ Info messages β β
β π Dashboardβ β β Error notifications β β
β π Templatesβ ββββββββββββββββββββββββββββ β
β π» Workspacesβ β
β π₯οΈ Terminal β π Dynamic Content Area β
β π Web Svc β βββββββββββββββββββββββββββ β
β βββββββββββ β β Dashboard / Templates β β
β πΎ Storage β β Workspaces / Projects β β
β π Projects β β Storage / Settings β β
β βββββββββββ β βββββββββββββββββββββββββββ β
β βοΈ Settings β β
β + Advancedβ β
βββββββββββββββ΄βββββββββββββββββββββββββββββββββββ
Settings Internal Navigation (v0.5.9+)¶
When Settings is selected, the main content area includes a side navigation:
βββββββββββββββ¬ββββββββββββββ¬βββββββββββββββββββββ
βMain Nav βSettings Nav β Settings Content β
βββββββββββββββΌββββββββββββββΌβββββββββββββββββββββ€
β ... β General β ββββββββββββββββββ β
β βοΈ Settings β Profiles β β System Status β β
β (active) β Users β β Configuration β β
β ... β βββββββββββ β β AWS Settings β β
β β βΆ Advanced β β Feature Mgmt β β
β β β’ AMI β β Debug Tools β β
β β β’ Sizing β ββββββββββββββββββ β
β β β’ Policy β β
β β β’ Market β β
β β β’ Idle β β
β β β’ Logs β β
βββββββββββββββ΄ββββββββββββββ΄βββββββββββββββββββββ
Navigation Sections¶
Main Navigation (9 Items - v0.5.9+)¶
π Dashboard (Primary)¶
Purpose: Overview and quick actions Features: - Overview cards (active workspaces, daily cost, totals) - Quick launch form with template/name/size selection - Recent workspaces list with management shortcuts - Real-time cost and status updates
π Templates¶
Purpose: Research environment template discovery and launching Features: - Visual template gallery with descriptions and badges - Pre-configured environment details - AMI-optimized and script-based templates - One-click template launching - Template filtering and search
π» My Workspaces¶
Purpose: Complete workspace management Features: - Detailed workspace cards with full information - State-aware action buttons (Connect/Start/Stop/Hibernate/Delete) - Visual status indicators with color coding - Launch new workspace shortcut - Connection information and SSH access
π₯οΈ Terminal¶
Purpose: Direct terminal access to workspaces Features: - Embedded terminal interface - Quick SSH connection - Multi-tab terminal support (future)
π Web Services¶
Purpose: Web-based service access Features: - Jupyter Notebook access - RStudio Server connections - Custom web services - Embedded browser interface
πΎ Storage¶
Purpose: Volume and storage management Features: - Unified EFS and EBS volume management - Tabbed interface (Shared/Private) - Volume creation and deletion - Attachment/detachment workflows - Storage cost tracking
π Projects¶
Purpose: Multi-user collaboration and budgeting Features: - Project creation and management - Budget tracking and alerts - Member management and roles - Cost analysis and reporting - Project-specific resource views
βοΈ Settings¶
Purpose: Application configuration and advanced features Features: (See Settings Internal Navigation below) - General settings (system status, configuration) - Profile management (AWS profiles and regions) - User management (research users) - Advanced features (expandable section with 6 power features)
Settings Internal Navigation (v0.5.9+)¶
Settings uses a side navigation to organize configuration and advanced features:
General (Default)¶
- System status and health monitoring
- Daemon connection configuration
- Auto-refresh interval settings
- Default workspace sizes
- AWS profile and region information
- Feature toggles and management
- Debug tools and troubleshooting links
Profiles¶
- AWS profile management and switching
- Region configuration and selection
- Credential validation
- Profile-specific settings
Users¶
- Research user management
- SSH key generation and management
- User provisioning and creation
- Multi-user collaboration setup
- UID/GID mapping configuration
Advanced (Expandable Section)¶
π§ AMI Management - Custom AMI creation from workspaces - AMI optimization and sharing - Cross-region AMI distribution - Community AMI discovery
π Rightsizing - Instance sizing recommendations - Cost optimization suggestions - Resource utilization analysis - Scaling predictions
π Policy Framework - Institutional governance controls - Access control policies - Template restrictions - Compliance and audit settings
πͺ Template Marketplace - Community template discovery - Template rating and reviews - Template installation - Repository management
β° Idle Detection - Automated hibernation policies - Cost optimization through idle detection - Policy configuration (GPU, batch, balanced) - Hibernation history and savings tracking
π Logs Viewer - System logs and diagnostics - Error tracking and debugging - API call history - Performance monitoring
Backend Integration¶
API Client Architecture¶
type PrismService struct {
apiClient api.PrismAPI // Interface to daemon
// ... service methods exposed to frontend
}
// Daemon connection
apiClient: api.NewClient("http://localhost:8947")
Real-time Data Flow¶
User Action β GUI Handler β API Client β HTTP Request
β
Daemon REST API β AWS SDK β Cloud Operation
β
Response β GUI Update β Notification β Refresh
Supported Operations¶
- β Instance Lifecycle: Launch, start, stop, delete
- β Template Management: List, select, quick launch
- β Connection Info: SSH details and access
- β Status Monitoring: Real-time state and cost updates
- β Health Checks: Daemon connectivity and error handling
User Experience Design¶
Notification System¶
// Web-based notifications through Wails frontend
func (s *PrismService) ShowNotification(notificationType, title, message string)
- Success: Green with checkmark icon
- Error: Red with error icon
- Info: Blue with info icon
- Auto-dismiss after 5 seconds
- Manual dismiss with Γ button
Loading States¶
// Non-blocking operations with visual feedback via web UI
func (s *PrismService) LaunchInstance(req LaunchRequest) {
// Emit loading state to frontend
s.emitEvent("launch:loading", true)
// Background API calls
go func() {
response, err := s.apiClient.LaunchInstance(req)
// Update frontend via events
s.emitEvent("launch:complete", response)
}()
}
Form Validation¶
- Inline validation without disrupting workflow
- Clear error messages in notification area
- Required field highlighting
- Smart defaults for improved UX
State Management¶
Data Synchronization¶
type PrismGUI struct {
// Data state
instances []types.Instance
templates map[string]types.Template
totalCost float64
lastUpdate time.Time
// Background refresh every 30 seconds
refreshTicker *time.Ticker
}
Form State¶
// Persistent form state across navigation
launchForm struct {
templateSelect *widget.Select
nameEntry *widget.Entry
sizeSelect *widget.Select
launchBtn *widget.Button
}
Visual Design System¶
Color Coding¶
- π’ Running: Green circle - instance is active
- π‘ Stopped: Yellow circle - instance is stopped
- π Pending: Orange circle - transitional states
- π΄ Terminated: Red circle - instance destroyed
- β« Unknown: Black circle - unknown state
Typography¶
- Bold headers for section titles and primary information
- Regular text for descriptions and secondary information
- Italic text for placeholder and helper text
- Monospace for technical details (IDs, commands)
Layout Principles¶
- Card containers for grouped information
- Grid layouts for consistent spacing
- Separators for visual hierarchy
- Spacers for flexible positioning
Performance Considerations¶
Efficient Updates¶
- Selective rendering - Only update changed content areas
- Background operations - Non-blocking API calls
- Smart refresh - Avoid unnecessary re-renders
- Lazy loading - Load content on demand
Memory Management¶
- Resource cleanup - Proper disposal of timers and resources
- Event handling - Efficient callback management
- State optimization - Minimal data retention
Future Enhancements¶
Visual Improvements¶
- Dark mode support - Theme switching capability
- Custom icons - Prism branded iconography
- Enhanced animations - Smooth transitions and loading states
- Responsive design - Better window resizing behavior
Functionality Expansion¶
- Advanced filtering - Search and filter instances/templates
- Bulk operations - Multi-select for batch actions
- Activity timeline - History of operations and changes
- Usage analytics - Charts and graphs for usage patterns
Integration Features¶
- Keyboard shortcuts - Power user productivity features
- Export capabilities - Data export and reporting
- Collaboration tools - Share workstations and templates
- Integration hooks - External tool connections
Development Guidelines¶
Code Organization¶
cmd/prism-gui/main.go
βββ Application setup and initialization
βββ Navigation and layout management
βββ View creation functions (Dashboard, Instances, etc.)
βββ Event handlers for user interactions
βββ API integration and data management
βββ Utility functions and helpers
Best Practices¶
- Single responsibility - Each function has a clear purpose
- Consistent naming - Follow Go and React/TypeScript conventions
- Error handling - Graceful degradation with user feedback
- Documentation - Clear comments for complex logic
Testing Strategy¶
- Manual testing - User workflow verification
- Integration testing - API connectivity validation
- Visual testing - Layout and design verification
- Performance testing - Responsiveness under load
This GUI architecture provides a solid foundation for a modern, user-friendly cloud workstation management interface that scales with user needs and maintains excellent usability throughout the application lifecycle.