|
| 1 | +--- |
| 2 | +title: PerplexiGrid |
| 3 | +description: Instantly generate analytics dashboards from natural language using live data via Perplexity Sonar API. |
| 4 | +sidebar_position: 1 |
| 5 | +keywords: [perplexigrid, dashboard, analytics, BI, AI, Perplexity, sonar, echarts, supabase] |
| 6 | +--- |
| 7 | + |
| 8 | +# PerplexiGrid |
| 9 | + |
| 10 | +**PerplexiGrid** turns natural language into rich, interactive dashboards. Connect your data and mix it with live web data, ask a question, and let the Sonar API do the rest! Complete with drag-and-drop layout, AI widget generation, and ECharts-powered visualizations. |
| 11 | + |
| 12 | +## Features |
| 13 | + |
| 14 | +* Fully customizable dashboards generated from plain English prompts with 25+ supported widget types (charts, KPIs, tables, heatmaps, etc.) |
| 15 | +* Smart layout with a customizable drag-and-drop grid, shareable as PDF/image exports and shareable links |
| 16 | +* Refine or add widgets using conversational updates |
| 17 | +* Support for live data from the web + your own datasources |
| 18 | + |
| 19 | +## Prerequisites |
| 20 | + |
| 21 | +* Node.js 18 or newer |
| 22 | +* Supabase project + API keys |
| 23 | +* Perplexity Sonar API key |
| 24 | +* Supabase CLI for deploying Edge Functions |
| 25 | + |
| 26 | +## Installation |
| 27 | + |
| 28 | +Clone the repository: |
| 29 | + |
| 30 | +``` |
| 31 | +git clone https://github.com/PetarRan/perplexigrid.git |
| 32 | +cd perplexigrid |
| 33 | +``` |
| 34 | + |
| 35 | +Install frontend dependencies: |
| 36 | + |
| 37 | +``` |
| 38 | +cd client |
| 39 | +npm install |
| 40 | +``` |
| 41 | + |
| 42 | +Create your `.env` file inside `client/`: |
| 43 | + |
| 44 | +``` |
| 45 | +VITE_SUPABASE_URL=https://your-project.supabase.co |
| 46 | +VITE_SUPABASE_ANON_KEY=your-anon-key |
| 47 | +VITE_PPLX_API_KEY=your-perplexity-api-key |
| 48 | +``` |
| 49 | + |
| 50 | +Run the development server: |
| 51 | + |
| 52 | +``` |
| 53 | +npm run dev |
| 54 | +``` |
| 55 | + |
| 56 | +Open `http://localhost:5173` in your browser. |
| 57 | + |
| 58 | +## Supabase Edge Function Setup |
| 59 | + |
| 60 | +Install the Supabase CLI: |
| 61 | +https://supabase.com/docs/guides/cli |
| 62 | + |
| 63 | +Link to your project: |
| 64 | + |
| 65 | +``` |
| 66 | +supabase link --project-ref your-project-id |
| 67 | +``` |
| 68 | + |
| 69 | +Create the Edge Function: |
| 70 | + |
| 71 | +``` |
| 72 | +supabase functions new call-perplexity |
| 73 | +``` |
| 74 | + |
| 75 | +Paste your implementation into: |
| 76 | +`functions/call-perplexity/index.ts` |
| 77 | + |
| 78 | +Set the environment variable (via Supabase Dashboard): |
| 79 | + |
| 80 | +`PPLX_API_KEY=your-perplexity-api-key ` |
| 81 | + |
| 82 | +Deploy the function: |
| 83 | + |
| 84 | +``` |
| 85 | +supabase functions deploy call-perplexity |
| 86 | +``` |
| 87 | + |
| 88 | +Your frontend calls it at: `/call-perplexity` |
| 89 | + |
| 90 | +## Usage |
| 91 | + |
| 92 | +1. Open the app and start a new dashboard |
| 93 | +2. Prompt it like: _“Show me market trends in AI startups in 2024”_ (Sonar generates chart configs, which are parsed and rendered as live widgets) |
| 94 | + |
| 95 | + |
| 96 | + |
| 97 | +3. Rearrange and style the widgets with the grid interface |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | + |
| 102 | +5. Add your own datasources to blend your data with live web data |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | +6. Refine them via text prompts or export the dashboard as needed |
| 107 | +7. Collaborate and share easily |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | + |
| 112 | +## Code Explanation |
| 113 | + |
| 114 | +The user sends messages that are turned into prompts to a Supabase Edge Function that wraps the Perplexity Sonar API. |
| 115 | +Depending on the mode (`f1`, `l1`, `r1`, or `r2`), the function generates full structured outputs for dashboards, lightweight visualizations, or targeted updates. |
| 116 | +The generated layout is parsed into structured widget definitions and passed through our widget creation engine. |
| 117 | + |
| 118 | +Explore our [mai sonar-api service here.](https://github.com/PetarRan/perplexigrid/blob/main/server/supabase/functions/_shared/perplexityService.ts) |
| 119 | + |
| 120 | +## Prompt Modes |
| 121 | + |
| 122 | +| Mode | Description | Use Case | Notes | |
| 123 | +|------|-------------|----------|-------| |
| 124 | +| `f1` | First-time full dashboard generation | User starts with an empty canvas and enters an initial prompt | Produces a complete dashboard layout with multiple widgets | |
| 125 | +| `l1` | Lightweight dashboard generation | Used for quick insights or previews with minimal tokens | Faster and cheaper, but returns fewer widgets with less instruction depth | |
| 126 | +| `r1` | Full dashboard regeneration | User wants to replace all existing widgets with a new prompt | Rebuilds the entire dashboard while keeping layout intact | |
| 127 | +| `r2` | Targeted widget update | User wants to change a specific widget (e.g. “make this a pie chart”) | Only the selected widget is modified based on the new instruction | |
| 128 | + |
| 129 | +Tech Stack |
| 130 | + |
| 131 | +* **Frontend**: React + Vite (TypeScript), ECharts, react-grid-layout |
| 132 | +* **Backend**: Supabase Edge Functions (TypeScript on Deno) |
| 133 | +* **Infra**: Supabase (PostgreSQL, RLS, Auth), CLI-based deploys + Vercel |
| 134 | +* **AI Model**: Perplexity Sonar-Pro |
| 135 | + |
| 136 | +## Links |
| 137 | + |
| 138 | +- [GitHub Repository](https://github.com/PetarRan/perplexigrid) |
| 139 | +- [perplexigrid.com](https://www.perplexigrid.com) |
| 140 | +- [Live Demo](https://app.perplexigrid.com) |
0 commit comments