Jump to content

Recommended technologies for Server(Python) / Client(web) application? (React, JS, Websockets, XState, GraphQL...)

PerfectlyNutz

Hey, I'm new and I've come here because right now I am totally so overwhelmed by all the available technologies and solutions that I have no idea where to start.

What I need is to create a very specific application for developers in my workplace. The workflow looks something like this: User enters his variables --> app creates a configuration --> Run a 'test' based on that configuration I am talking about a lot of variables. The point of the application is to take in all that information and configure it. For example one of the variables could be a file from which I take information by parsing its content. Now the user can run a test based on the configuration. The test itself is not my responsibility, it's in python and something I need to feed my configuration to.

Things I am pretty sure about:

  1. Split the app up to frontend and backend

  2. backend needs to be python 2.7 -> thinking about utilizing Django

  3. frontend is going to be web-based ->thinking about React (Typescript, HTML, and some CSS framework like bootstrap)

  4. Use WebSockets for for bi-directional conversation between frontend and backend

  5. Run both server and client on the user's PC.

The problem I am facing is how to connect the different 'states' of the independent server and the client, in a programmatically correct way, with so many variables, tabs, components, etc.
 

I use WebSockets to move information between server and client. Let's say the user entered a new value in the client GUI, now I want to update the server so it can do its part. But I don't want to send a whole snapshot of the current state of the GUI to the server since this is not efficient. Is GraphQL the right solution for this job? Now the server got updated by the GUI, it parsed a few things and now wants to send this back to the client. How can I take what the server sent, which could be a very deeply nested value, and update the corresponding part in the GUI? Is XState (or other state managers) the solution?
 

I know this is a very specific question and I might be totally lost but I would like to hear your advice because this is a new subject for me and I am just learning right now.
(Also posted on stackshare)

 

Link to comment
Share on other sites

Link to post
Share on other sites

I don't understand what you're trying to do.  It seems as if you want to create some kind of "configuration" from unspecified data which is being supplied in no particular way by developers of something by the help of a program you're planning to write which will run on each developers computer.

 

Why don't they just create a configuration file and alter it as needed?

 

Link to comment
Share on other sites

Link to post
Share on other sites

This the very definition of "over-engineered". You don't need anything more than simple HTML form and a normal form post. If the developer needs to monitor the status of the job, then you can deploy websockets to simply allow the server to periodically push the progress, but technically you could just long poll with AJAX if you didn't want to get even that complicated.

CPU: AMD Ryzen 9 5900X · Cooler: Artic Liquid Freezer II 280 · Motherboard: MSI MEG X570 Unify · RAM: G.skill Ripjaws V 2x16GB 3600MHz CL16 (2Rx8) · Graphics Card: ASUS GeForce RTX 3060 Ti TUF Gaming · Boot Drive: 500GB WD Black SN750 M.2 NVMe SSD · Game Drive: 2TB Crucial MX500 SATA SSD · PSU: Corsair White RM850x 850W 80+ Gold · Case: Corsair 4000D Airflow · Monitor: MSI Optix MAG342CQR 34” UWQHD 3440x1440 144Hz · Keyboard: Corsair K100 RGB Optical-Mechanical Gaming Keyboard (OPX Switch) · Mouse: Corsair Ironclaw RGB Wireless Gaming Mouse

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, heimdali said:

I don't understand what you're trying to do.  It seems as if you want to create some kind of "configuration" from unspecified data which is being supplied in no particular way by developers of something by the help of a program you're planning to write which will run on each developers computer.

 

Why don't they just create a configuration file?

 

Mhhh I see what you are saying, but it really is complicated to explain. But I will give it a shot. 

So in my workplace we have different departments, Firmware, hardware, validation and more. Each department also has different teams working on different parts. Now lets say I am in Validation. I need to take all the different contributions from the different departments and their teams so I can do my job. But this requires me to go over all the different files, environments and configurations to stitch them all together. This is a time consuming and tedious thing I have to do. 
Examples of thing the developers have to do:

  • Change file paths: I get 'C:/Some/Remote/Path' and have to change it to 'C:/My/Local/Path'. (Repeat this 20 times for different files/folders)
  • Changing flags: Turn on the 'log' flag, turn off the 'isHardware' flag. (Do this in line 100 of file x, line 530 of file y and line 35 of file z...)
  • Take the firmware configuration and hardware configuration and create a validation configuration out of it
  • Run 'C:/My/Project/Files/script.py' (Has to do this for every new project)


And that's where I am supposed to come in. I can automate most of those steps saving the developers a lot of otherwise wasted time. 
The thing is that this is not just a one-click task and more like whole work flow, needing devices to initialize in between, scripts to run and so on. 
And at this point I started having questions. 

Hope this makes my problem clearer.

Link to comment
Share on other sites

Link to post
Share on other sites

I wouldn't mess with React for such a project, seems like a lot of extra work for little benefit.

 

I'd attempt to do it with some basic PHP and javascript and a database (which could be plain text individual files on a folder or something like that).

User creates a new configuration which gets a unique ID, then user can upload files with configuration settings or checks boxes on screen and hits apply, and in the back the php code saves the changes to database or dumps all the settings into a json file or something.

When done, and ready to run, you can set a flag in the database that the profile is ready to be executed and a python app that runs in background can poll the database and accept the new order and set a flag in database as "being taken care off" or something like that ...  or you can push the ID to a python app that runs in background.

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, PerfectlyNutz said:

Mhhh I see what you are saying, but it really is complicated to explain. But I will give it a shot. 

So in my workplace we have different departments, Firmware, hardware, validation and more. Each department also has different teams working on different parts. Now lets say I am in Validation. I need to take all the different contributions from the different departments and their teams so I can do my job. But this requires me to go over all the different files, environments and configurations to stitch them all together. This is a time consuming and tedious thing I have to do. 
Examples of thing the developers have to do:

  • Change file paths: I get 'C:/Some/Remote/Path' and have to change it to 'C:/My/Local/Path'. (Repeat this 20 times for different files/folders)
  • Changing flags: Turn on the 'log' flag, turn off the 'isHardware' flag. (Do this in line 100 of file x, line 530 of file y and line 35 of file z...)
  • Take the firmware configuration and hardware configuration and create a validation configuration out of it
  • Run 'C:/My/Project/Files/script.py' (Has to do this for every new project)


And that's where I am supposed to come in. I can automate most of those steps saving the developers a lot of otherwise wasted time. 
The thing is that this is not just a one-click task and more like whole work flow, needing devices to initialize in between, scripts to run and so on. 
And at this point I started having questions. 

Hope this makes my problem clearer.

 

Yeah, you could easily do that completely in php...  you could prepare the scripts once by entering stuff like %%path.remote%%  or  %%path.local%%  instead of remote path and local path.

 

The php script can simply read the files, and do a search and replace, replacing every occurrence of %% something %% with the actual variable

You could go further adding custom things like %%IF log.enabled%% --log on %%ENDIF%%   which in your could mean only output --log on  if the log.enabled parameter is true. Or say %%IF !log.enabled%%  for false...

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

That sounds to me like the problem is somewhere else, i. e. in each department doing whatever and however they want instead of agreeing on standards and working together.  I wouldn't bother to write software to do that kind of job because not only every time someone in some department inserts or deletes a line, changes a path name, toggles a flag or invents or removes one, the sofware would have to be adjusted.  It would also introduce tons of errors because the sofware will never realize that someone inserted a line or added a file or something and make alterations that will more and more turn its input into a total mess.  I'm suspecting that the contributors telling you about all the changes they made would take so much time and afford that they could better the adjustments themselves --- and how are they are going to tell the software about it you would be writing?

 

Have you given git some consideration?  I would say you need to talk to the departments and develop standards, procedures and protocols they can agree upon which enable them to work together and which might eventually make a tool like git extremely useful.

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×