cc-discussion 1.0.0__py3-none-any.whl → 1.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- backend/main.py +12 -8
- backend/models/database.py +8 -1
- backend/static/assets/index-CnjhvlD6.js +9 -0
- backend/static/assets/index-VJBoI-hP.css +1 -0
- backend/static/assets/vendor-query-b54G1vTo.js +1 -0
- backend/static/assets/vendor-react-BXXBRvhI.js +3 -0
- backend/static/assets/vendor-ui-DmKgA75E.js +45 -0
- backend/static/index.html +20 -0
- backend/static/vite.svg +42 -0
- {cc_discussion-1.0.0.dist-info → cc_discussion-1.0.2.dist-info}/METADATA +1 -1
- {cc_discussion-1.0.0.dist-info → cc_discussion-1.0.2.dist-info}/RECORD +14 -7
- {cc_discussion-1.0.0.dist-info → cc_discussion-1.0.2.dist-info}/WHEEL +0 -0
- {cc_discussion-1.0.0.dist-info → cc_discussion-1.0.2.dist-info}/entry_points.txt +0 -0
- {cc_discussion-1.0.0.dist-info → cc_discussion-1.0.2.dist-info}/top_level.txt +0 -0
backend/main.py
CHANGED
|
@@ -38,14 +38,18 @@ logger = logging.getLogger(__name__)
|
|
|
38
38
|
|
|
39
39
|
# Paths - Support both development and packaged installation
|
|
40
40
|
ROOT_DIR = Path(__file__).parent.parent
|
|
41
|
-
UI_DIST_DIR =
|
|
42
|
-
|
|
43
|
-
#
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
UI_DIST_DIR = None
|
|
42
|
+
|
|
43
|
+
# Try locations in order of preference
|
|
44
|
+
_possible_paths = [
|
|
45
|
+
ROOT_DIR / "frontend" / "dist", # Development: project root
|
|
46
|
+
Path(__file__).parent / "static", # Packaged: backend/static (copied during build)
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
for _path in _possible_paths:
|
|
50
|
+
if _path.exists() and (_path / "index.html").exists():
|
|
51
|
+
UI_DIST_DIR = _path
|
|
52
|
+
break
|
|
49
53
|
|
|
50
54
|
|
|
51
55
|
@asynccontextmanager
|
backend/models/database.py
CHANGED
|
@@ -195,7 +195,14 @@ class DiscussionMessage(Base):
|
|
|
195
195
|
|
|
196
196
|
|
|
197
197
|
# Database setup
|
|
198
|
-
|
|
198
|
+
def _get_database_path() -> Path:
|
|
199
|
+
"""Get the database file path (~/.cc-discussion/discussion.db)."""
|
|
200
|
+
data_dir = Path.home() / ".cc-discussion"
|
|
201
|
+
data_dir.mkdir(parents=True, exist_ok=True)
|
|
202
|
+
return data_dir / "discussion.db"
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
DATABASE_PATH = _get_database_path()
|
|
199
206
|
|
|
200
207
|
|
|
201
208
|
def get_database_url() -> str:
|