How syildizz/pymaker works
Project type and purpose
• PyMaker is a full-stack web application for generating Python code using AI.
• The frontend is a static HTML/JS single-page served by FastAPI.
• The backend is a FastAPI server (written in Python) that orchestrates requests to an Ollama code-generation engine.
• It can be deployed via Docker Compose on a single host or via Kubernetes using Helm charts for production/horizontal scale.
File structure
├─ .gitignore, LICENSE, README.md (global metadata)
├─ github_asset/ (screenshots)
├─ pymaker-web/ (webserver code & Dockerfile)
│ ├─ Dockerfile, .dockerignore
│ ├─ requirements.txt
│ └─ src/
│ ├─ index.html, static/js/*.js (UI)
│ ├─ main.py (FastAPI app entrypoint)
│ ├─ config.py, model.py, ollama.py (backend logic and Ollama integration)
└─ pymaker-deploy/ (deployment artifacts)
├─ compose.yaml (Docker Compose)
├─ helm/
│ ├─ pymaker/ (umbrella chart with two subcharts: ollama, pymaker-web)
│ └─ pinger/ (test-pod chart for network/health checks)
└─ config/ (shared config files and prompt_prefix)
README for additional insights
• Confirms FastAPI + Ollama llama3.2 model.
• Notes two deployment modes: Docker Compose vs Kubernetes (Helm).
• No external database is used; state is ephemeral.
a. Main components
• Client Browser (HTML + JS)
• FastAPI Backend (pymaker-web/main.py)
• Ollama Service (llama3.2 model container)
• Deployment Infrastructure (Docker Compose or Kubernetes Cluster)
• Config & CI (compose.yaml, Helm charts, config maps)
• (Optional) Pinger test-pod for network/health checks
b. Relationships & interactions
1. User in browser → HTTP(S) request to FastAPI server
2. FastAPI processes UI request → calls ollama.py → forwards prompt to Ollama engine (gRPC/CLI)
3. Ollama generates code → returns response to FastAPI
4. FastAPI → HTTP response carrying generated code → Browser UI
5. Deployment assets (compose vs Helm) spin up containers/pods for FastAPI and Ollama
6. In Kubernetes: Ingress → Service → Deployment pods (FastAPI + Ollama)
7. pinger jobs test network reachability to FastAPI service
c. Architectural patterns & principles
• Separation of concerns: UI (static) vs API vs AI engine
• Container-first design for portability (Docker + Helm)
• Configuration-as-code: YAML/JSON config + prompt_prefix templates
• Helm umbrella chart with subcharts for modular micro-services
d. Relevant technologies
• Frontend: HTML, JavaScript
• Backend: Python, FastAPI
• AI Engine: Ollama (llama3.2)
• Containerization: Docker, Docker Compose
• Orchestration: Kubernetes, Helm charts
• Testing: Helm test-pod (pinger)