Next.js project simulating control of a robot fleet from a web page.
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
The robot data displayed stays up to date, even when a task was started by another operator.
- Next.js
- TypeScript
- Firebase Cloud Firestore
The deployed project can be viewed on the web at https://robot-coordinator.vercel.app/.
This instructions are written for MacOS.
- Clone repo to your location of choice on disk, e.g.
Documents
folder - Navigate in terminal to the root folder of the cloned repo, e.g.
Documents/robot-coordinator
- Run
npm install
to install dependencies - Run
npm run dev
to start application - Navigate in web browser to
localhost:3000
- Attempt to login with invalid credentials.
- Alert will appear notifying you that login has failed.
- Login with approved username and password combination.
- Robot coordinator dashboard will appear with the first robot selected.
- Select different robots on the left bar and observe that the robot display switches to show each robot.
- Start a task by clicking one of the task buttons.
- Observe that robot status updates to reflect that it is busy.
- Wait until the task completes, robot status will return to available.
- Start a task and attempt to start another task while that task is still running.
- Observe that an error appears and the original task will continue running to completion.
- Leave the first web page open.
- Open a second web browser window and connect.
- Log in as a different user.
- Configure screen so that you can see both pages at once.
- Select the same robots in both the original page and the new page.
- Start a task on one page and observe that the other page updates to match.