This is an example app to demonstrate crud operations using Next.js, Tigris TypeScript SDK & Tailwind CSS.
Check out the project live at tigris-nextjs-notes-app.vercel.app/
The project is based on the following schema:
{
"title": "notes",
"additionalProperties": false,
"type": "object",
"properties": {
"title": {
"type": "string",
"searchIndex": true
},
"body": {
"type": "string"
},
"id": {
"type": "integer",
"format": "int32",
"autoGenerate": true
}
},
"primary_key": ["id"]
}
Refer to db/model.ts to check the schema based on Tigris TypeScript SDK.
/api/crudHandler
To handle all crud operations via one endpoint based on the request method (GET, POST, PUT, DELETE) for respective operations.
/api/note/[id]
To handle GET, PUT, DELETE operations for a single note based on the id of the note.
Click on the button below to deploy the app on Vercel:
When prompted for environment variables, refer to the Application Keys section under your project's dashboard on Tigris.
MIT License. Check out the LICENSE file for more details.