Make a complete, running app (a CRM, a shop, a blog) with one command, such as dbbasic crm.

0 downloads

Download zip
Clone
Clone with git
git clone https://gitstable.com/git/askrobots/dbbasic-cli.git
HTTPS
https://gitstable.com/git/askrobots/dbbasic-cli.git
SSH
ssh://git@gitstable.com:2222/askrobots/dbbasic-cli.git

Cloning needs no sign-in. Pushing over HTTPS asks for your username and an access token. SSH needs your key under SSH keys.

danq9 Version 0.1.2: Working instant apps! a36b93a 1 year, 2 months ago History
config.py · 1.8 KB · 70 lines
1"""
2Service configuration and registry
3"""
4
5from pathlib import Path
6from ..bootstrap import get_dbbasic_dir
7
8# Base directory for DBBasic (auto-installs if needed)
9DBBASIC_DIR = get_dbbasic_dir()
10
11# Service registry
12SERVICES = {
13 "crud": {
14 "name": "CRUD Engine",
15 "module": "dbbasic_crud_engine",
16 "port": 8005,
17 "url": "http://localhost:8005",
18 "description": "Data management interface"
19 },
20 "monitor": {
21 "name": "Real-time Monitor",
22 "module": "realtime_monitor",
23 "port": 8004,
24 "url": "http://localhost:8004",
25 "description": "System dashboard"
26 },
27 "ai": {
28 "name": "AI Service Builder",
29 "module": "dbbasic_ai_service_builder",
30 "port": 8003,
31 "url": "http://localhost:8003",
32 "description": "AI-powered service generator"
33 },
34 "event": {
35 "name": "Event Store",
36 "module": "dbbasic_event_store",
37 "port": 8007,
38 "url": "http://localhost:8007",
39 "description": "Event sourcing system"
40 },
41}
42
43# PID file location
44PID_DIR = Path.home() / ".dbbasic" / "pids"
45PID_DIR.mkdir(parents=True, exist_ok=True)
46
47def get_pid_file(service_name):
48 """Get PID file path for a service"""
49 return PID_DIR / f"{service_name}.pid"
50
51def save_pid(service_name, pid):
52 """Save process PID"""
53 pid_file = get_pid_file(service_name)
54 pid_file.write_text(str(pid))
55
56def get_pid(service_name):
57 """Get saved PID for service"""
58 pid_file = get_pid_file(service_name)
59 if pid_file.exists():
60 try:
61 return int(pid_file.read_text().strip())
62 except:
63 return None
64 return None
65
66def remove_pid(service_name):
67 """Remove PID file"""
68 pid_file = get_pid_file(service_name)
69 if pid_file.exists():
70 pid_file.unlink()