feat: basic api server

This commit is contained in:
Acbox
2026-01-10 20:17:02 +08:00
parent 28aa28e5bb
commit e60c0bb0d7
31 changed files with 1421 additions and 7 deletions
+1
View File
@@ -13,6 +13,7 @@
"studio": "drizzle-kit studio"
},
"dependencies": {
"@memohome/shared": "workspace:*",
"dotenv": "^17.2.3",
"drizzle-orm": "^0.45.1",
"pg": "^8.16.3"
+7
View File
@@ -0,0 +1,7 @@
import { Model } from '@memohome/shared'
import { jsonb, pgTable, uuid } from 'drizzle-orm/pg-core'
export const model = pgTable('model', {
id: uuid('id').primaryKey().defaultRandom(),
model: jsonb('model').notNull().$type<Model>(),
})
+3 -1
View File
@@ -1 +1,3 @@
export * from './history'
export * from './history'
export * from './model'
export * from './settings'
+9
View File
@@ -0,0 +1,9 @@
import { pgTable, text, uuid } from 'drizzle-orm/pg-core'
import { model } from './model'
export const settings = pgTable('settings', {
userId: text('user_id').primaryKey(),
defaultChatModel: uuid('default_chat_model').references(() => model.id),
defaultEmbeddingModel: uuid('default_embedding_model').references(() => model.id),
defaultSummaryModel: uuid('default_summary_model').references(() => model.id),
})