You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6aa3d70
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: v3/docs/developer-overview.md
+26-4Lines changed: 26 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,14 +29,36 @@ The main caveat here is that Google App Engine runs Python 2.7, so you won't be
29
29
30
30
## Overall system architecture
31
31
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.
34
33
Here is a typical user interaction sequence:
35
34
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/)).
37
36
2. The user hits the "Visualize execution" button.
38
37
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.
40
39
5. The frontend switches to a visualization pane, parses the execution trace, and renders the appropriate stack frames and heap objects.
41
40
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.
42
41
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
0 commit comments