How d-evil0per/programmer101 works
Project type and purpose
• From the file tree and the minimal README, this is a lightweight, single-host educational web app built with Streamlit. It serves as a “snippet library” and code runner for users to save, browse, and execute code examples.
• Key indicators:
• Presence of .streamlit folder and app.py at root → Streamlit UI
• controller/codeRunner.py → backend logic to run code snippets
• snippets.db → local SQLite database for persisting code snippets
File structure
• Top-level files and folders:
• .devcontainer → VS Code DevContainer config for consistent dev environment
• .gitignore, requirements.txt → standard versioning and dependency management
• app.py → Streamlit entry point
• controller/ → business logic (code execution)
• pages/ → Streamlit multipage views (home.py, snippet-library.py)
• snippets.db → embedded SQLite DB file
• No separate microservices or external APIs—this is a monolithic Python application.
• MVC-like pattern:
• Views = Streamlit pages
• Controller = codeRunner module
• Model = SQLite persistence
README for additional insights
• The README is minimal (“Programmer 101”) but implies an educational focus and a core feature set around code snippets and execution.
Main components and interactions
a. Components
• Streamlit UI
– app.py (root multipage router)
– pages/home.py (welcome/dashboard)
– pages/snippet-library.py (list, create, edit snippets)
• Controller
– controller/codeRunner.py (executes code and returns output)
• Database
– snippets.db (SQLite)
• Development Environment (optional)
– .devcontainer (Docker/VSCode dev sandbox)
b. Relationships and data flow
1. User (browser) ↔ HTTP over Streamlit
2. Streamlit UI calls controller functions
3. Controller queries/updates SQLite DB for snippet metadata
4. Controller runs code snippets in an isolated subprocess or sandbox
5. Output returned to Streamlit UI
c. Architectural patterns
– Monolithic MVC-inspired structure
– Local persistence with embedded database
– Single container development environment
d. Key technologies
– Python 3.x
– Streamlit framework
– SQLite for storage
– Docker (via .devcontainer) for dev environment
Detailed advice
• SQLite file clearly as the single source of truth for snippet persistence.
• If desired, annotate the DevContainer to show that developers open the code in a consistent Docker-based environment.