Skip to content

abbari6566/VisualiseMyPython

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Visualise My Python

A small Python execution visualizer built with:

  • FastAPI backend
  • Docker sandbox runner for executing user code
  • Next.js frontend with editor, stepper, call stack, and heap views

Demo

Demo UI

Features

  • Run Python code and trace execution step-by-step
  • View current line in source
  • Inspect call stack and function frames
  • Inspect heap objects with reference-based serialization (Python Tutor-style)
  • Sandboxed execution in Docker with basic hardening (--network none, memory/CPU limits, read-only FS, PID limits)

Project Structure

  • backend/main.py - FastAPI API (POST /trace)
  • backend/sandbox/runner.py - Python tracer + serializer executed inside Docker
  • backend/sandbox/Dockerfile - sandbox image
  • frontend/ - Next.js app (editor + visualizer UI)

Run Locally

1) Build the sandbox image

docker build -t python-visualizer-runner backend/sandbox

2) Start the backend

uvicorn backend.main:app --reload --host 127.0.0.1 --port 8000

3) Start the frontend

cd frontend
npm install
npm run dev

Open http://localhost:3000

Notes

  • This is a side project and intended for local use.
  • User code is executed with exec() inside a Docker container (not directly in the FastAPI process).
  • If you expose the backend publicly, add stronger production hardening and authentication/rate limits.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors