Skip to content

Commit 6aa3d70

Browse files
committed
Update v3/docs/developer-overview.md
1 parent fa41f94 commit 6aa3d70

1 file changed

Lines changed: 26 additions & 4 deletions

File tree

‎v3/docs/developer-overview.md‎

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,36 @@ The main caveat here is that Google App Engine runs Python 2.7, so you won't be
2929

3030
## Overall system architecture
3131

32-
OPT consists of a pure-Python backend and an HTML/CSS/JavaScript frontend. All of the relevant files are located in `OnlinePythonTutor/v3/`, since v3 is the currently active version.
33-
32+
OPT consists of a pure-Python backend and an HTML/CSS/JavaScript frontend.
3433
Here is a typical user interaction sequence:
3534

36-
1. The user types in Python code in the editor (powered by [CodeMirror](http://www.codemirror.net/)).
35+
1. The user types in Python code in the web-based text editor (powered by [CodeMirror](http://www.codemirror.net/)).
3736
2. The user hits the "Visualize execution" button.
3837
3. The OPT frontend sends the user's Python code as a string to the backend by making an AJAX GET request.
39-
4. The backend executes the Python code under the supervision of the Python [bdb](http://docs.python.org/library/bdb.html) debugger module, produces an execution trace, and send that trace back to the frontend.
38+
4. The backend executes the Python code under the supervision of the Python [bdb](http://docs.python.org/library/bdb.html) debugger module, produces an execution trace, and send that trace back to the frontend in JSON format.
4039
5. The frontend switches to a visualization pane, parses the execution trace, and renders the appropriate stack frames and heap objects.
4140
6. When the user interacts with the frontend by stepping through execution points (forwards and backwards), the frontend renders the proper data structures WITHOUT making another call to the backend.
4241

42+
All relevant files are located in `OnlinePythonTutor/v3/`, since v3 is the currently-active version.
43+
44+
The frontend consists of:
45+
visualize.html
46+
css/opt-frontend.css
47+
js/opt-frontend.js
48+
css/pytutor.css
49+
js/pytutor.js
50+
<a bunch of auxiliary css and js files such as libraries, etc.>
51+
52+
`pytutor.[js|css]` contains the bulk of the OPT frontend code.
53+
`opt-frontend.[js|css]` contains code that is specific to `visualize.html` and doesn't make sense for, say,
54+
embedding OPT visualizations into other types of webpages.
55+
56+
The backend consists of:
57+
58+
pg_logger.py : the main entry point for the OPT backend
59+
pg_encoder.py : encodes the trace format into JSON to send to frontend
60+
generate_json_trace.py : script to test the backend independent of the frontend
61+
app.yaml and pythontutor.py : config files for Google App Engine
62+
web_exec.py : example CGI script for deploying on CGI-enabled webservers
63+
64+
bah

0 commit comments

Comments
 (0)