Skip to content

Conversation

@ArnavG-it
Copy link

@ArnavG-it ArnavG-it commented Sep 13, 2025

The graphs on the experiment tab now show data from the InfluxDB database, i.e. the frontend now communicates with the backend.

Main changes:

  • Uses TanStack Query, a library which simplifies a lot of the frontend code needed to send requests to the server. See ExperimentTab.js to see how simple it is. It also has some important features like caching which are not enabled but would be useful in the future.
  • Adds an /api folder. api.js contains the fetch function itself, and experiment.js tidies up all the fetching needing for the experiment tab into one function.
  • Requests on the website (localhost:3000) are proxied (forwarded) to the server (localhost:5000) for development purposes.

Next steps:

  • Add feedback for the user if there is an error fetching data.
  • Apply the same concepts to the other tabs as they get developed.

To test this yourself:

  1. Make sure Docker is installed
  2. > npm install and > docker compose up in /server
  3. Add data into the database. You can run the telemetry input CLI in /tools using Python, then use the bulk_insert command and examples/data_temp.csv and examples/data_lumin.csv for the file names.
  4. > npm install and > npm start in /client
  5. Open http://localhost:3000/experiment and you should see data on the graphs. If you're using the example datasets, select September 1st-3rd 2025 on the calendar.

Let me know if you find bugs or have suggestions.

Uses proxy for port communication, so the server must be running (in Docker).

The query period is hardcoded to the last 24 hours for now. It should probably be made to match the time picker's range, or some other optimized solution.
@ArnavG-it ArnavG-it self-assigned this Sep 13, 2025
@ArnavG-it ArnavG-it linked an issue Sep 13, 2025 that may be closed by this pull request
@ArnavG-it ArnavG-it added this to the Milestone 0 milestone Sep 13, 2025
ArnavG-it and others added 3 commits September 13, 2025 17:05
Oops, the example data should fit on the graph now.
@ArnavG-it
Copy link
Author

One additional thing I did was switch to the LTS version of Node (22.20.0), as well as the latest version of npm (11.6.1). Working off the LTS and latest npm version should probably be a standard going forward.

That caused a lot of package updates, so I would appreciate if anyone could test this on their end using those versions. The instructions for initializing the client and server are above.

Aside from that, I will probably merge soon so everyone can work off of this integrated version.

@Koloss0 Koloss0 removed this from the Milestone 0 milestone Oct 6, 2025
Required to view the example datasets. Also more random dependency changes?
@ArnavG-it ArnavG-it added this to the Milestone 0 milestone Oct 7, 2025
Copy link

@ApplePy39 ApplePy39 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proposed changes do indeed work on my system by following the instructions on the PR.
I couldn't find any bugs.
One minor addition could be to add a requirments.txt file for the /tools folder? That way running a simple 'pip install -r requirements.txt' would install all the necessary python libraries, instead of installing one by one, while also installing specified versions.

@ArnavG-it
Copy link
Author

Thanks Anton!

One minor addition could be to add a requirments.txt file for the /tools folder? That way running a simple 'pip install -r requirements.txt' would install all the necessary python libraries, instead of installing one by one, while also installing specified versions.

That's a good suggestion. Just to keep things organized, I'd like to keep this PR focused on the client program - that's good practice to avoid merge conflicts between feature branches like this and the ADCS API one. But, if you know how to make that requirements file, feel free to do so on another branch! I can also look into it later.

@ArnavG-it ArnavG-it requested a review from ApplePy39 October 9, 2025 02:25
@ArnavG-it ArnavG-it merged commit 313b598 into dev Oct 12, 2025
6 checks passed
@ArnavG-it ArnavG-it deleted the feat/backend-integration branch October 12, 2025 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Requests from the API on the Frontend for Temperature Test

4 participants