Skip to content

alwkins/robot-coordinator

Repository files navigation

Robot Coordinator

Next.js project simulating control of a robot fleet from a web page.

Description

A fleet of cooking robots can be assigned tasks by operators, who must log in before viewing the robot dashboard. The approved operator list is as follows:

  • User: Gordon Ramsay, Password: gordonramsay
  • User: Julia Child, Password: juliachild
  • User: Ratatouille, Password: ratatouille

The project simulates robot completion of tasks, since there is no actual robot to report back its status. The following tasks are currently supported:

  • Task: Fry Egg, Duration: 3 seconds
  • Task: Chop Onion, Duration: 6 seconds
  • Task: Cook Pasta, Duration: 9 seconds

Features

Login with Username and Password

Screen Shot 2022-01-31 at 8 34 15 PM

Robot Status is Displayed to Logged-In Users

Screen Shot 2022-01-31 at 8 35 24 PM

Robot Data Updates in Real-Time

The robot data displayed stays up to date, even when a task was started by another operator. Screen Shot 2022-01-31 at 8 35 29 PM

Technology Stack

  • Next.js
  • TypeScript
  • Firebase Cloud Firestore

Run

View Deployment on Vercel

The deployed project can be viewed on the web at https://robot-coordinator.vercel.app/.

Run Locally

This instructions are written for MacOS.

  1. Clone repo to your location of choice on disk, e.g. Documents folder
  2. Navigate in terminal to the root folder of the cloned repo, e.g. Documents/robot-coordinator
  3. Run npm install to install dependencies
  4. Run npm run dev to start application
  5. Navigate in web browser to localhost:3000

Instructions for Operation

Login

  1. Attempt to login with invalid credentials.
  2. Alert will appear notifying you that login has failed.
  3. Login with approved username and password combination.
  4. Robot coordinator dashboard will appear with the first robot selected.

Robot Coordinator Dashboard

  1. Select different robots on the left bar and observe that the robot display switches to show each robot.
  2. Start a task by clicking one of the task buttons.
  3. Observe that robot status updates to reflect that it is busy.
  4. Wait until the task completes, robot status will return to available.

Robot Availability

  1. Start a task and attempt to start another task while that task is still running.
  2. Observe that an error appears and the original task will continue running to completion.

Multiple Operators

  1. Leave the first web page open.
  2. Open a second web browser window and connect.
  3. Log in as a different user.
  4. Configure screen so that you can see both pages at once.
  5. Select the same robots in both the original page and the new page.
  6. Start a task on one page and observe that the other page updates to match.

Sequence Diagram

robot-coordinator-task-flow

About

Project simulating control of a robot fleet.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published