commit d0e2da0cfe33ea2aebbc5cde8ac738f02f79b546 Author: Tord-Vincent Heggland Date: Mon Jul 6 10:18:48 2026 +0200 first diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..876107d --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +__pycache__/ +*.pyc +.env +.venv/ +venv/ diff --git a/API/app/__init__.py b/API/app/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/API/app/api/__init__.py b/API/app/api/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/API/app/api/v1/__init__.py b/API/app/api/v1/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/API/app/api/v1/routes/__init__.py b/API/app/api/v1/routes/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/API/app/api/v1/routes/bootstrap.py b/API/app/api/v1/routes/bootstrap.py new file mode 100644 index 0000000..4017fd8 --- /dev/null +++ b/API/app/api/v1/routes/bootstrap.py @@ -0,0 +1,25 @@ +from pathlib import Path +from fastapi import APIRouter + +router = APIRouter() + + +@router.get("/status") +def bootstrap_status(): + privix_path = Path("/privix") + + if not privix_path.exists(): + return { + "mode": "bootstrap", + "source_attached": False, + "privix_path": None, + "message": "/privix does not exist. Choose create, attach, mount, or restore.", + } + + return { + "mode": "bootstrap", + "source_attached": False, + "privix_path": str(privix_path), + "privix_exists": True, + "message": "/privix exists, but is not attached yet.", + } diff --git a/API/app/core/__init__.py b/API/app/core/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/API/app/main.py b/API/app/main.py new file mode 100644 index 0000000..dd4e4e5 --- /dev/null +++ b/API/app/main.py @@ -0,0 +1,25 @@ +from fastapi import FastAPI + +from app.api.v1.routes import bootstrap + +app = FastAPI( + title="PRIVIX API", + version="0.1.0", + description="Local PRIVIX control API", +) + +app.include_router( + bootstrap.router, + prefix="/api/v1/bootstrap", + tags=["bootstrap"], +) + + +@app.get("/") +def root(): + return { + "name": "PRIVIX API", + "status": "running", + "api": "/api/v1", + "docs": "/docs", + } diff --git a/API/app/schemas/__init__.py b/API/app/schemas/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/API/requirements.txt b/API/requirements.txt new file mode 100644 index 0000000..6e82ddc --- /dev/null +++ b/API/requirements.txt @@ -0,0 +1,37 @@ +annotated-doc==0.0.4 +annotated-types==0.7.0 +anyio==4.14.1 +certifi==2026.6.17 +click==8.4.2 +dnspython==2.8.0 +email-validator==2.3.0 +fastapi==0.139.0 +fastapi-cli==0.0.28 +h11==0.16.0 +httpcore==1.0.9 +httptools==0.8.0 +httpx==0.28.1 +idna==3.18 +Jinja2==3.1.6 +markdown-it-py==4.2.0 +MarkupSafe==3.0.3 +mdurl==0.1.2 +pydantic==2.13.4 +pydantic-extra-types==2.11.1 +pydantic-settings==2.14.2 +pydantic_core==2.46.4 +Pygments==2.20.0 +python-dotenv==1.2.2 +python-multipart==0.0.32 +PyYAML==6.0.3 +rich==15.0.0 +rich-toolkit==0.20.1 +shellingham==1.5.4 +starlette==1.3.1 +typer==0.26.8 +typing-inspection==0.4.2 +typing_extensions==4.16.0 +uvicorn==0.50.1 +uvloop==0.22.1 +watchfiles==1.2.0 +websockets==16.0