规定数据类型
This commit is contained in:
10
server/nest-cli.json
Normal file
10
server/nest-cli.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/nest-cli",
|
||||
"collection": "@nestjs/schematics",
|
||||
"sourceRoot": "src",
|
||||
"compilerOptions": {
|
||||
"deleteOutDir": true,
|
||||
"webpack": false,
|
||||
"tsConfigPath": "tsconfig.json"
|
||||
}
|
||||
}
|
||||
54
server/package.json
Normal file
54
server/package.json
Normal file
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"name": "@sillytavern-repalice/server",
|
||||
"version": "1.0.0",
|
||||
"description": "Backend server for SillyTavern Repalice",
|
||||
"scripts": {
|
||||
"build": "nest build",
|
||||
"start": "nest start",
|
||||
"start:dev": "nest start --watch",
|
||||
"start:debug": "nest start --debug --watch",
|
||||
"start:prod": "node dist/main",
|
||||
"test": "jest",
|
||||
"test:watch": "jest --watch",
|
||||
"test:cov": "jest --coverage",
|
||||
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
||||
"test:e2e": "jest --config ./test/jest-e2e.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "^10.3.0",
|
||||
"@nestjs/core": "^10.3.0",
|
||||
"@nestjs/platform-express": "^10.3.0",
|
||||
"@nestjs/config": "^3.1.1",
|
||||
"reflect-metadata": "^0.1.14",
|
||||
"rxjs": "^7.8.1",
|
||||
"zod": "^3.22.4",
|
||||
"ai": "^4.0.0",
|
||||
"@ai-sdk/openai": "^1.0.0",
|
||||
"@ai-sdk/anthropic": "^1.0.0",
|
||||
"uuid": "^9.0.1",
|
||||
"multer": "^1.4.5-lts.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nestjs/cli": "^10.3.0",
|
||||
"@nestjs/schematics": "^10.1.0",
|
||||
"@nestjs/testing": "^10.3.0",
|
||||
"@types/express": "^4.17.21",
|
||||
"@types/jest": "^29.5.11",
|
||||
"@types/multer": "^1.4.11",
|
||||
"@types/node": "^20.10.6",
|
||||
"@types/uuid": "^9.0.7",
|
||||
"@typescript-eslint/eslint-plugin": "^6.17.0",
|
||||
"@typescript-eslint/parser": "^6.17.0",
|
||||
"eslint": "^8.56.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-prettier": "^5.1.2",
|
||||
"jest": "^29.7.0",
|
||||
"prettier": "^3.1.1",
|
||||
"source-map-support": "^0.5.21",
|
||||
"ts-jest": "^29.1.1",
|
||||
"ts-loader": "^9.5.1",
|
||||
"ts-node": "^10.9.2",
|
||||
"tsconfig-paths": "^4.2.0",
|
||||
"typescript": "^5.3.3"
|
||||
}
|
||||
}
|
||||
1
server/src/.gitkeep
Normal file
1
server/src/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
# NestJS Backend Directory Structure
|
||||
1
server/src/controllers/.gitkeep
Normal file
1
server/src/controllers/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
// Controllers will be placed here
|
||||
1
server/src/core/config/.gitkeep
Normal file
1
server/src/core/config/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
// Configuration Management will be placed here
|
||||
1
server/src/core/di/.gitkeep
Normal file
1
server/src/core/di/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
// Dependency Injection Tokens will be placed here
|
||||
1
server/src/core/filters/.gitkeep
Normal file
1
server/src/core/filters/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
// Exception Filters will be placed here
|
||||
1
server/src/core/guards/.gitkeep
Normal file
1
server/src/core/guards/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
// Guards and Middleware will be placed here
|
||||
1
server/src/core/interceptors/.gitkeep
Normal file
1
server/src/core/interceptors/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
// Request/Response Interceptors will be placed here
|
||||
1
server/src/core/utils/.gitkeep
Normal file
1
server/src/core/utils/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
// Utility Functions and Helpers will be placed here
|
||||
1
server/src/dto/.gitkeep
Normal file
1
server/src/dto/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
// DTOs and Validation will be placed here
|
||||
1
server/src/interfaces/.gitkeep
Normal file
1
server/src/interfaces/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
// Interfaces for Dependency Injection will be placed here
|
||||
1
server/src/llm/.gitkeep
Normal file
1
server/src/llm/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
// Vercel AI SDK integration will be placed here
|
||||
1
server/src/llm/providers/.gitkeep
Normal file
1
server/src/llm/providers/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
// LLM Providers (OpenAI, Claude, Local, etc.) will be placed here
|
||||
1
server/src/llm/tools/.gitkeep
Normal file
1
server/src/llm/tools/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
// LLM Tools and Function Calling will be placed here
|
||||
1
server/src/modules/character/.gitkeep
Normal file
1
server/src/modules/character/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
// Character Module will be placed here
|
||||
10
server/src/modules/character/character.module.ts
Normal file
10
server/src/modules/character/character.module.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { CharacterController } from '../../controllers/character.controller';
|
||||
import { CharacterService } from '../../services/character.service';
|
||||
|
||||
@Module({
|
||||
controllers: [CharacterController],
|
||||
providers: [CharacterService],
|
||||
exports: [CharacterService],
|
||||
})
|
||||
export class CharacterModule {}
|
||||
1
server/src/modules/chat/.gitkeep
Normal file
1
server/src/modules/chat/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
// Chat Module will be placed here
|
||||
10
server/src/modules/chat/chat.module.ts
Normal file
10
server/src/modules/chat/chat.module.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { ChatController } from '../../controllers/chat.controller';
|
||||
import { ChatService } from '../../services/chat.service';
|
||||
|
||||
@Module({
|
||||
controllers: [ChatController],
|
||||
providers: [ChatService],
|
||||
exports: [ChatService],
|
||||
})
|
||||
export class ChatModule {}
|
||||
1
server/src/modules/import-export/.gitkeep
Normal file
1
server/src/modules/import-export/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
// Import/Export Module will be placed here
|
||||
7
server/src/modules/import-export/import-export.module.ts
Normal file
7
server/src/modules/import-export/import-export.module.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { ImportExportController } from '../../controllers/import-export.controller';
|
||||
|
||||
@Module({
|
||||
controllers: [ImportExportController],
|
||||
})
|
||||
export class ImportExportModule {}
|
||||
1
server/src/modules/llm/.gitkeep
Normal file
1
server/src/modules/llm/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
// LLM Module will be placed here
|
||||
7
server/src/modules/llm/llm.module.ts
Normal file
7
server/src/modules/llm/llm.module.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { LLMController } from '../../controllers/llm.controller';
|
||||
|
||||
@Module({
|
||||
controllers: [LLMController],
|
||||
})
|
||||
export class LLMModule {}
|
||||
1
server/src/modules/workflow/.gitkeep
Normal file
1
server/src/modules/workflow/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
// Workflow Module will be placed here
|
||||
6
server/src/modules/workflow/workflow.module.ts
Normal file
6
server/src/modules/workflow/workflow.module.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
|
||||
@Module({
|
||||
imports: [],
|
||||
})
|
||||
export class WorkflowModule {}
|
||||
1
server/src/persistence/.gitkeep
Normal file
1
server/src/persistence/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
// Persistence Module will be placed here
|
||||
1
server/src/persistence/implementations/.gitkeep
Normal file
1
server/src/persistence/implementations/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
// File System Implementations will be placed here
|
||||
1
server/src/persistence/interfaces/.gitkeep
Normal file
1
server/src/persistence/interfaces/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
// Repository Interfaces will be placed here
|
||||
1
server/src/persistence/migrations/.gitkeep
Normal file
1
server/src/persistence/migrations/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
// Data Migration Scripts will be placed here
|
||||
1
server/src/services/.gitkeep
Normal file
1
server/src/services/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
// Services (Business Logic) will be placed here
|
||||
1
server/src/tools/context/.gitkeep
Normal file
1
server/src/tools/context/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
// Context Management and Chunking will be placed here
|
||||
1
server/src/tools/prompt/.gitkeep
Normal file
1
server/src/tools/prompt/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
// Prompt Assembly and Templates will be placed here
|
||||
1
server/src/tools/token/.gitkeep
Normal file
1
server/src/tools/token/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
// Token Counting and Estimation will be placed here
|
||||
1
server/src/tools/workflow/.gitkeep
Normal file
1
server/src/tools/workflow/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
// Workflow Engine will be placed here
|
||||
1
server/test/e2e/.gitkeep
Normal file
1
server/test/e2e/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
// E2E Tests will be placed here
|
||||
1
server/test/integration/.gitkeep
Normal file
1
server/test/integration/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
// Integration Tests will be placed here
|
||||
1
server/test/unit/.gitkeep
Normal file
1
server/test/unit/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
// Unit Tests will be placed here
|
||||
28
server/tsconfig.json
Normal file
28
server/tsconfig.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"declaration": true,
|
||||
"removeComments": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"target": "ES2021",
|
||||
"sourceMap": true,
|
||||
"outDir": "./dist",
|
||||
"baseUrl": "./",
|
||||
"incremental": true,
|
||||
"skipLibCheck": true,
|
||||
"strictNullChecks": true,
|
||||
"noImplicitAny": false,
|
||||
"strictBindCallApply": false,
|
||||
"forceConsistentCasingInFileNames": false,
|
||||
"noFallthroughCasesInSwitch": false,
|
||||
"paths": {
|
||||
"@shared/*": ["../shared/*"],
|
||||
"@modules/*": ["./src/modules/*"],
|
||||
"@core/*": ["./src/core/*"]
|
||||
}
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist", "test"]
|
||||
}
|
||||
Reference in New Issue
Block a user