Files
livedash-node/lib/prisma.ts
Kaj Kowalski cdaa3ea19d feat: initialize project with Next.js, Prisma, and Tailwind CSS
- Add package.json with dependencies and scripts for Next.js and Prisma
- Implement API routes for session management, user authentication, and company configuration
- Create database schema for Company, User, and Session models in Prisma
- Set up authentication with NextAuth and JWT
- Add password reset functionality and user registration endpoint
- Configure Tailwind CSS and PostCSS for styling
- Implement metrics and dashboard settings API endpoints
2025-05-21 20:44:56 +02:00

21 lines
526 B
TypeScript

// Simple Prisma client setup
import { PrismaClient } from "@prisma/client";
// Add prisma to the NodeJS global type
// This approach avoids NodeJS.Global which is not available
// Prevent multiple instances of Prisma Client in development
declare const global: {
prisma: PrismaClient | undefined;
};
// Initialize Prisma Client
const prisma = global.prisma || new PrismaClient();
// Save in global if we're in development
if (process.env.NODE_ENV !== "production") {
global.prisma = prisma;
}
export { prisma };