Week 7 - Setting up a Django backend
Summary
With version 0.1 now released, it’s time to begin integrating it into a web app. This week, I set up the backend functions, mainlu API calls to execute the generation script, and created a rudimentary web frontend using HTML and JavaScript.
Development
Backend
I will be using Django for both the backend and, for the moment, the frontend as well, since it is the industry standard and is very well-documented.
My work this week primarily consisted of setting up a proper Django environment and writing an API for the frontend to be able to interact with the tree files (actions and XML). This API offers the following functionalities:
- Retrieve user actions from the Filesystem
- Fetch the content of a specific user action for editing
- Save the updated content of the user action back to the Filesystem
- Create new files
- Delete files
- Invoke the app_generator, which returns a zip file containing the ROS 2 package.
I create a django app called tree_api to encapsulate all this calls.
Frontend
Although the ultimate goal is to have a REACT-based frontend, for initial testing I created a simple HTML and JavaScript frontend. This frontend features a basic file browser, a code editor, and buttons for triggering various API calls.
Currently, there is no graphical tree editor. This version operates identically to the standalone v0.1 package, but functions within a web app.