shreytailor / terminator

Terminator provides a web-based interface to remotely shutdown or restart your computer using devices on your local network.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Terminator

Table of Contents

About The Project

Terminator is an application that let's you remotely shutdown or restart your computer from any device on your local network, using an intuitive web interface (as shown below).

Built With

Terminator is a full stack application, so it consists of a React frontend and Express backend. The entire codebase is written using TypeScript for the type-safety and ease of development.

Yarn TypeScript React React Router Express.js

Architecture

For the sake of this explanation, let's consider the host device as the one we want to terminate, and a local network device as any other device on the same local network as the host. When Terminator is started on the host computer, it will host the frontend and backend on the network its connected on.

The backend consists of a series of HTTP endpoints, where each of the endpoints can be used to terminate the host computer either through shutdown or restart. The endpoints use the host device's shell to schedule termination by creating processes, so naturally the backend has a dependency on it.

The role of the frontend in Terminator is to provide an intuitive graphical user interface to the users. When an action is performed on the frontend (e.g. user wants to shutdown their computer after 30 minutes), the frontend sends HTTP requests to the backend to schedule those operations. As mentioned previously, the frontend is hosted on the local network so it can be accessed through any device (that are also on the local network) giving the ability to "remotely" terminate your host computer.

Getting Started

To execute Terminator on your host device, follow the steps below.

  1. Open your terminal and change the working directory to the project root (i.e., same level as the packages folder).
  2. Give execution permissions to the script used to run the system, using the following command.
chmod +x scripts/run.sh
  1. Finally, execute the system using the following command.
scripts/run.sh

Terminator will then locally start on Port 5556 on your host computer, and will be accessible to any device on your network. If you want to configure the port number, refer to the Development Setup guide below.

Development Setup

To ready the codebase for development, follow the steps below.

  1. Open your terminal and change the working directory to the project root (i.e., same level as the packages folder).
  2. Install the dependencies using the following command.
yarn
  1. Build the core package using the following command.
yarn build:core
  1. Run the backend in development mode using the following command.
yarn dev:server
  1. Open another terminal window, and run the frontend in development mode using the following command.
yarn dev:client

The yarn dev:server and yarn dev:client both support hot reloading, so any changes in the codebase will be reflected straightaway without having to re-run the scripts.

Note that if changes are made to the core package, you will need to re-run the yarn build:core command and possibly restart the frontend and backend.

Port Configuration

If you want to configure the port on which the backend runs, create a .env file in the packages/server directory similar to the provided .example.env file. Thereafter, provide a value to the PORT key and then restart the server for the environment variable to be configured.

Screenshots

Roadmap

To view the roadmap for this project, visit the wiki homepage.

About

Terminator provides a web-based interface to remotely shutdown or restart your computer using devices on your local network.


Languages

Language:TypeScript 84.6%Language:CSS 11.2%Language:HTML 1.9%Language:Shell 1.7%Language:JavaScript 0.6%