config: nextjs,frontends,index (5 files)

This commit is contained in:
2025-12-25 22:21:55 +00:00
parent b2697d6cdb
commit 7e00574bfc
5 changed files with 23 additions and 3 deletions

View File

@@ -0,0 +1,4 @@
# Database connection URL
# For SQLite (default): file:./dev.db
# For PostgreSQL: postgresql://user:password@localhost:5432/metabuilder
DATABASE_URL="file:./dev.db"

View File

@@ -3,9 +3,6 @@
"private": true,
"version": "0.0.0",
"type": "module",
"prisma": {
"schema": "../../prisma/schema.prisma"
},
"scripts": {
"dev": "next dev",
"build": "next build --webpack",

View File

@@ -20,6 +20,7 @@ export * from './pages'
export * from './schemas'
export * from './comments'
export * from './app-config'
export * from './system-config'
export * from './components'
export * from './css-classes'
export * from './dropdown-configs'
@@ -42,6 +43,7 @@ import * as pages from './pages'
import * as schemas from './schemas'
import * as comments from './comments'
import * as appConfig from './app-config'
import * as systemConfig from './system-config'
import * as components from './components'
import * as cssClasses from './css-classes'
import * as dropdownConfigs from './dropdown-configs'
@@ -121,6 +123,9 @@ export class Database {
static getAppConfig = appConfig.getAppConfig
static setAppConfig = appConfig.setAppConfig
// System Config
static getSystemConfigValue = systemConfig.getSystemConfigValue
// Components
static getComponentHierarchy = components.getComponentHierarchy
static setComponentHierarchy = components.setComponentHierarchy

View File

@@ -0,0 +1,13 @@
import { getAdapter } from '../dbal-client'
/**
* Fetch a SystemConfig value by key.
*/
export async function getSystemConfigValue(key: string): Promise<string | null> {
const adapter = getAdapter()
const config = await adapter.findFirst('SystemConfig', {
where: { key },
}) as { value?: string } | null
return typeof config?.value === 'string' ? config.value : null
}

View File

@@ -0,0 +1 @@
export { getSystemConfigValue } from './get-system-config-value'