Code Monkey home page Code Monkey logo

eyepi's Introduction

EyePi: an interactive service monitor

EyePi is designed to keep track of the microservices I have running on my Raspberry Pi, and to allow me to remotely start, stop, and modify their metadata. I started this project to learn more about my employer's tech stack, in particular using React, and also because I was sick of having to ssh into my pi every time something went wrong to figure out what happened. I plan to extend this project to notify me when a service dies unexpectedly, because I don't have any infrastructure to support that on my pi as currently set up.

Overview

The Java server connects to a Mongo database of services, and starts each one. It then listens for commands, either as raw JSON or as HTTP requests containing a JSON body.

Java backend

The Server class creates a CommandHandler and listens for socket connections. When it receives a connection, it creates a ClientHandler that waits to receive commands. Each ClientHandler sends the command to the CommandHandler, which produces a response, and then writes the response to the socket.

There is a ServiceMonitor singleton which spawns and monitors processes using bash commands, and a DatabaseManager singleton which presents an interface to the database.

Build instructions

The Java backend is located in src/main/java/net/noneuclideangirl. To create the folders used for storing logs etc. as well as a base config file, run setup.sh. Building via Maven (mvn package) in the root folder will build the server jar; simply run with java -jar target/eye-pi-1.0-SNAPSHOT.jar.

The React frontend is located in client. To build and run, use npm start.

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.