You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/BEGINNER-FIELD-GUIDE.md
+104-7Lines changed: 104 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,9 @@ Welcome! This all-in-one tutorial is for beginning programmers who know a bit of
22
22
---
23
23
24
24
## 1. Welcome to YourApp Starter {#welcome}
25
-
YourApp Starter is a CustomTkinter-based template that shows how to ship a Windows-friendly desktop app with multiple launchers, automated installers, and docs-first guidance. It still looks like Tic Tac Toe out of the box, but the real goal is giving you a neutral codebase where you can plug in your own business rules without guessing how things hang together. For quick context, skim the project overview in `README.md` (see [README – Project Goals](../README.md#-project-goals)).
25
+
YourApp Starter is a CustomTkinter-based template that shows how to ship a Windows-friendly desktop app with multiple launchers, automated installers, and docs-first guidance. It still looks like Tic Tac Toe out of the box, but the real goal is giving you a neutral codebase where you can plug in your own business rules without guessing how things hang together. Think of CustomTkinter as "Tkinter with a modern skin"—you still write standard Python widgets, but the toolkit adds dark mode, theming, and rounder controls. For quick context, skim the project overview in `README.md` (see [README – Project Goals](../README.md#-project-goals)).
26
+
27
+
Screenshot TODO: capture a single image that shows the GUI, CLI, and desktop shortcut after you finish Section 9 so learners know what a successful setup looks like.
26
28
27
29
> _Screenshot placeholder: hero shot of the CustomTkinter window + CLI side by side so viewers can see both frontends._
28
30
@@ -34,15 +36,23 @@ YourApp Starter is a CustomTkinter-based template that shows how to ship a Windo
34
36
-**Screenshot placeholders:** Drop visuals wherever you see "Screenshot placeholder" callouts when you're ready to capture your own screenshots.
35
37
-**Return path:** Every section ends with a "Back to TOC" link so you can bounce around without losing your spot.
36
38
39
+
When you reach a screenshot placeholder, jot down the scenario it should capture (e.g., "Section 4 install log") and grab the image the first time you successfully finish that step. Keeping a running list now prevents a last-minute scramble before release day.
40
+
41
+
**Quick glossary for recurring terms**
42
+
-*headless mode:* Runs the GUI logic with fake widgets so CI can exercise it without a display.
43
+
-*service mode:* An automation-first launcher that reads environment variables instead of prompting you.
44
+
-*telemetry hooks:* Convenience functions in `src/tictactoe/controller/__init__.py` that log structured events when you flip logging env vars.
45
+
-*CustomTkinter:* A themed fork of Tkinter that exposes the same widget concepts with a modern appearance.
46
+
37
47
[Back to TOC](#table-of-contents)
38
48
39
49
## 3. Template Highlights at a Glance {#template-highlights}
40
50
Why teams adopt this starter (see [README – Template Highlights](../README.md#-template-highlights)):
41
-
-**One entry point, many frontends:**`python -m tictactoe` dispatches GUI, CLI, headless, or service modes from `src/tictactoe/__main__.py`.
42
-
-**Typed configuration:**`src/tictactoe/config/gui.py` keeps fonts, colors, layout, and copy as immutable dataclasses.
43
-
-**Installer + launcher duo:**`wheel-builder.bat` generates `installation.bat`, `tic-tac-toe-starter.vbs`, helper docs, and the signed wheel bundle under `dist/`.
44
-
-**Headless-friendly testing:**`tictactoe.ui.gui.headless_view` mirrors the CustomTkinter widgets so GUI tests run inside CI (documented in `docs/TESTING.md`).
45
-
-**Docs-first approach:**`docs/TEMPLATE-USAGE-GUIDE.md` and `docs/TEMPLATE-CHECKLIST.md` walk you through adopting the template in a specific order.
51
+
-**One entry point, many frontends:**`python -m tictactoe` dispatches GUI, CLI, headless, or service modes from `src/tictactoe/__main__.py`. You never touch multiple scripts—flags or env vars pick the experience for you.
52
+
-**Typed configuration:**`src/tictactoe/config/gui.py` keeps fonts, colors, layout, and copy as immutable dataclasses, so changing `GameViewConfig` feels like editing normal Python objects instead of ad-hoc dicts.
53
+
-**Installer + launcher duo:**`wheel-builder.bat` generates `installation.bat`, `tic-tac-toe-starter.vbs`, helper docs, and the signed wheel bundle under `dist/`. That bundle is exactly what you zip and ship to testers.
54
+
-**Headless-friendly testing:**`tictactoe.ui.gui.headless_view` mirrors the CustomTkinter widgets so GUI tests run inside CI (documented in `docs/TESTING.md`). Flip `TICTACTOE_HEADLESS=1` and the app behaves like the GUI even though no window opens.
55
+
-**Docs-first approach:**`docs/TEMPLATE-USAGE-GUIDE.md` and `docs/TEMPLATE-CHECKLIST.md` walk you through adopting the template in a specific order, preventing "where do I start?" moments.
46
56
47
57
> _Screenshot placeholder: collage of `dist/` folder, installer console, and desktop shortcut._
48
58
@@ -76,13 +86,25 @@ Everything below is straight from `README.md` plus `docs/TEMPLATE-USAGE-GUIDE.md
76
86
77
87
Tip: keep `pwsh` terminals handy so PowerShell-specific scripts such as `wheel-builder.bat` and `scripts/run-ci.ps1` run without quoting gymnastics.
78
88
89
+
macOS/Linux quick ref:
90
+
```bash
91
+
python3 -m venv .venv
92
+
source .venv/bin/activate
93
+
pip install -r requirements.txt
94
+
python -m tictactoe --ui cli --script 0,4,8
95
+
```
96
+
97
+
If Windows blocks the activation script, run `Set-ExecutionPolicy -Scope CurrentUser RemoteSigned` once inside an elevated PowerShell window. Need Python first? Install from python.org, check "Add to PATH," then reopen your terminal so `python` resolves correctly.
98
+
79
99
> _Screenshot placeholder: terminal session showing the activation + pip install + first run output._
80
100
81
101
[Back to TOC](#table-of-contents)
82
102
83
103
## 5. Install the Packaged Build {#installer}
84
104
Want to preview the real installer experience? Follow `docs/INSTALLATION-GUIDE.md`:
85
105
106
+
> Windows-only heads up: the installer and `.bat/.vbs` scripts rely on PowerShell and the Windows desktop shell. If SmartScreen pauses the run, choose **More info > Run anyway** after verifying the script came from your build.
107
+
86
108
1.**Build artifacts** (or download a release ZIP):
87
109
```pwsh
88
110
.\wheel-builder.bat
@@ -96,6 +118,14 @@ Want to preview the real installer experience? Follow `docs/INSTALLATION-GUIDE.m
96
118
- Drop `YourApp Starter.lnk` on the desktop via the VBScript launcher.
97
119
4. Launch from the shortcut (uses `pythonw.exe` so no console window pops up).
98
120
121
+
Expected log excerpt so you know things are on track:
122
+
```
123
+
Creating venv under %LOCALAPPDATA%\Programs\yourapp-starter-<version>
124
+
Installing wheel ... done
125
+
Seed data: python -m tictactoe --ui service --script 0,4,8 --quiet
126
+
Shortcut created on Desktop
127
+
```
128
+
99
129
For an under-the-hood blow-by-blow, read `docs/INSTALLATION-TECHNICAL-DETAILS.md`—it covers everything from registry lookups for OneDrive desktops to how AppUserModelIDs keep icons tidy.
100
130
101
131
> _Screenshot placeholder: SmartScreen prompt and installer console log._
@@ -124,6 +154,20 @@ Environment fallbacks keep installers and CI simple:
-`TICTACTOE_LOGGING` (plus legacy `*_LOGGING`) enabling telemetry hooks defined in `src/tictactoe/controller/__init__.py`.
126
156
157
+
Setter quick ref:
158
+
```pwsh
159
+
$env:TICTACTOE_HEADLESS = "1"
160
+
python -m tictactoe
161
+
Remove-Item Env:TICTACTOE_HEADLESS
162
+
```
163
+
```bash
164
+
export TICTACTOE_HEADLESS=1
165
+
python -m tictactoe
166
+
unset TICTACTOE_HEADLESS
167
+
```
168
+
169
+
Think of **headless mode** as a fake GUI—it renders the same layout through `HeadlessGameView`, so screenshot tests and CI runs stay deterministic. **Service mode** skips prompts entirely and only reads environment variables, which is what the installer and smoke tests rely on. Capture a screenshot of `python -m tictactoe --list-frontends` and the shortcut properties to replace the placeholder once everything is renamed.
170
+
127
171
> _Screenshot placeholder: `python -m tictactoe --list-frontends` output next to the desktop shortcut properties dialog._
128
172
129
173
[Back to TOC](#table-of-contents)
@@ -142,6 +186,8 @@ Use this section as your quick-reference script when explaining the template to
142
186
6.**Assets & tools:**`src/tictactoe/assets/` for icons/themes and `src/tictactoe/tools/theme_codegen.py` for converting JSON themes into typed configs.
Whenever you replace the domain logic, keep returning `ExampleState`-shaped objects so the GUI bindings stay alive. Later you can rename the class once tests and UI references are updated. Telemetry hooks are just helper functions (`emit_event`, `log_action`, etc.)—calling them is optional during prototyping but useful once you need trace logs.
Replace the placeholder with a screenshot of your own tracking document, VS Code checklist, or whiteboard so future readers can see what progress looks like.
Remember to clean up afterward with `Remove-Item Env:TICTACTOE_SCRIPT, Env:TICTACTOE_AUTOMATION_OUTPUT` (PowerShell) or `unset` (bash) so later runs do not inherit old values.
202
278
-**Headless GUI** just works by launching `python -m tictactoe --ui headless` or setting `TICTACTOE_HEADLESS=1`; the shim lives in `tictactoe/ui/gui/headless_view.py`.
203
279
-**Telemetry hooks** (see `tictactoe/controller/__init__.py`) let every frontend log events once you flip `TICTACTOE_LOGGING=1`—great for installers or automated smoke tests.
204
280
205
-
> _Screenshot placeholder: log output from CLI automation plus a JSON summary snippet._
281
+
> _Screenshot placeholder: log output from CLI automation plus a JSON summary snippet._ ← Capture the CLI summary text next to the JSON file in your editor once you have the automation folder in place.
206
282
207
283
[Back to TOC](#table-of-contents)
208
284
@@ -227,6 +303,8 @@ Need scripted runs or CI demos without a GUI? Lean on the CLI + service pair fro
227
303
4.**Smoke test** the generated installer on a clean Windows profile.
228
304
5.**Zip and publish**`dist/` as the release payload (see `docs/RELEASE.md#6-publish-github-release`).
229
305
306
+
`--ci` skips pauses and writes to `%TEMP%` so GitHub Actions can run unattended; the plain invocation prompts you and installs under `%LOCALAPPDATA%`. Both commands require Windows, PowerShell, and access to the Windows desktop shell (no Server Core). Capture a screenshot of the final `dist/` explorer window before zipping so teammates know exactly which files to ship.
307
+
230
308
> _Screenshot placeholder: PowerShell transcript from `wheel-builder.bat` plus the resulting `dist/` explorer window._
231
309
232
310
[Back to TOC](#table-of-contents)
@@ -249,6 +327,12 @@ Everything you need lives in `docs/TESTING.md`, but here are the highlights:
249
327
-**Coverage** is optional but easy: `python -m pytest --cov=tictactoe --cov-report=term-missing`.
If Tk libraries are missing on Windows, install the official Python build (it bundles Tk) or set `TICTACTOE_HEADLESS=1` before running GUI tests. macOS/Linux users should install the system `tk` package (`brew install python-tk` or distro equivalent). Typical pytest success output:
331
+
```
332
+
==================== 12 passed, 2 skipped in 5.23s ====================
333
+
```
334
+
Seeing green like that means you can move on to packaging with confidence.
335
+
252
336
> _Screenshot placeholder: VS Code test explorer or pytest output highlighting GUI vs non-GUI markers._
253
337
254
338
[Back to TOC](#table-of-contents)
@@ -264,6 +348,8 @@ Everything you need lives in `docs/TESTING.md`, but here are the highlights:
264
348
-**GitHub Actions:**`.github/workflows/ci.yml` mirrors the same steps (lint, type, pytest, build wheel). Use the sample matrix in `docs/CI-CD.md` if you want tox-driven jobs.
265
349
-**Release workflow:**`docs/RELEASE.md` describes tagging, uploading `dist/`, and notifying users. When you need extra installer tweaks, capture them in `docs/INSTALLER-CUSTOMIZATION.md` for future maintainers.
266
350
351
+
Open `.github/workflows/ci.yml` to see the exact job order; the file sits at the repo root so you can tweak it without hunting around. To re-run a workflow manually, head to GitHub → Actions tab → pick the `CI` workflow → **Run workflow**. Grab a screenshot of the green workflow summary for this section once your branch passes.
352
+
267
353
> _Screenshot placeholder: CI pipeline diagram or GitHub Actions run summary._
268
354
269
355
[Back to TOC](#table-of-contents)
@@ -278,6 +364,15 @@ Common issues and quick fixes (see `docs/TROUBLESHOOTING.md` for the full FAQ):
278
364
279
365
> _Screenshot placeholder: snippet of `docs/TROUBLESHOOTING.md` or an error dialog with a fix overlay._
280
366
367
+
Quick matcher table (copy into your notes as you debug):
368
+
369
+
| Symptom | Likely cause | Fast fix |
370
+
| --- | --- | --- |
371
+
|`Activate.ps1 cannot be loaded because running scripts is disabled on this system.`| Execution policy blocking venv activation |`Set-ExecutionPolicy -Scope CurrentUser RemoteSigned` then retry |
372
+
|`ModuleNotFoundError: No module named 'tictactoe'` after rename | Imports still reference old package name | Run a project-wide search/replace for `tictactoe` and rerun tests |
373
+
| SmartScreen warns "unrecognized app" when running installer | Unsigned local build | Click **More info > Run anyway** after verifying hash/source |
374
+
| GUI launch fails with `No module named '_tkinter'`| Tk runtime missing | Install official Python or system `tk` package, or force headless mode |
375
+
281
376
[Back to TOC](#table-of-contents)
282
377
283
378
## 15. Next Steps & Additional Resources {#next-steps}
@@ -293,4 +388,6 @@ Here’s where to go once you finish this guide:
Suggested next-study order once this guide clicks: `docs/ARCHITECTURE.md` → `docs/CONFIGURATION.md` → `docs/TEMPLATE-USAGE-GUIDE.md` → `docs/RELEASE.md`. Pair that with two hands-on tasks—(1) create a brand-new theme JSON, and (2) rerun `scripts/run-ci.ps1`—so the knowledge sticks.
Copy file name to clipboardExpand all lines: docs/CI-CD.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,6 +51,8 @@ jobs:
51
51
52
52
> The repository’s checked-in `.github/workflows/ci.yml` currently mirrors the `run-ci` scripts by running the linters/type checker/pytest directly instead of invoking tox. Use whichever style matches your team’s conventions.
53
53
54
+
Need to tweak the workflow? Open `.github/workflows/ci.yml` at the repo root—no scaffolding tools required. To re-run it manually, visit GitHub → **Actions** → select the `CI` workflow → **Run workflow**, then pick the target branch. Capture a screenshot or permalink of the passing run whenever you document release steps so teammates can see the expected job order.
55
+
54
56
## Extending to Release Pipelines
55
57
- Add a `release` job that depends on `tests`, runs `wheel-builder.bat` (or PowerShell equivalent on Windows runners), and uploads `dist/` as an artifact.
56
58
- Gate GitHub Releases on successful CI by requiring the workflow status check.
When the GUI (or headless GUI) launches, it inspects `TICTACTOE_THEME_PAYLOAD` and rebuilds the dataclasses via `deserialize_game_view_config`. This keeps installers and CI jobs theme-aware without touching widget code.
The command prints a `demo_theme` dataclass assignment you can paste into `config/gui.py` or tests.
147
+
5. Commit both the JSON (if you plan to ship it) and the generated Python so future contributors can tweak either side.
148
+
131
149
## Sample JSON Themes & Dataclass Converter
132
150
133
151
Need a starting point for custom palettes? The repository now ships JSON payloads under `src/tictactoe/assets/themes/` (`light.json`, `dark.json`, `enterprise.json`). Feed those files into the new converter CLI to emit ready-to-paste `GameViewConfig` assignments:
0 commit comments