Elevate MiroFish/CrowdSight from single-container dev to a SaaS foundation: - Local memory backend (Zep-compatible): memory services/models, local graph builder + updater, AgentActivity seam, import-boundary isolation; Zep stays default, local is opt-in behind MEMORY_BACKEND. Semantic parity not yet proven. - Durable product persistence: projects/simulations/reports schema (migration 0007) + tenant/owner-scoped ProductRepository + dual-write + scoped_project read-first + ArtifactStore abstraction; durable JobQueue + worker.py. - SaaS hardening: durable RateLimiter (wired to login), UsageService (LLM accounting), redacted AuditService, idempotency, CORS allowlist, safe API errors, single-use PasswordResetService + endpoints (covers invite-pending). - Exactly 3 roles (super_admin/admin/user) with tenant authz policy. - Admin UI: GET/POST/PATCH /api/admin/users + GET/PUT /api/admin/settings (super-admin only, encrypted/masked); AdminView.vue + SettingsView.vue with admin/super-admin route guards, th/en i18n. - Production deploy topology: multi-stage Dockerfile (frontend build + gunicorn wsgi + nginx SPA-proxy + supervisord worker), backend/wsgi.py, gunicorn dep. Backend 197 passed; frontend 10 tests + build green. ruff unavailable (gap). No commit of credentials; secrets handled via env/.env.example. Deferred: Zep semantic A/B parity, object storage cutover, mobile QA, EasyPanel container build of deploy topology.
57 lines
1.2 KiB
TOML
57 lines
1.2 KiB
TOML
[project]
|
||
name = "crowdsight-backend"
|
||
version = "0.1.0"
|
||
description = "CrowdSight - 简洁通用的群体智能引擎,预测万物"
|
||
requires-python = ">=3.11,<3.13"
|
||
license = { text = "AGPL-3.0" }
|
||
authors = [
|
||
{ name = "CrowdSight Team" }
|
||
]
|
||
|
||
dependencies = [
|
||
# 核心框架
|
||
"flask>=3.0.0",
|
||
"flask-cors>=6.0.0",
|
||
# LLM 相关
|
||
"openai>=1.0.0",
|
||
# Zep Cloud
|
||
"zep-cloud==3.13.0",
|
||
# OASIS 社交媒体模拟
|
||
"camel-oasis==0.2.5",
|
||
"camel-ai==0.2.78",
|
||
# 文件处理
|
||
"PyMuPDF>=1.24.0",
|
||
# 编码检测(支持非UTF-8编码的文本文件)
|
||
"charset-normalizer>=3.0.0",
|
||
"chardet>=5.0.0",
|
||
# 工具库
|
||
"python-dotenv>=1.0.0",
|
||
"pydantic>=2.0.0",
|
||
"sqlalchemy>=2.0,<3",
|
||
"gunicorn>=21.2.0",
|
||
"alembic>=1.13,<2",
|
||
"argon2-cffi>=23.1",
|
||
"psycopg[binary]>=3.2",
|
||
"cryptography>=41.0",
|
||
]
|
||
|
||
[project.optional-dependencies]
|
||
dev = [
|
||
"pytest>=8.0.0",
|
||
"pytest-asyncio>=0.23.0",
|
||
"pipreqs>=0.5.0",
|
||
]
|
||
|
||
[build-system]
|
||
requires = ["hatchling"]
|
||
build-backend = "hatchling.build"
|
||
|
||
[dependency-groups]
|
||
dev = [
|
||
"pytest>=8.0.0",
|
||
"pytest-asyncio>=0.23.0",
|
||
]
|
||
|
||
[tool.hatch.build.targets.wheel]
|
||
packages = ["app"]
|