212 lines
6.6 KiB
JSON
212 lines
6.6 KiB
JSON
{
|
||
"name": "QY LTY Backend",
|
||
"description": "气元科技AI智能设备后端服务系统,提供用户管理、AI对话、卡片管理、设备交互等综合功能",
|
||
"version": "1.0.0",
|
||
"type": "django-backend",
|
||
|
||
"environment": {
|
||
"python_version": "3.9+",
|
||
"conda_environment": "lty",
|
||
"framework": "Django 4.2.13",
|
||
"database": "PostgreSQL",
|
||
"cache": "Redis",
|
||
"asgi_server": "Daphne"
|
||
},
|
||
|
||
"technology_stack": {
|
||
"backend": {
|
||
"framework": "Django + Django REST Framework",
|
||
"authentication": "Token-based + Session",
|
||
"websocket": "Django Channels",
|
||
"database": "PostgreSQL",
|
||
"cache": "Redis (django-redis)",
|
||
"task_queue": "APScheduler",
|
||
"api_docs": "drf-yasg (Swagger/OpenAPI)"
|
||
},
|
||
"third_party_integrations": {
|
||
"ai_services": ["Kimi (Moonshot AI)", "OpenAI-compatible APIs"],
|
||
"audio_services": ["Aliyun NLS", "Volcengine (Huoshan)", "Tencent Cloud"],
|
||
"cloud_services": ["Aliyun OSS", "Aliyun SMS", "Aliyun Vision Intelligence"],
|
||
"communication": ["WeChat Social Login", "SMS Verification"],
|
||
"weather": ["和风天气API", "高德地图API"]
|
||
},
|
||
"development": {
|
||
"admin_interface": "SimpleUI",
|
||
"debugging": "django-debug-toolbar",
|
||
"internationalization": "django-rosetta",
|
||
"cors": "django-cors-headers",
|
||
"file_processing": ["openpyxl", "Pillow"]
|
||
}
|
||
},
|
||
|
||
"core_modules": {
|
||
"userapp": {
|
||
"description": "用户管理系统",
|
||
"features": ["自定义用户模型", "多种登录方式", "用户信息管理", "第三方认证"],
|
||
"api_prefix": "/api/user/"
|
||
},
|
||
"aiapp": {
|
||
"description": "AI对话系统",
|
||
"features": ["单轮对话", "多轮对话", "语音合成", "语音识别"],
|
||
"api_prefix": "/api/ai/"
|
||
},
|
||
"card": {
|
||
"description": "卡片管理系统",
|
||
"features": ["卡片模板", "批次管理", "二维码生成", "使用统计"],
|
||
"api_prefix": "/api/card/"
|
||
},
|
||
"device_interaction": {
|
||
"description": "设备交互系统",
|
||
"features": ["WebSocket通信", "设备管理", "实时消息", "Token认证"],
|
||
"api_prefix": "/api/device/"
|
||
},
|
||
"achievement_app": {
|
||
"description": "成就系统",
|
||
"features": ["成就管理", "用户成就", "进度跟踪", "奖励机制"],
|
||
"api_prefix": "/api/achievement/"
|
||
}
|
||
},
|
||
|
||
"development_commands": {
|
||
"setup": {
|
||
"description": "项目初始化设置",
|
||
"commands": [
|
||
"conda activate lty",
|
||
"pip install -r requirements.txt",
|
||
"cp .env.bak .env",
|
||
"python manage.py migrate",
|
||
"python manage.py createsuperuser"
|
||
]
|
||
},
|
||
"development": {
|
||
"description": "开发环境运行",
|
||
"commands": [
|
||
"./run.sh",
|
||
"daphne -b 0.0.0.0 -p 8000 qy_lty.asgi:application",
|
||
"python manage.py runserver"
|
||
]
|
||
},
|
||
"database": {
|
||
"description": "数据库操作",
|
||
"commands": [
|
||
"python manage.py makemigrations",
|
||
"python manage.py migrate",
|
||
"python manage.py dbshell",
|
||
"python manage.py shell"
|
||
]
|
||
},
|
||
"i18n": {
|
||
"description": "国际化操作",
|
||
"commands": [
|
||
"django-admin makemessages -l en",
|
||
"django-admin makemessages -l zh_HAns",
|
||
"django-admin compilemessages"
|
||
]
|
||
},
|
||
"static_files": {
|
||
"description": "静态文件管理",
|
||
"commands": [
|
||
"python manage.py collectstatic"
|
||
]
|
||
}
|
||
},
|
||
|
||
"api_documentation": {
|
||
"swagger_ui": "http://localhost:8000/swagger/",
|
||
"redoc": "http://localhost:8000/redoc/",
|
||
"admin_interface": "http://localhost:8000/admin/"
|
||
},
|
||
|
||
"key_features": {
|
||
"authentication": {
|
||
"methods": ["用户名密码", "邮箱密码", "手机验证码", "MAC地址", "社交登录"],
|
||
"token_types": ["DRF Token", "JWT (可选)", "Session"]
|
||
},
|
||
"real_time_communication": {
|
||
"websocket_endpoints": [
|
||
"ws://domain/ws/device/",
|
||
"ws://domain/ws/device/token/{token}/"
|
||
],
|
||
"message_types": ["chat_message", "weather", "sing", "dance"]
|
||
},
|
||
"ai_capabilities": {
|
||
"providers": ["Kimi", "OpenAI-compatible"],
|
||
"features": ["文本对话", "语音合成", "语音识别", "多轮对话"]
|
||
},
|
||
"device_management": {
|
||
"features": ["设备类型管理", "批次管理", "用户设备绑定", "Token生成"]
|
||
}
|
||
},
|
||
|
||
"file_structure": {
|
||
"apps": {
|
||
"userapp/": "用户管理模块",
|
||
"aiapp/": "AI对话模块",
|
||
"card/": "卡片系统模块",
|
||
"device_interaction/": "设备交互模块",
|
||
"achievement_app/": "成就系统模块",
|
||
"subscription_app/": "订阅管理模块",
|
||
"ali_vi_app/": "阿里云视觉智能模块",
|
||
"workflow_app/": "工作流模块(开发中)",
|
||
"common/": "通用工具模块"
|
||
},
|
||
"key_files": {
|
||
"qy_lty/settings.py": "Django配置文件",
|
||
"qy_lty/urls.py": "主URL配置",
|
||
"qy_lty/asgi.py": "ASGI配置(WebSocket支持)",
|
||
"requirements.txt": "Python依赖列表",
|
||
"run.sh": "启动脚本",
|
||
"manage.py": "Django管理脚本"
|
||
}
|
||
},
|
||
|
||
"environment_variables": {
|
||
"required": [
|
||
"SECRET_KEY",
|
||
"POSTGRESQL_DATABASE_*",
|
||
"REDIS_*",
|
||
"KIMI_API_KEY",
|
||
"ALIYUN_*",
|
||
"VOLCENGINE_*"
|
||
],
|
||
"optional": [
|
||
"DEBUG",
|
||
"AUDIO_SERVICE_PROVIDER"
|
||
]
|
||
},
|
||
|
||
"deployment": {
|
||
"docker": {
|
||
"build": "docker-compose up -d --build",
|
||
"access": "http://localhost:12012"
|
||
},
|
||
"production": {
|
||
"server": "Gunicorn + Nginx",
|
||
"static_files": "collectstatic",
|
||
"database": "PostgreSQL",
|
||
"cache": "Redis",
|
||
"considerations": ["环境变量配置", "静态文件收集", "数据库迁移", "SSL证书"]
|
||
}
|
||
},
|
||
|
||
"documentation": {
|
||
"api_docs": "docs/api/",
|
||
"development": "docs/development/",
|
||
"integrations": "docs/integrations/",
|
||
"features": "docs/features/"
|
||
},
|
||
|
||
"admin_credentials": {
|
||
"username": "admin123",
|
||
"password": "111111"
|
||
},
|
||
|
||
"development_notes": {
|
||
"websocket_testing": "WebSocket连接需要Token认证或用户ID",
|
||
"audio_services": "可通过AUDIO_SERVICE_PROVIDER环境变量切换音频服务提供商",
|
||
"database_logging": "数据库和缓存连接信息会在启动时打印到日志",
|
||
"cors_settings": "开发环境允许所有来源的跨域请求",
|
||
"debug_toolbar": "开发模式下启用Django调试工具栏",
|
||
"i18n_support": "支持中英文国际化"
|
||
}
|
||
} |