aboutsummaryrefslogtreecommitdiff
path: root/.cursor
diff options
context:
space:
mode:
authordiogo464 <[email protected]>2025-05-28 20:46:55 +0100
committerdiogo464 <[email protected]>2025-05-28 20:46:55 +0100
commit05f7444ecd2e3405b0e595042166ec5f8a3395ab (patch)
tree2b28bca5dab0f2ec79c41893732b5d6866725f56 /.cursor
init
Diffstat (limited to '.cursor')
-rw-r--r--.cursor/rules/project.mdc24
1 files changed, 24 insertions, 0 deletions
diff --git a/.cursor/rules/project.mdc b/.cursor/rules/project.mdc
new file mode 100644
index 0000000..2d0eae9
--- /dev/null
+++ b/.cursor/rules/project.mdc
@@ -0,0 +1,24 @@
1---
2description:
3globs:
4alwaysApply: true
5---
6bonsai is a python command line tool used to generate realistic network latency graphs using a yaml config.
7
8The tool is called with
9```
10python -m main --net_config <network-config>.yaml --output_dir <output_dir>
11```
12The network config is a yaml file whose contents don't really matter and the output directory must exist and will be populated with two files `edges.csv` and `nodes.csv`.
13
14The goal of this project, `bonsai-web` is to create a simple web interface for bonsai since it requires a specific version of python and quite a few dependencies.
15You can assume that the bonsai source code is under the directory `/usr/src/bonsai` so you use subprocess in that directory to execute the command above.
16The web page we are trying to create is simple and will contain the following components.
17+ single html page using picocss
18+ single javascript file for client side logic
19+ simple flask backend
20
21The html page should have a header with the name bonsai and an image logo. The logo will be present at `logo.png`. The page should have some description text at the top, followed by a text box for the user to provide a configuration and then a button to generate the output files. When the user clicks that button a POST request with the contents of the config should be made to `/` and the server should execute bonsai and return a json object where the keys are the names of the generated files and the values associated with those keys will be the contents of the files.
22The page should then display, bellow the button, the list of files with a button to download and one to view. The javascript file should contain the code for all this logic.
23
24There should also be a `Containerfile` that creates a container image for this project. Make sure to use python version 3.9 as the base image and leave some space for me to write the code required to setup the bonsai project, you just need to assume that it will be present at the above location. \ No newline at end of file