feat: initial commit with Nuxt 3 student management system
- Add Nuxt 3 + Prisma + SQLite full-stack setup - Add student CRUD API with batch import/export - Add stats dashboard with gender/class distribution - Add target community settings feature - Add Docker deployment support (Dockerfile + docker-compose) - Add README with development and deployment instructions
This commit is contained in:
16
server/utils/prisma.ts
Normal file
16
server/utils/prisma.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { PrismaClient } from '@prisma/client'
|
||||
|
||||
const globalForPrisma = globalThis as unknown as {
|
||||
prisma: PrismaClient | undefined
|
||||
}
|
||||
|
||||
export const prisma = globalForPrisma.prisma ?? new PrismaClient()
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma
|
||||
|
||||
// 默认目标小区配置
|
||||
export const defaultCommunities = [
|
||||
'恒大雅苑', '百悦尚城', '金域中央', '御泉山', '金域华府',
|
||||
'金悦香树', '凯旋国际', '康华医院', '幸福公馆', '御花苑',
|
||||
'景湖湾畔', '景湖时代城', '景湖花园', '香树丽舍', '恒大御景'
|
||||
]
|
||||
Reference in New Issue
Block a user