Skip to content

Commit 267534a

Browse files
authored
Merge pull request #40 from europanite/feature/sitemap
fix/doc
2 parents d49ad5d + 21e2dfa commit 267534a

File tree

2 files changed

+64
-2
lines changed

2 files changed

+64
-2
lines changed

README.md

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,61 @@ A Client-Side Browser-Based Python Playground.
1212

1313
---
1414

15-
## 🧰 How It Works
15+
## Overview
1616

17-
On first load, the app fetches Pyodide from CDN and exposes runPythonAsync to execute the code in the textbox. Output and errors are streamed to the in-page console. A soft “Stop” cancels by bumping an execution token.
17+
Client Side Python is a **browser-based Python playground powered by Pyodide**.
18+
All Python code runs **entirely inside your browser tab** (WebAssembly, no backend), so your code never leaves your machine.
19+
20+
This makes it useful for:
21+
22+
- Quickly trying out small Python snippets
23+
- Demonstrating Python basics in a classroom or workshop
24+
- Experimenting with simple numeric or scripting tasks in a safe sandbox
25+
- Showing how WebAssembly + Pyodide can bring “real” Python to the browser
26+
27+
---
28+
29+
## Features
30+
31+
- **Fully client-side execution**
32+
- Uses [Pyodide](https://pyodide.org) to run CPython in WebAssembly.
33+
- No server, no database, no authentication required by default.
34+
35+
- **Simple code editor + console**
36+
- Text area for Python code.
37+
- Console area that shows `stdout` and `stderr`.
38+
- Buttons: **Run**, **Stop**, **Clear**, **Load Sample**, **Copy Output**.
39+
40+
- **Soft “Stop” mechanism**
41+
- Execution is wrapped with a soft cancel token.
42+
- When you press **Stop**, the current run is logically cancelled so that late results are ignored instead of breaking the UI.
43+
44+
- **Responsive web UI**
45+
- Built with **Expo / React Native Web** and **Material UI** components.
46+
- Layout adapts to different viewport sizes (desktop / tablet).
47+
48+
- **Deterministic CI via Docker**
49+
- Jest tests run in a Docker container using `docker-compose.test.yml`.
50+
- GitHub Actions workflows are provided for CI and Docker-based testing.
51+
52+
- **Automatic deployment to GitHub Pages**
53+
- GitHub Actions workflow builds the Expo web bundle and publishes it to GitHub Pages for the `main` branch.
54+
55+
---
56+
57+
## How It Works
58+
59+
On first load, the app:
60+
61+
1. Fetches Pyodide from a CDN.
62+
2. Initializes the Pyodide runtime and exposes `runPythonAsync`.
63+
3. Attaches custom handlers for `stdout` and `stderr` so that Python output is streamed into the in-page console.
64+
4. Uses a simple execution token to implement a **soft Stop**:
65+
- Each run increments an internal `execId`.
66+
- If a run finishes with an outdated `execId`, its output is discarded.
67+
- This prevents stale results from older runs from polluting the console.
68+
69+
All of this happens **in the browser**, without any backend API calls.
1870

1971
---
2072

frontend/app/screens/HomeScreen.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ export default function HomeScreen() {
6565
flexWrap: "wrap" as const,
6666
},
6767
title: { fontSize: 22, fontWeight: 800, margin: 0 },
68+
subtitle: {
69+
margin: 0,
70+
marginTop: 4,
71+
fontSize: 14,
72+
color: "#4b5563",
73+
maxWidth: 520,
74+
},
6875
codePaper: {
6976
flex: 1,
7077
display: "flex",
@@ -219,6 +226,9 @@ export default function HomeScreen() {
219226
Client Side Python
220227
</a>
221228
</h1>
229+
<p style={styles.subtitle as any}>
230+
Browser-based Python playground powered by Pyodide. Run and experiment with Python code directly in your web browser — no server or account required.
231+
</p>
222232
<Stack
223233
direction={narrow ? "column" : "row"}
224234
spacing={1}

0 commit comments

Comments
 (0)