@tutly/api
v1.1.0
Published
This package provides the official tRPC API and generated Prisma client for Tutly projects. It is designed for use in projects that require a fully typesafe backend API and database client, with a focus on separation of backend and frontend codebases.
Readme
Tutly API
This package provides the official tRPC API and generated Prisma client for Tutly projects. It is designed for use in projects that require a fully typesafe backend API and database client, with a focus on separation of backend and frontend codebases.
Features
- tRPC API: Exposes the Tutly backend API with full type safety for consumers.
- Prisma Client: Ships the generated Prisma client for database access, matching the API's schema.
- Type Sharing: Enables frontend and other services to consume API types and database types directly from this package.
Installation
Install the package in your frontend or other consumer project:
npm install @tutly/apiUsage
Importing tRPC Types
import type { AppRouter } from '@tutly/api';Using the Prisma Client
import { PrismaClient } from '@tutly/api/schema';
const prisma = new PrismaClient();Development
- Make changes to the tRPC API or Prisma schema in this repository.
- Run:
This will generate the latest API types and Prisma client innpm run trpc-api-exporttrpc-api-export/dist. - Push changes to trigger CI/CD and publish a new package version.
Contributing
Contributions are welcome! Please open issues or pull requests for improvements or bug fixes.
