تفاصيل العمل

NeuroNet Sentinel

AI-Powered Network Monitoring and Management Platform

An enterprise-grade, event-driven platform for monitoring and managing multi-vendor network infrastructure (Cisco, Huawei, MikroTik) through an AI assistant powered by DeepSeek (via Ollama).

Architecture Overview

┌─────────────────────────────────────────────────────────────────┐

│ Web Application │

│ React 18 + TypeScript + TailwindCSS │

│ Dashboard │ Topology │ Devices │ Incidents │ AI Assistant │

└───────────────────────────┬─────────────────────────────────────┘

│ REST + WebSocket

┌───────────────────────────▼─────────────────────────────────────┐

│ Core API (FastAPI) │

│ JWT Auth │ RBAC │ API v1 │ WebSocket Gateway │ Data Processor│

└──────┬────────────┬────────────┬────────────┬───────────────────┘

│ │ │ │

┌────▼────┐ ┌─────▼─────┐ ┌───▼────┐ ┌────▼─────┐ ┌──────────┐

│ Monitor │ │ Analyzer │ │Executor│ │ Topology │ │ Backup │

│ Service │ │ /ChatOps │ │Service │ │ Service │ │ Service │

│ Celery │ │ DeepSeek │ │ Nornir │ │LLDP/CDP │ │Celery Beat│

└────┬────┘ └─────┬─────┘ └───┬────┘ └────┬─────┘ └────┬─────┘

│ │ │ │ │

┌────▼────────────▼────────────▼────────────▼────────────▼─────┐

│ Redis 7 (Streams + PubSub) │

└──────────────────────────┬────────────────────────────────────┘

┌──────────────────────────▼────────────────────────────────────┐

│ PostgreSQL 15 + TimescaleDB 2.x │

└───────────────────────────────────────────────────────────────┘

Monorepo Structure

neuronet-sentinel/

├── services/

│ ├── core-api/ # Phase 0 scaffold (per-service Dockerfile)

│ │ ├── app/

│ │ │ ├── __init__.py

│ │ │ ├── main.py

│ │ │ └── health.py

│ │ ├── Dockerfile

│ │ └── requirements.txt

│ ├── monitor-service/ # Phase 0 scaffold

│ ├── analyzer-service/ # Phase 0 scaffold

│ ├── executor-service/ # Phase 0 scaffold

│ ├── topology-service/ # Phase 0 scaffold

│ ├── core_api/ # Full implementation (v1.3)

│ ├── monitor_service/ # Full implementation

│ ├── analyzer_service/ # Full implementation

│ ├── executor_service/ # Full implementation

│ ├── topology_service/ # Full implementation

│ └── backup_service/ # Full implementation

├── frontend/web-ui/ # React 18 + Vite + TypeScript + TailwindCSS

├── shared/contracts/ # Pydantic models, enums, event schemas

├── infrastructure/

│ ├── docker/ # Shared Dockerfiles, nginx config

│ └── scripts/ # DB init SQL

├── docker-compose.yml

├── .env.example

└── README.md

Quick Start

# 1. Clone and configure

cp .env.example .env

# 2. Launch everything

docker compose up --build

# 3. Access

# Frontend: http://localhost:5173

# Core API: http://localhost:8000/doc...

# Monitor: http://localhost:8001/hea...

# Analyzer: http://localhost:8002/hea...

# Executor: http://localhost:8003/hea...

# Topology: http://localhost:8004/hea...

# PostgreSQL: localhost:5432

# Redis: localhost:6379

Health Checks

All backend services expose a GET /health endpoint:

{"status": "healthy", "service": "<service-name>"}

Service Port Health Endpoint

core-api 8000 http://localhost:8000/hea...

monitor-service 8001 http://localhost:8001/hea...

analyzer-service 8002 http://localhost:8002/hea...

executor-service 8003 http://localhost:8003/hea...

topology-service 8004 http://localhost:8004/hea...

Default Credentials

Username Password Role

admin admin123 Admin

operator admin123 Operator

viewer admin123 Viewer

Tech Stack

Layer Technology

Backend Python 3.11, FastAPI, SQLAlchemy

Async Tasks Celery + Redis

Database PostgreSQL 15 + TimescaleDB 2.x

Frontend React 18, TypeScript, Vite

Charting Recharts, Cytoscape.js

State React Query, React Context

Styling TailwindCSS

Realtime WebSocket + Redis PubSub

AI Ollama/DeepSeek (mock adapter)

Containers Docker Compose

Shared Contracts

The shared/contracts/ package provides Pydantic models importable by any service:

from shared.contracts import MetricEvent, AlertEvent, Incident, CommandRequest, ExecutionResult

Phase 0 Models

Module Models

device_events.py MetricEvent, InterfaceStatus

alert_events.py AlertEvent

incidents.py Incident

commands.py CommandRequest, ExecutionResult

Docker Network

All services communicate via the neuronet-net bridge network.

Services

Core API (port 8000)

JWT authentication (15-min access, 7-day refresh tokens)

RBAC (Viewer, Operator, Admin)

Device CRUD, dashboards, incidents, instant search

WebSocket gateway bridging Redis PubSub → browser

ChatOps router with approval workflow

Monitor Service (port 8001)

Fake device simulator (7 multi-vendor devices)

Celery poller: metrics every 60s → Redis metrics:raw

Async listener: syslog/trap events → Redis alerts:raw

Analyzer Service (port 8002)

AI provider abstraction (MockProvider / OllamaProvider)

Alert analysis, ChatOps handler, command verification

Future endpoint: http://deepseek.local:114...

Executor Service (port 8003)

Multi-vendor adapters (Cisco IOS, Huawei VRP, MikroTik RouterOS)

Idempotency checking before command execution

Config fetching for backup service

Topology Service (port 8004)

Mock LLDP/CDP neighbour discovery

Cytoscape.js-compatible graph JSON generation

Redis caching (15-min TTL)

Backup Service (Celery Beat)

Daily configuration backup with SHA-256 change detection

Version history stored in PostgreSQL

Frontend Pages

Route Page Description

/ Dashboard System overview with live metrics

/devices Devices Device inventory and management

/topology Topology Interactive network map

/incidents Incidents Alert lifecycle management

/chat ChatOps AI assistant interface

/settings Settings Platform configuration

/groups Groups Device group management

/backups Backups Configuration backup history

/audit Audit Log Administrative action history

بطاقة العمل

اسم المستقل
عدد الإعجابات
0
تاريخ الإضافة
تاريخ الإنجاز
المهارات