Kiridharan

skiridharan.me@gmail.com

Get in touch

DashLink: paste a URL, get a dashboard you can share

How we built DashLink, an open-source dashboard builder: schema detection that picks charts, an SSRF-safe data proxy, a 12-column grid and per-theme charts.

Published
Reading time
5 min
Project
Dashlink
Topics
  • Next.js 15
  • React 19
  • Recharts
  • Supabase
A JSON API address turned into a dashboard of bar, line, number and ring charts. https://api.example.com/orders 1.2k

Plenty of useful data already sits behind a JSON endpoint — an internal service, a public API, a small backend someone built last quarter. Turning it into something a colleague can glance at usually means a BI tool, a connector, a data model and an afternoon. DashLink takes a shorter path. You paste the URL of a JSON API, and it detects the shape of the data, generates a first set of charts, and gives you a drag-and-drop dashboard with a permanent public link. The code is open source at github.com/kiridharan/dashlink, under the MIT licence.

Schema detection that aims for a good start, not a final answer

The interesting part of “paste a URL” is what happens next: deciding which charts to draw from data you’ve never seen. DashLink inspects the first row of the dataset and applies a short list of rules. Fields whose names look like dates or times become candidates for the x-axis. Numeric fields become KPI candidates, up to four KPI cards. Pairs of a non-numeric and a numeric field produce a line chart when the x-axis looks like a date and a bar chart when it doesn’t. A pie chart is suggested only when there is exactly one categorical and one numeric field. And one table with every column is always added, so nothing in the data is ever hidden.

We kept the rules deliberately conservative. Clever inference from a single row is fragile, and a wrong chart presented confidently costs more trust than a plain one. The goal is a usable starting layout in one step; every widget has a gear icon to change which fields it plots. If the useful records sit deeper in the response, an optional data path such as data.results drills into nested JSON before detection runs.

Fetch on the server, and refuse the wrong destinations

Calling third-party APIs straight from the browser runs into CORS and, worse, puts API credentials in front of anyone who opens developer tools. So every external request goes through a server-side proxy, which supports no auth, a Bearer token, an API key in a named header, or Basic credentials:

{
  "url": "https://api.example.com/endpoint",
  "auth": { "type": "bearer", "token": "<your token>" }
}

A proxy that fetches any URL a user types is also a textbook server-side request forgery risk: someone pastes an internal address and your server fetches it for them. In production, DashLink’s proxy blocks requests to private IP ranges (RFC 1918) and loopback addresses, and every request times out after 15 seconds. It’s a small amount of code, and the feature isn’t safe to ship without it.

A 12-column grid with one source of truth

The builder canvas is a 12-column CSS grid. Each widget spans 3, 4, 6 or 12 columns — by default a KPI card takes 3, a chart 6 and a table the full 12 — and its height is stored in pixels per widget. Drag-and-drop uses @dnd-kit with a rectangle sorting strategy, and resizing uses re-resizable with a thin bottom handle; the header of each tile shows its height and updates live as you drag.

The decision that keeps this simple is that widget order in an array is the source of truth. There are no stored x/y coordinates to reconcile. Reorder the array and the grid reflows on its own. It gives up free-form placement in exchange for layouts that can’t overlap and that stay readable at any width.

Themes that change how charts are drawn, not just their colours

DashLink ships 17 themes: nine modelled on the visual language of design systems such as shadcn/ui, Material Design 3, Tailwind UI, Ant Design, Chakra UI and Mantine, and eight colour palettes. A colour swap alone rarely makes a chart look native to a design system, so each theme carries its own chart style: bar corner radius and width, line curve type, area fill opacity, grid visibility and dash pattern, card radius and shadow, tooltip shape and axis label size. Material gets dots and an area fill; Ant Design gets flat square bars and a dashed grid. Adding a theme is one object in a single file.

Accounts and storage run on Supabase. Projects hold the builder metadata, source configuration, theme and layout; a separate snapshot table holds the latest resolved dataset used by both the builder and the public page. Shared dashboards live at a public URL that needs no login, and the viewer renders the saved layout over freshly fetched data, so the numbers stay current.

What we’d tell a team building something similar

Automatic inference should hand the user a sensible draft and make it easy to change, not try to be right every time. Any feature that fetches a user-supplied URL on your server needs an SSRF guard from day one. Pick a single source of truth for layout and derive everything else from it. And if your output should feel at home in someone else’s product, theme the shapes as well as the colours. Multi-series charts, filters, export and an embed snippet are on the public roadmap.

If you have data that deserves a better front end, get in touch.

Tell me what you are building.

For consulting, a build, or a question about a write-up.

  1. Full-stack developmentScalable frontend and backend systems with modern technologies.
  2. System architectureDistributed systems and microservices architectures.
  3. GenAI integrationAI-powered features and automation workflows.
  4. Technical consultingStrategic problem-solving and measurable client impact.

ChennaiIndia

Write to me

Or write directly

skiridharan.me@gmail.com