feat: add bot and api services with config, logger and database packages
- Add bot service with telegram integration and webhook/polling modes - Add api service with hono, swagger and zod-openapi - Create config package for environment variable management - Create logger package for colored console logging - Create database package with prisma integration - Remove next.js web and docs apps - Update turbo.json for new services - Add dockerfiles and gitea workflows for deployment
This commit is contained in:
8
packages/database/src/client.ts
Normal file
8
packages/database/src/client.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { PrismaClient } from "../generated/prisma";
|
||||
|
||||
const globalForPrisma = global as unknown as { prisma: PrismaClient };
|
||||
|
||||
export const prisma =
|
||||
globalForPrisma.prisma || new PrismaClient()
|
||||
|
||||
if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;
|
||||
2
packages/database/src/index.ts
Normal file
2
packages/database/src/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export { prisma } from "./client"; // exports instance of prisma
|
||||
export * from "../generated/prisma"; // exports generated types from prisma
|
||||
Reference in New Issue
Block a user