Giter VIP home page Giter VIP logo

rs-school-node-remote-control's Introduction

RSSchool NodeJS websocket task template

Static http server and base task packages.

Installation

  1. Clone/download repo
  2. npm install

Usage

Development

npm run start:dev

  • App served @ http://localhost:8181 with nodemon

Production

npm run start

  • App served @ http://localhost:8181 without nodemon

All commands

Command Description
npm run dev App served @ http://localhost:8181 with nodemon
npm run start App served @ http://localhost:8181 without nodemon

Note: replace npm with yarn in package.json if you use yarn.

Assignment: Websocket Remote Control

Description

Your task is to implement remote control backend using RobotJS library and websocket.

User interface for your remote control backend is here

The backend should be able to do the following:

  • Start websocket server
  • Handle websocket connection
  • Move mouse (Up, Down, Left, Right)
  • Draw circle, rectangle and square
  • Send current mouse coordinates
  • Send desktop capture (optionally)

Technical requirements

  • Task can be implemented on Javascript or Typescript
  • Use 16 LTS version of Node.js
  • Only ws, robotjs, jimp, cross-env, typescript, ts-node, ts-node-dev, nodemon, dotenv, eslint and its plugins, webpack and its plugins, prettier, @types/* and testing tools (for example, Jest, Mocha, AVA, Jasmine, Cypress, Storybook, Puppeteer) are allowed
  • The program is started by npm script start in following way:
npm run start 
  • After starting the program displays websocket parameters
  • After program work finished the program should end websocket work correctly
  • After each received command program should display the command and result
  • All commands should be ended with \0

List of websocket commands and their syntax (<- - cmd from frontend, -> - answer):

  • Navigation over the x and y axis
    • Move mouse up
    <- mouse_up {y px}
    • Move mouse down
    <- mouse_down {y px}
    • Move mouse left
    <- mouse_left {x px}
    • Move mouse right
    <- mouse_right {x px}
    • Send mouse coordinates
    <- mouse_position
    -> mouse_position {x px},{y px}
  • Drawing
    • Draw circle with pushed left button:
    <- draw_circle {px}
    • Draw rectangle with pushed left button:
    <- draw_rectangle {px} {px}
    • Draw square with pushed left button:
    <- draw_square {px}
  • Print screen
    • Make print screen command and send image (a base64 buffer of the 200 px square around the mouse position):
    <- prnt_scrn
    -> prnt_scrn {base64 string (png buf)}

rs-school-node-remote-control's People

Contributors

alreadybored avatar htar avatar kele6ra avatar

Stargazers

 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.