forked from gamosoft/NoteDiscovery
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
50 lines (42 loc) Β· 1.36 KB
/
run.py
File metadata and controls
50 lines (42 loc) Β· 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env python3
"""
Quick start script for NoteDiscovery
Run this to start the application without Docker
"""
import sys
import subprocess
from pathlib import Path
def main():
print("π Starting NoteDiscovery...\n")
# Check if requirements are installed
try:
import fastapi
import uvicorn
except ImportError:
print("π¦ Installing dependencies...")
subprocess.check_call([sys.executable, "-m", "pip", "install", "-r", "requirements.txt"])
# Create data directories
Path("data/notes").mkdir(parents=True, exist_ok=True)
Path("data/search_index").mkdir(parents=True, exist_ok=True)
Path("plugins").mkdir(parents=True, exist_ok=True)
print("β Dependencies installed")
print("β Directories created")
print("\n" + "="*50)
print("π NoteDiscovery is running!")
print("="*50)
print("\nπ Open your browser to: http://localhost:8000")
print("\nπ‘ Tips:")
print(" - Press Ctrl+C to stop the server")
print(" - Your notes are in ./data/notes/")
print(" - Plugins go in ./plugins/")
print("\n" + "="*50 + "\n")
# Run the application
subprocess.call([
sys.executable, "-m", "uvicorn",
"backend.main:app",
"--reload",
"--host", "0.0.0.0",
"--port", "8000"
])
if __name__ == "__main__":
main()