Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Turso 4 min read How-to mediumAdept

Build your own Web Analytics Dashboard with Turso and Bolt

Bolt can generate a Next.js 14 web analytics dashboard backed by a Turso database when you feed it the database schema and a detailed requirements prompt. The walkthrough covers dumping the schema with the Turso CLI, then writing a prompt that specifies libsql-stateless-easy, shadcn/ui, server-side rendering and date-range filtering, and finally wiring up the database URL and auth token in .env. Follow-up prompts refine the output, for example adding country flags and device styling. When Bolt can't fix an error itself, the suggested remedy is to give it more context, such as the framework's latest documentation.

Related posts

  • Vercel setup guide

    Turso mediumAdept

    Deploying a Nuxt app backed by a Turso database to Vercel comes down to two environment variables, NUXT_TURSO_DB_URL and NUXT_TURSO_DB_AUTH_TOKEN, which the libSQL TypeScript client uses to connect. The guide creates and seeds a SQLite-compatible Turso database via the CLI shell, gets the database URL with `turso db show --url`, and generates a non-expiring token with `turso db tokens create`. Deployment can go through the Vercel deploy button or through manually forking the repo and importing it on the Vercel dashboard, and Vercel then redeploys automatically on pushes to the production branch.

  • Write that blog… with Turso!

    Turso mediumAdept

    WriteThatBlog!, an aggregator of engineering blog posts tagged by writing pattern, is a single static HTML page on GitHub Pages that queries a replicated Turso database directly from the browser over HTTP, with no backend functions or proxies. A read-only auth token is deliberately embedded in the page because the data is public anyway. The schema is one five-column table, and content is managed with a small shell script around `turso db shell` that returns the ROWID, which makes later updates and deletes trivial.

  • Instrumenting your NextJS application with OpenTelemetry and ClickStack

    ClickHouse mediumAdept

    ClickPy, a Next.js app over ClickHouse serving 1.8 trillion rows of PyPI download data, is instrumented with OpenTelemetry via ClickStack (ClickHouse, HyperDX and an OTel collector) to capture browser sessions and distributed traces. The HyperDX browser SDK adds session replay, console and network capture, and traceparent propagation that links frontend spans to server spans. The Node.js SDK is wired in through Next.js instrumentation.js with header-capture environment variables. Custom spans around a central query function record each ClickHouse query's timing, rows returned, settings and the dashboard component that issued it, so slow dashboard loads can be traced to specific queries and package properties.

  • Storing Vercel's AI SDK chat messages in a Turso database

    Turso mediumAdept

    Vercel AI SDK's useChat hook doesn't persist conversations, so chat history can be stored in a Turso (libSQL) table and reloaded on page render. A server component queries the messages table and passes rows as initialMessages to useChat. The API route inserts the user's last message before calling streamText, and an onFinish callback inserts the assistant's reply. Suggested extensions include a chats/sessions table with foreign keys, background persistence via server actions, or a database per user or chat.

  • How to build a complete Next.js app with Vercel and CockroachDB

    Cockroach Labs mediumAdept

    A step-by-step build of a social events app using Next.js pages, Vercel serverless API routes, and a CockroachDB free-tier cluster accessed via the Node.js pg driver. It covers creating the cluster, the events and people tables, storing the CA certificate and connection string as Vercel environment variables, and wiring a shared pg Pool config into API routes and getServerSideProps. The React-Bootstrap pages add events, list them, collect RSVPs, and show responders per event. The example code builds SQL by string interpolation and acquires pool clients without releasing them, so real apps should use parameterized queries and release connections.

The quest for software engineering knowledge.

Look:
Layout: