TermExec is a lightweight and secure web-based terminal application that allows users to execute Python code in real time. Built with a frontend powered by Xterm.js and a backend using WebSocket and Docker, TermExec provides an isolated and dynamic environment for code execution.
To set up and run TermExec, ensure the following prerequisites are installed on your machine:
- Node.js (v16 or later) - Download Node.js
- Docker - Install Docker
- A modern browser to access the frontend.
The frontend is located in the front
directory and is built using Xterm.js for terminal functionality.
- Navigate to the
front
directory:cd front
- Install the necessary dependencies:
npm install
The backend is located in the server
directory and is responsible for managing WebSocket connections and securely executing Python code inside Docker containers.
- Navigate to the
server
directory:cd server
- Install the necessary dependencies:
npm install
- In the server directory, run
node server.js
2. In the frontend directory, run
```bash
npx serve .
3. Now write the python command in the terminal