-
Notifications
You must be signed in to change notification settings - Fork 0
Description
🗒️ Task Description
Summary
JARVIS displays various satellite telemetry, however the satellite only downlinks telemetry once during its ~90-minute orbit. The website should indicate the timestamp of the latest telemetry.
Details
This task involves changes to both the client and server applications:
Client
Create a component to display the latest timestamp on the Dashboard page.
The general steps are:
-
Create a React component (or use an existing Material UI one) which takes a
Dateprop and displays it as text in a readable format (e.g. "Last Update: October 1st 2025, 6:00 AM UTC"). -
Using
api/experiment.jsas a reference, make a file calledapi/dashboard.jsand create a function which queries the server for the latest timestamp. You may want to add a function inapi/utils.jsto convert the timestamp from RFC to aDateobject. -
In
DashboardTab.js, usingExperimentTab.jsas a reference, fix theDashboardcomponent's function signature, import the time context, and render your 'last updated' component (you can remove the "Hello World!"). CalluseQueryfrom React Query and pass your API function to retrieve the latest timestamp. Then, pass it to the component.
Note: Since the component's only job will be to show the latest timestamp, the call to
useQuerycan go inside the component itself rather than on the dashboard page. I only didn't suggest this because there's no similar example in the code, but if you prefer that approach then go for it!
Server
Create an endpoint which will return the latest timestamp of available telemetry.
Referring to the equivalent Payload files will be very helpful, as they follow the same structure outlined here:
-
commonMeasurements.js: Create a function to find the timestamp of the latest available telemetry. How you do this is up to you, and it may be worth studying InfluxDB to see if there is an efficient and automatic way to query for the latest timestamp. For now, only worry about Payload's telemetry as the rest is unimplemented. -
commonController.js: Create a function which calls the measurement function and returns the latest timestamp (or an error code). Don't worry about validating the request parameters as there are none. -
commonRoutes.js: Create a GET request router for the endpoint/latest-timestampwhich calls the controller function. -
app.js: Add the/commonroute by importingcommonRoutes.js.
✅ Completion Criteria
- Show that the displayed time matches the timestamp of the latest Payload telemetry