Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
A fast, interactive analytics dashboard built on Next.js App Router, querying MotherDuck over the Postgres endpoint.

Open source admin dashboard starter built with Next.js 16, shadcn/ui, Tailwind CSS, and TypeScript.

Free Bootstrap 5 & HTML admin dashboard template with 7+ prebuilt pages, authentication, data tables, and mobile-first responsive design.
The Next.js + MotherDuck Postgres endpoint quickstart is a dashboard template that creates an interactive NYC Taxi analytics dashboard with the Next.js App Router, querying MotherDuck over the Postgres endpoint through the standard pg driver.
This template is a reference implementation that connects a Next.js application to MotherDuck's public sample_data.nyc.taxi share using the Postgres endpoint. It takes a MotherDuck access token and an optional host as environment variables, and outputs a server-rendered dashboard with KPI cards, Recharts charts, a date-range picker, and a click-to-drill day view. The project is designed to deploy directly to Vercel via a one-click button or the MotherDuck Native Integration from the Vercel Marketplace.
src/app/page.tsx server-renders the usable date bounds for the dataset, then hands off to a client dashboard component.src/app/api/dashboard/route.ts runs six parameterized queries in parallel for a given start/end range: KPIs, trips-per-day, pickups-by-hour, revenue-by-payment-type, payment-to-rate Sankey, and top pickup zones.src/app/api/bounds/route.ts returns the minimum and maximum days that have meaningful trip volume, keeping the date picker on populated data.src/lib/motherduck.ts creates a pg.Pool with SSL, registers it with attachDatabasePool from @vercel/functions, and shuts it down cleanly on Vercel Fluid Compute.src/components/dashboard.tsx provides KPI cards, Recharts line/bar/Sankey charts, click-to-drill day view, and a bounded date-range picker.src/lib/motherduck.ts and providing your own MotherDuck token.The MotherDuck Postgres endpoint makes MotherDuck speak the Postgres wire protocol, so any Postgres client such as pg can execute DuckDB SQL. This template creates one pg.Pool, registers it with attachDatabasePool for graceful shutdown on Fluid Compute, and route handlers borrow clients from the pool to run parameterized queries in parallel with Promise.all, returning JSON to the frontend.
Yes. A free MotherDuck account works for this template; you can sign up at app.motherduck.com. You will need an access token from the settings page, which you paste into the MOTHERDUCK_TOKEN environment variable.
It queries MotherDuck's public sample_data.nyc.taxi share, so the dashboard is populated immediately after deployment without setting up any tables. The database name is hard-coded in src/lib/motherduck.ts.
Yes. Change the DATABASE constant in src/lib/motherduck.ts to point at your own MotherDuck database, and keep your token in MOTHERDUCK_TOKEN. The six dashboard queries and the bounds query will then run against your data.
Only MOTHERDUCK_TOKEN is required. MOTHERDUCK_HOST is optional; if absent, it defaults to pg.us-east-1-aws.motherduck.com, which matches the default region for new MotherDuck accounts.
You need Node.js 20 or later, plus a MotherDuck account. After cloning, run npm install, copy .env.example to .env.local, add your token, and start with npm run dev.