Skip to content

SAGSINs/sagsin-fe

Repository files navigation

SAGSIN Frontend

React + TypeScript dashboard với 3D visualization cho network topology monitoring và file transfer tracking.

🎯 Giới Thiệu

SAGSIN Frontend là web application hiển thị real-time monitoring cho hệ thống mạng phân tán:

  • 3D Earth Visualization: Interactive globe với network nodes và connections
  • Node Management: CRUD operations cho network nodes
  • Link Management: Network topology và metrics
  • Timeline Tracking: File transfer progress với millisecond precision
  • Algorithms: Route optimization visualization
  • Real-time Updates: Socket.IO integration cho live data

🏗️ Kiến Trúc

sagsin-fe/
├── src/
│   ├── main.tsx                   # Entry point
│   ├── App.tsx                    # Root component với Socket.IO
│   │
│   ├── dashboard/                 # Dashboard pages
│   │   ├── page.tsx              # Layout với sidebar
│   │   ├── earth-demo.tsx        # 3D Earth visualization (home)
│   │   ├── node-management.tsx   # Node CRUD
│   │   ├── link-management.tsx   # Link CRUD
│   │   ├── timelines-management.tsx  # Transfer tracking
│   │   └── algorithims-management.tsx # Route algorithms
│   │
│   ├── components/
│   │   ├── app-sidebar.tsx       # Navigation sidebar
│   │   ├── earth/                # 3D Earth components
│   │   ├── nodes/                # Node components
│   │   ├── links/                # Link components
│   │   ├── timeline/             # Timeline components
│   │   │   ├── timeline-svg.tsx          # SVG visualization
│   │   │   ├── timeline-summary.tsx      # Statistics
│   │   │   ├── timeline-utils.ts         # Utilities
│   │   │   └── tooltip-content.tsx       # Tooltips
│   │   ├── charts/               # Recharts visualizations
│   │   ├── ui/                   # Shadcn UI components
│   │   └── shared/               # Reusable components
│   │
│   ├── contexts/
│   │   └── network-context.tsx   # Global network state
│   │
│   ├── socket/
│   │   └── socket.ts             # Socket.IO client singleton
│   │
│   ├── routes/
│   │   └── index.ts              # React Router configuration
│   │
│   ├── hooks/
│   │   └── use-mobile.ts         # Responsive hooks
│   │
│   └── lib/
│       └── utils.ts              # Utility functions
│
├── public/                        # Static assets
├── components.json                # Shadcn UI config
├── vite.config.ts                # Vite configuration
├── tailwind.config.js            # Tailwind CSS config
└── package.json                  # Dependencies

🎨 Tech Stack

  • Framework: React 19 + TypeScript
  • Build Tool: Vite 7
  • Styling: Tailwind CSS 4 + Shadcn UI
  • 3D Graphics: Three.js + React Three Fiber + Drei
  • Charts: Recharts
  • Real-time: Socket.IO Client
  • Routing: React Router 7
  • Icons: Lucide React
  • Animations: Framer Motion

🚀 Hướng Dẫn Chạy

Development

# Install dependencies
npm install

# Start development server
npm run dev

# Open browser
# http://localhost:5173

📱 Pages & Features

🌍 Earth Demo (Home)

  • Interactive 3D globe powered by Three.js
  • Network nodes plotted với GPS coordinates
  • Real-time connections visualization
  • Camera controls (zoom, rotate, pan)
  • Node info tooltips on hover

📊 Node Management

  • List View: Table với sorting và filtering
  • Create: Add new nodes với location picker
  • Update: Edit node properties
  • Delete: Remove nodes với confirmation
  • Live Status: Real-time heartbeat indicator
  • Metrics: CPU, RAM, bandwidth charts

🔗 Link Management

  • Network Topology: Force-directed graph
  • Create Links: Drag-and-drop connection
  • Metrics: Delay, jitter, loss rate, bandwidth
  • Status: Available/Unavailable indicator
  • Delete: Remove connections

⏱️ Timeline Tracking

  • SVG Timeline: Horizontal timeline với points
  • Hover Tooltips:
    • Point hover → Node details + timestamp with ms
    • Segment hover → Transfer duration with ms
  • Statistics: Total duration, avg hop duration, progress
  • Auto-refresh: Real-time updates mỗi 5 giây
  • Progress Bar: Visual completion indicator

🧮 Algorithms

  • Route Selection: A*, Dijkstra comparison
  • Path Visualization: Step-by-step route display
  • Cost Analysis: Metrics comparison
  • Performance: Execution time tracking

📊 Kết Quả Đạt Được

✅ Core Features

  1. 3D Visualization: Interactive Earth với network nodes và real-time updates
  2. Responsive Design: Mobile-friendly với Tailwind CSS
  3. Component Library: 40+ reusable Shadcn UI components
  4. Real-time Monitoring: Socket.IO cho live data streaming
  5. Timeline Visualization: SVG-based với millisecond-precision tooltips
  6. CRUD Operations: Full management cho nodes và links
  7. Route Visualization: Algorithm comparison và path display
  8. Performance: Optimized rendering với React 19

📈 Technical Achievements

  • Bundle Size: ~500KB gzipped (production build)
  • Load Time: <2s initial load trên 4G
  • Frame Rate: 60 FPS trong 3D Earth view
  • Component Reusability: 11 timeline sub-components
  • Type Safety: Full TypeScript coverage
  • Accessibility: ARIA labels và keyboard navigation
  • Responsive: Desktop, tablet, mobile support

📝 Notes

  • Vite với HMR cho fast refresh
  • Tailwind CSS 4 với @tailwindcss/vite plugin
  • React Router 7 với nested routes
  • Socket.IO singleton pattern
  • Network context cho global state
  • Custom hooks cho responsive design
  • SVG components cho timeline visualization
  • Millisecond precision trong timestamps
  • Auto-refresh mỗi 5 giây cho timeline

Tech Stack: React 19, TypeScript, Vite, Tailwind CSS, Three.js, Socket.IO
UI Library: Shadcn UI, Lucide Icons, Recharts
Node Version: 20.x LTS

About

Dashboard manage nodes, view metrics and topo

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages