A React application that embeds GoodData Cloud dashboards with AI-powered analysis capabilities. Features intelligent screenshot capture, GoodData metadata integration, and contextual insights powered by OpenAI's Vision API.
- GoodData Dashboard Embedding: Full-featured GoodData dashboard with native filters and interactivity
- AI-Powered Analysis: Individual visualization summaries and dashboard-level insights
- Metadata Integration: Deep integration with GoodData's semantic layer (measures, attributes, MAQL formulas)
- Smart Caching: Filter-aware caching to reduce API calls and improve performance
- Dual Insights: Separate "Consumer" (business) and "Builder" (design) perspectives
- AI Summary Buttons: One-click analysis on each visualization
- Screenshot Capture: Automatic high-quality image generation
- Consumer Insights: Business-focused analysis - what the data means for decisions
- Builder Feedback: Design recommendations - how to improve the visualization
- Metadata Enrichment: Analysis enhanced with MAQL formulas and measure definitions
- Comprehensive Overview: AI analysis of the entire dashboard
- Executive Insights: High-level business takeaways
- Dashboard Design Feedback: Layout, cohesion, and user experience recommendations
- Context Awareness: Analysis considers dashboard filters and current state
- Filter-Based Keys: Cache invalidates automatically when filters change
- Performance Optimization: Instant results for repeated analyses
- Timestamp Tracking: See when each analysis was generated
- Node.js 16+
- npm or yarn
- GoodData Cloud workspace access
- OpenAI API key with GPT-4 Vision access
-
Clone the repository:
git clone https://github.com/strizr/ai-dashboard-summary.git cd ai-dashboard-summary -
Install dependencies:
npm install
-
Configure environment variables:
cp .env.example .env
Edit
.envwith your credentials:# GoodData Configuration REACT_APP_GOODDATA_HOST=your-gooddata-hostname.com REACT_APP_GOODDATA_BACKEND=https://your-gooddata-hostname.com REACT_APP_WORKSPACE_ID=your-workspace-id REACT_APP_DASHBOARD_ID=your-dashboard-id REACT_APP_API_TOKEN=your-gooddata-api-token REACT_APP_DASHBOARD_NAME=Your Dashboard Name # OpenAI Configuration REACT_APP_OPENAI_API_KEY=your-openai-api-key
-
Start the application:
npm start
The app will open at
http://localhost:3000
Main component that:
- Embeds the GoodData dashboard
- Tracks dashboard filters for cache invalidation
- Renders the AIOverlay component
- Manages dashboard configuration and authentication
Core AI integration component that:
- Scans and identifies dashboard visualizations
- Adds AI summary buttons to each chart
- Captures screenshots using html2canvas
- Manages analysis state and caching
- Displays analysis results in modal with tabs
Handles GoodData API integration:
- Fetches dashboard definition and structure
- Retrieves insight metadata (measures, attributes, filters)
- Extracts MAQL formulas and business definitions
- Maps widgets to insights for enrichment
Manages OpenAI Vision API communication:
- Builds structured prompts with metadata and screenshots
- Requests dual perspectives (consumer + builder)
- Parses AI responses into structured format
- Handles both visualization and dashboard-level analysis
Centralized configuration:
- GoodData connection settings
- Workspace and dashboard IDs
- OpenAI API configuration
- Dashboard display name
Each visualization gets an "AI summary" button that provides:
Consumer Insights π
- Business-focused interpretation of the data
- Key trends and patterns
- Decision-making implications
- What the numbers mean in business context
Design Feedback π¨
- Visualization effectiveness assessment
- Layout and color scheme recommendations
- Chart type appropriateness
- Readability and clarity improvements
Full dashboard analysis includes:
Executive Insights π
- Cross-visualization patterns and relationships
- Overall business story and narrative
- Key findings across the dashboard
- Strategic recommendations
Dashboard Design π¨
- Layout and information hierarchy
- Visual consistency and cohesion
- User experience optimization
- Navigation and flow improvements
AI analysis is enriched with:
- MAQL Formulas: How metrics are calculated
- Measure Definitions: What each number represents
- Attribute Context: Dimensional slicing information
- Filter Context: Current dashboard state
- Position: Top-left corner of each visualization
- Styling: Matches GoodData's native UI aesthetic
- Loading States: Animated spinner during analysis
- Cache Indicators: Shows when using cached results
- Tabbed Interface: Separate tabs for consumer/builder insights
- Screenshot Preview: Shows the analyzed visualization
- Responsive Design: Works on desktop and tablet
- Markdown Support: Rich formatting for structured insights
- Timestamp Display: Shows when analysis was performed
- Location: Top of the page next to dashboard name
- Full Dashboard Screenshot: Captures entire visible dashboard
- Comprehensive Analysis: Both tabs with executive + design insights
# GoodData Settings
REACT_APP_GOODDATA_HOST= # GoodData hostname
REACT_APP_GOODDATA_BACKEND= # Full backend URL
REACT_APP_WORKSPACE_ID= # Workspace identifier
REACT_APP_DASHBOARD_ID= # Dashboard identifier
REACT_APP_API_TOKEN= # GoodData API token
REACT_APP_DASHBOARD_NAME= # Display name for dashboard
# OpenAI Settings
REACT_APP_OPENAI_API_KEY= # OpenAI API key (GPT-4 Vision)In DashboardEmbed.js, you can customize:
isReadOnly: Set tofalsefor full interactivityenableFilterBar: Show/hide filter controls- Dashboard theme and styling overrides
In openaiAnalysisService.js, you can adjust:
- AI model version (currently
gpt-4o) - Prompt templates for different perspectives
- Response structure and parsing
- Screenshot quality and size
# Build the application
npm run build
# Serve the build folder with any static hosting service
# Example with serve:
npx serve -s buildFor production, ensure:
- API Keys: Use environment-specific OpenAI keys
- GoodData Tokens: Use production workspace credentials
- CORS: Configure GoodData CORS settings for your domain
- HTTPS: Use secure connections for both GoodData and OpenAI APIs
The app can be deployed to:
- Vercel:
vercel --prod - Netlify:
netlify deploy --prod - AWS Amplify: Connect your Git repository
- Any static hosting: Upload the
buildfolder
User opens app β Authenticate with GoodData β Load dashboard β Initialize AIOverlay
User clicks "AI summary" β Capture screenshot β Fetch GoodData metadata β
Build structured prompt β Call OpenAI Vision API β Parse response β
Display in modal with tabs β Cache result
User changes filters β Hash filter state β Check cache β
If cache miss: New analysis β If cache hit: Instant display
Get visualization title β Find matching insight β Fetch measures & attributes β
Extract MAQL formulas β Include in AI prompt β Enhanced analysis
- API Keys: Never commit
.envfile, use environment variables - Token Storage: GoodData tokens should be secured server-side in production
- CORS: Configure strict CORS policies for your domains
- Rate Limiting: Implement OpenAI API call limits to control costs
- Input Validation: Sanitize all user inputs and API responses
- β Filter-based caching reduces redundant API calls
- β Lazy loading of AI analysis (on-demand only)
- β Screenshot compression for faster uploads
- β GoodData metadata cached at dashboard load
- Server-side OpenAI calls for better security
- IndexedDB for persistent caching
- Web Workers for screenshot processing
- Incremental analysis updates
gooddata-dashboard-app/
βββ src/
β βββ components/
β β βββ AIOverlay/
β β β βββ AIOverlay.js # Main AI integration component
β β βββ DashboardEmbed/
β β βββ DashboardEmbed.js # Dashboard wrapper
β β βββ DashboardEmbed.css # Custom styling
β βββ services/
β β βββ gooddataMetadataService.js # GoodData API integration
β β βββ openaiAnalysisService.js # OpenAI API integration
β βββ config/
β β βββ config.js # Centralized configuration
β βββ App.js # Root component
β βββ index.js # Entry point
βββ public/
β βββ index.html
βββ .env.example # Environment template
βββ package.json
βββ README.md
- React 18: Frontend framework
- GoodData.UI SDK: Dashboard embedding and API
- OpenAI GPT-4 Vision: AI analysis
- html2canvas: Screenshot capture
- Axios: HTTP client
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature/your-feature - Open a Pull Request
- GoodData.UI React SDK
- GoodData Dashboard Component
- OpenAI Vision API
- html2canvas Documentation
- Detailed Metadata Integration Guide
"Authentication failed"
- Verify your
REACT_APP_API_TOKENis valid - Check that your token has access to the specified workspace
"Dashboard not found"
- Confirm
REACT_APP_WORKSPACE_IDandREACT_APP_DASHBOARD_IDare correct - Ensure the dashboard exists and is shared with your account
"OpenAI API error"
- Verify your
REACT_APP_OPENAI_API_KEYis valid - Check that you have GPT-4 Vision API access
- Monitor your OpenAI usage limits
"CORS errors"
- Configure CORS settings in your GoodData workspace
- Add your domain to the allowed origins list
MIT License - see LICENSE file for details
- GoodData for their excellent React SDK
- OpenAI for GPT-4 Vision API
- The html2canvas team for screenshot capabilities