chore: initial project setup with backend, frontend, CI/CD, and documentation
CI / backend (push) Failing after 15s
CI / frontend (push) Failing after 39s

Add complete NexaFabric project structure including:
- FastAPI backend with SQLAlchemy models, JWT auth, RBAC, audit logging, and provider interfaces
- React + TypeScript frontend with Vite, Tailwind CSS, TanStack Query, and Zustand
- Docker Compose configuration for PostgreSQL, Redis, API, worker, frontend, and nginx
- GitHub Actions and GitLab CI workflows for testing, linting, building, and security scanning
- Environment
This commit is contained in:
2026-07-09 12:10:35 +02:00
commit 14e7710120
83 changed files with 2887 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
from typing import Any
from app.models.domain import Policy
class PolicyEngine:
def compile(self, policy: Policy) -> dict[str, Any]:
definition = policy.definition or {}
source = definition.get("source", "any")
destination = definition.get("destination", "any")
service = definition.get("service", {"protocol": "any", "ports": "any"})
action = definition.get("action", "allow")
direction = definition.get("direction", "ingress")
generated_rule = {
"policy_id": policy.id,
"policy_version": policy.version,
"source": source,
"destination": destination,
"protocol": service.get("protocol", "any"),
"ports": service.get("ports", "any"),
"direction": direction,
"action": action,
"logging": bool(definition.get("logging", False)),
"description": definition.get("description", policy.name),
}
warnings = []
if source == "any" and destination == "any":
warnings.append("Policy targets all sources and destinations.")
if action == "allow" and service.get("ports") == "any":
warnings.append("Broad allow policy uses all ports.")
return {"rules": [generated_rule], "warnings": warnings, "conflicts": []}