Coder Social home page Coder Social logo

realtimeview's Introduction

RealTimeView (Golang)

Visualizing real-time metrics from golang server (using WebSockets and plain-javascript). The aim is to create simple end-to-end solution.

Frontend: screenshot

Backend

It is a service that exposes certain endpoints to get data from sources like database. In this case we are exposing "/stream" endpoint which gives us current cpu usage. Here it is returning randomly generated data. This is written in MVC style for better division of responsibilities.

To start backend:

// Starts server on :8082, To change port edit backend/stream.go, proxy/main.go (since proxy needs to know backend location) 
go run cmd/main.go

Frontend:

It is a service that serves html/js files to the client. This service talks to backend for pulling dynamic data, in this case live CPU usage. (connection goes through proxy)

To start frontend:

// Starts server on :8080, To change port edit frontend/main.go
go run main.go

Proxy

It is a service which behaves as proxy/gateway to all the backend services. This service can perform various functions such as authenticating user, auditing sessions, routing requests to particular backend service. Here it is forwarding requests to backend.

To start proxy:

// Starts server on :8081, To change port edit proxy/main.go, frontend/views/index.html (since frontend needs to know proxy location) 
go run main.go

realtimeview's People

Contributors

janrockdev avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.