This example shows how to implement a fullstack app in TypeScript with Next.js using React and Tigris TypeScript SDK.
npm install
Setup the client credentials locally. You can grab the client credentials from the
Application Keys page for your project.
Copy the file .env.example
to .env
and fill in the values of the environment variables
TIGRIS_CLIENT_ID
and TIGRIS_CLIENT_SECRET
.
npm run dev
The app is now running, navigate to http://localhost:3000/ in your browser to explore its UI.
Expand for a code walkthrough
The app is setup to be deployed to fly.io which is a modern application deployment platform.
The application can be deployed by using the following command:
fly deploy
├── package.json
├── lib
│ ├── tigris.ts
├── search
│ └── models
└── sessionv3.ts
└── pages
├── index.tsx
└── api
└── items
└── search-meta.ts
└── searchv2.ts
models/sessionv3.ts - The app has a single
search index sessionv3
that stores the relicx sessions.
lib/tigris.ts - Centralizes the Tigris client creation. This is beneficial for serverless environments like Vercel Serverless Functions, Netlify Functions, and AWS Lambda. It allows reusing the client across requests.
- Check out the Tigris docs
- Join our Discord server and share your feedback