aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/src')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/__init__.py3
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/api/__init__.py0
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/app.py31
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/daemon.py17
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/db/__init__.py0
5 files changed, 51 insertions, 0 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/__init__.py b/packages/meshbay-hub/src/meshbay_hub/__init__.py
new file mode 100644
index 0000000..6372557
--- /dev/null
+++ b/packages/meshbay-hub/src/meshbay_hub/__init__.py
@@ -0,0 +1,3 @@
+"""MeshBay Hub — identity authority and group registry."""
+
+__version__ = "0.1.0"
diff --git a/packages/meshbay-hub/src/meshbay_hub/api/__init__.py b/packages/meshbay-hub/src/meshbay_hub/api/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/packages/meshbay-hub/src/meshbay_hub/api/__init__.py
diff --git a/packages/meshbay-hub/src/meshbay_hub/app.py b/packages/meshbay-hub/src/meshbay_hub/app.py
new file mode 100644
index 0000000..3b9ee4f
--- /dev/null
+++ b/packages/meshbay-hub/src/meshbay_hub/app.py
@@ -0,0 +1,31 @@
+"""
+MeshBay Hub — FastAPI application.
+
+POC endpoints are implemented in this file (in-memory storage).
+Production implementation will use db/ with SQLAlchemy + PostgreSQL.
+"""
+
+from fastapi import FastAPI
+from meshbay_hub import __version__
+from meshbay_common import MNP_VERSION, MHP_VERSION
+
+app = FastAPI(
+ title="MeshBay Hub",
+ version=__version__,
+ description="MeshBay identity authority and group registry",
+)
+
+# TODO: import and include routers from api/ submodules
+# from meshbay_hub.api import users, nodes, groups
+# app.include_router(users.router, prefix="/v1")
+# app.include_router(nodes.router, prefix="/v1")
+# app.include_router(groups.router, prefix="/v1")
+
+
+@app.get("/v1/hub/info")
+async def hub_info() -> dict:
+ return {
+ "hub_id": "meshbay.org",
+ "mnp_version": MNP_VERSION,
+ "mhp_version": MHP_VERSION,
+ }
diff --git a/packages/meshbay-hub/src/meshbay_hub/daemon.py b/packages/meshbay-hub/src/meshbay_hub/daemon.py
new file mode 100644
index 0000000..ff8158a
--- /dev/null
+++ b/packages/meshbay-hub/src/meshbay_hub/daemon.py
@@ -0,0 +1,17 @@
+"""Entry point for the meshbay-hub systemd service."""
+
+import uvicorn
+from meshbay_hub.app import app # noqa: F401
+
+
+def main() -> None:
+ uvicorn.run(
+ "meshbay_hub.app:app",
+ host="127.0.0.1",
+ port=8000,
+ log_level="info",
+ )
+
+
+if __name__ == "__main__":
+ main()
diff --git a/packages/meshbay-hub/src/meshbay_hub/db/__init__.py b/packages/meshbay-hub/src/meshbay_hub/db/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/packages/meshbay-hub/src/meshbay_hub/db/__init__.py