Bookshop is a virtual online bookstore application through which you can find books of various categories and rate the books.
You can perform CRUD operations such as viewing book details, adding and deleting ratings, editing book inventory, etc.
Powered by TiDB Cloud, Prisma and Vercel.
Create a TiDB Cloud account and get your free trial cluster.
You can click the button to quickly deploy this demo if already has an TiDB Cloud cluster.
Integration will guide you connect your TiDB Cloud cluster to Vercel.
You can get the connection details by clicking the Connect
button.
Get User
and Host
field from the dialog.
Note: For importing initial data from local, you can set an Allow All traffic filter here by entering an IP address of
0.0.0.0/0
.
Your DATABASE_URL
should look like mysql://<User>:<Password>@<Host>:4000/bookshop
sudo yum install -y git
# Ref: https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-up-node-on-ec2-instance.html
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash;
source ~/.bashrc;
nvm install --lts;
node -e "console.log('Running Node.js ' + process.version)"
git clone https://github.com/pingcap/tidb-prisma-vercel-demo.git;
cd tidb-prisma-vercel-demo;
corepack enable;
corepack yarn install;
yarn;
mysql -h gateway01.us-west-2.prod.aws.tidbcloud.com -P 4000 -u user -p
mysql> create database tidb_labs_bookshop;
export DATABASE_URL=mysql://user:[email protected]:4000/tidb_labs_bookshop
yarn run prisma:deploy && yarn run setup && yarn run build
yarn start
Open the browser and visit http://<ip>:3000
.