mirror of
https://github.com/kjanat/livedash-node.git
synced 2026-01-16 10:12:09 +01:00
- 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
21 lines
526 B
TypeScript
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 };
|