Math Foundation Builder is a local browser-based math tutor for guided algebra, geometry, and advanced math practice. It runs a Flask server on 127.0.0.1, opens in the browser, and reuses the existing Python lesson, problem, progress, and session logic.
Start with the short guide instead of reading every technical note at once:
docs/guide/README.md: what to read first.docs/guide/01-what-this-app-is.md: plain-English project overview.docs/guide/02-run-and-test.md: how to run, stop, and test the app.docs/guide/03-project-map.md: where the important files live.docs/guide/04-what-changed.md: what changed from the original cloned app.docs/guide/05-next-changes.md: how to think about future ideas.
The deeper audit and architecture docs are still in docs/brain/ for later reference.
web/app.py: Flask web app entry point.web/templates/: browser UI templates.web/static/: browser UI styles.web_launcher.py: local desktop-style launcher that starts Flask and opens the browser.config.py: app constants, subject/topic lists, phase settings, and labels.core/: progress tracking, session state, problem dispatch, and answer evaluation.content/: lesson cards, worked examples, mistakes, and vocabulary.problems/: randomized problem generators.tests/: stdlibunittestcoverage for core behavior, Flask routes, and packaging coverage.
Generated files such as build/, dist/, __pycache__/, and local runtime data/ are intentionally ignored.
- Python 3.9 or newer.
- Flask runtime dependencies from
requirements.txt. - Optional: PyInstaller for building the macOS app bundle.
Install runtime and build tooling:
python3 -m pip install -r requirements-dev.txtRun the local Flask web app:
python3 -m web.appThen open:
http://127.0.0.1:5000
Desktop-style local launch:
python3 web_launcher.pyThat starts the local server on an available port and opens the default browser.
In development mode, progress and logs are written to data/. That directory is local runtime state and should not be committed.
PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s tests -t . -vThe tests avoid writing bytecode and do not require a display server.
Focused web tests:
PYTHONDONTWRITEBYTECODE=1 python3 -m unittest tests.test_web_app -vpyinstaller MathFoundationBuilder.specThe generated build/ and dist/ directories are ignored. Commit source changes and the .spec file, not generated app bundles.
The spec now points at web_launcher.py and bundles web/templates plus web/static. A full PyInstaller build, signing, and notarization still need to be run before release.