2025-05-04 15:12:39 +07:00
2025-05-04 15:12:39 +07:00
2025-05-04 15:12:39 +07:00
2025-05-01 06:40:24 +00:00
2025-05-01 16:58:26 +07:00
2025-05-01 16:58:26 +07:00
2025-05-04 15:12:39 +07:00
2025-05-01 16:58:26 +07:00

Real-time Random Number Visualization

This application demonstrates real-time data visualization using WebSocket communication between a Go backend and Vue.js frontend.

Project Structure

  • main.go - Go backend server that generates random numbers and sends them via WebSocket
  • frontend/ - Vue.js frontend with TypeScript that visualizes the data in real-time

Prerequisites

  • Go 1.21 or later
  • Node.js 16 or later
  • npm or yarn

Backend Setup

  1. Install Go dependencies:
go mod tidy
  1. Run the Go server:
go run main.go

The server will start on port 8080.

Frontend Setup

  1. Navigate to the frontend directory:
cd frontend
  1. Install dependencies:
npm install
  1. Start the development server:
npm run dev

The frontend will be available at http://localhost:3000

Features

  • Backend generates random numbers between 1 and 100 every second
  • Frontend displays the numbers in a real-time line chart
  • WebSocket connection automatically reconnects if disconnected
  • Chart shows the last 20 data points
Description
No description provided
Readme 52 KiB
Languages
Vue 62.5%
Go 23.9%
HTML 7.2%
TypeScript 6.4%