Skip to content

Show timestamp of latest data on the dashboard #63

@ArnavG-it

Description

@ArnavG-it

🗒️ 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:

  1. Create a React component (or use an existing Material UI one) which takes a Date prop and displays it as text in a readable format (e.g. "Last Update: October 1st 2025, 6:00 AM UTC").

  2. Using api/experiment.js as a reference, make a file called api/dashboard.js and create a function which queries the server for the latest timestamp. You may want to add a function in api/utils.js to convert the timestamp from RFC to a Date object.

  3. In DashboardTab.js, using ExperimentTab.js as a reference, fix the Dashboard component's function signature, import the time context, and render your 'last updated' component (you can remove the "Hello World!"). Call useQuery from 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 useQuery can 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:

  1. 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.

  2. 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.

  3. commonRoutes.js: Create a GET request router for the endpoint /latest-timestamp which calls the controller function.

  4. app.js: Add the /common route by importing commonRoutes.js.

✅ Completion Criteria

  • Show that the displayed time matches the timestamp of the latest Payload telemetry

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions