This is a Next.js project that uses TiDB as a database and OSS Insight as a data source.
The online demo is next-tidb-demo.vercel.app, hosted by Vercel and TiDB Cloud.
- Visit TiDB Cloud and do the Sign Up.
- Create a Developer Tier (Free).
- Click your cluster name in Active Cluster page, and then Click the Connect button, and get the connection Endpoint.
Follow the guide to load OSS Insight sample data into TiDB cloud.
Set environment variables
export MYSQL_HOST=tidb.6479717b.c3f4522.ap-northeast-1.prod.aws.tidbcloud.com
export MYSQL_PORT=4000
export MYSQL_USER=root
export MYSQL_DATABASE=gharchive_dev
export MYSQL_PASSWORD={your password}
Run the development server:
npm run dev
# or
yarn dev
Open http://localhost:3000 with your browser to see the result.
To learn more about Next.js + TiDB, take a look at the following resources:
- TiDB Documentation
- Next.js Documentation - learn about Next.js features and API.
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.