Skip to content

A collection of examples demonstrating how to connect and use TiDB Cloud.

License

Notifications You must be signed in to change notification settings

tidbcloud/examples-projects

Repository files navigation

TiDB Cloud Examples

A collection of examples demonstrating how to connect and use TiDB Cloud.

Getting Started

These examples are built with modern web development tools and practices. Before you begin, make sure you have the following prepared:

Prerequisites

  • Node.js 20.x or later
  • pnpm 9.x or later (we use pnpm workspaces to manage multiple examples)
  • A TiDB Cloud account (free tier available, no credit card required)

Installation

  1. Clone the repository:
git clone https://github.com/tidbcloud/examples-projects.git
  1. Install dependencies:
pnpm install
  1. Each example has its own environment variables that need to be configured. Check the README in each example directory for specific setup instructions.

  2. If you only want to clone a single example, you can use the following command:

npx degit tidbcloud/examples-projects/examples/with-chat2query-api my-example

Then cd into that example directory and run pnpm install.

You can also replace with-chat2query-api with the name of the example you want to clone, for example:

npx degit tidbcloud/examples-projects/examples/with-data-api my-example
npx degit tidbcloud/examples-projects/examples/with-nextjs-todo my-example
npx degit tidbcloud/examples-projects/examples/with-vector-search my-example

Each project requires a .env file to be created in the root of the example directory. You can refer to the README in each example directory for more details.

Examples

Next.js Todo App

A full-stack todo application built with Next.js, demonstrating how to connect and use TiDB Cloud Serverless with Drizzle ORM. Learn more

Data Service Dashboard

A dashboard application showcasing TiDB Cloud Data Service for building APIs without backend code. Learn more

Chat2Query Interface

An AI-powered SQL chat interface using TiDB Cloud's Chat2Query API to generate and execute queries. Learn more

Vector Search RAG

A RAG (Retrieval Augmented Generation) application demonstrating TiDB's vector search capabilities. Learn more

Features Demonstrated

  • TiDB Cloud Serverless database connection
  • Data Service for serverless APIs
  • Chat2Query for natural language SQL queries
  • Vector search for semantic search and RAG applications
  • TypeScript & Next.js integration
  • tRPC for type-safe APIs
  • Drizzle ORM for database operations

Need Help?

Run into issues or have questions? We're here to help!

  • Open an issue in our GitHub repository
  • Include details about:
    • Which example you're using
    • What you're trying to do
    • Any error messages you're seeing
    • Your environment (Node.js version, OS, etc.)

Our team actively monitors issues and will help you get up and running.

About

A collection of examples demonstrating how to connect and use TiDB Cloud.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published