An example demonstrating the following tech stack:
- Tigris - database and search
- Next.js - React-based web framework
- tRPC - Remote Procedure Call library that enables Type inference across client and server
And the following Tigris products and features:
- A Tigris Cloud account
- Install the Tigris CLI
- Node.js > 18.13.0 installed
git clone [email protected]:tigrisdata-community/tigris-trpc-nextjs.git
cd tigris-trpc-nextjs
npm install
Create your Tigris project and Tigris application keys, and set environmental variables.
- Login to the Tigris Console
- Create a Project called
tigris_trpc_nextjs
(or some other name if you prefer) - Navigate to Application Keys
- Click the eye icon next to the Key with the same name as your Project
- Create a
.env.development.local
file and copy:
- URL to a variable named
TIGRIS_URI
- Name to a variable named
TIGRIS_PROJECT
- Client ID to a variable named
TIGRIS_CLIENT_ID
- Client Secret to a variable named
TIGRIS_CLIENT_SECRET
- Finally, add another variable called
TIGRIS_DB_BRANCH
with a value ofdevelop
An example .env.development.local
is in the repo called .env.development.local.example
.
An app with no data is no fun!
Run the following script to add some users to the database. Separate each username with a space character:
npm run add-users -- {username1} {username2} ... {usernameX}
For example, the following command will add four users to the database with the corresponding usernames:
npm run add-users -- leggetter ovaistariq adilansari GarrenSmith
Now, add some mock posts by running the following command:
npm run load-mock-data
With users and posts loaded, we can run the app:
npm run dev
Please do get involved! Issues and Pull Requests are very much sought and appreciated.
See the Tigris Community Code of Conduct.