abetusk / www.meowcad.com

website for www.meowcad.com
GNU Affero General Public License v3.0
46 stars 8 forks source link

Just a general question. How tied together are the back end and the from end? #27

Closed mmiscool closed 6 years ago

mmiscool commented 6 years ago

I am just wondering if the back end on this could be swapped out for some PHP or other server type configuration.

abetusk commented 6 years ago

In theory, yes, one can swap out something like PHP for the backend.

There are really two major components: the server that manages communication with the schematic and board diagram portion (the "EDA app") and the project, user, etc. management that looks much more like "classical" web server development.

The management of projects, displaying them, updating the user data, etc. can be swapped out pretty easily for another back end infrastructure. The "view" portion is a sort of hacked together templating scheme along with the "model" portion that has some logic to update the database (in this case, a redis database) with users, projects, etc. One could use PHP (or whatever other language) to update database state and display without too much issue. I did some work in converting the hodge-podge python into a go server with a structure that was meant to be more maintainable and that can be found in the mewgo subdirectory. I never got around to finishing the mewgo portion and it so it's only half finished.

The other portion is the server that maintains schematic and board state. This is written in JavaScript and would be harder to port as it shares a lot of code with the client that manages the same state. The client and server communicate via a web socket (using socket.io) with the server updating the JSON datastructure in the redis database.

In theory this server could be written in anything as it isn't doing anything more than updating the JSON representation of the schematic and boards but in practice a lot of duplication of work was saved as most of the logic used in the client side application was used for the server.