5.2 KiB
5.2 KiB
FunkyJuice Recipes — Project Milestones
This document outlines the sequence of milestones to deliver the FunkyJuice Recipes desktop app using Toga, Peewee (SQLite), and Briefcase. Each milestone is scoped to be achievable in a short iteration and includes clear acceptance criteria.
Milestone 1 — Project skeleton and tooling
Set upsrc/funkyjuicerecipes/package layout per SPECS.Add minimalapp.pywithFunkyJuiceRecipesAppandmain()returning the app.Configurepyproject.toml(already added) and ensurebriefcase devcan start a blank window.Addtests/folder and test runner config.
Acceptance:
briefcase devlaunches an empty Toga window titled “FunkyJuice Recipes”.pytestruns (even with zero or smoke tests).
Milestone 2 — Database initialization and migrations framework
Implementdata/db.pyusingapp.paths.dataand Peewee pragmas (foreign_keys=1, WAL).Create migrations table and a simple migration runner that detects unapplied migration files by filename.Implement initial migrations forflavor,recipe, andrecipe_flavortables matching SPECS DDL.
Acceptance:
On first launch, DB file is created in the per‑user data directory, tables exist, and migrations table is populated.Subsequent launches do not re-run applied migrations.
Milestone 3 — Peewee models and DAOs
ImplementFlavor,Recipe,RecipeFlavormodels reflecting constraints (UNIQUEs, FKs, CHECKs where applicable in logic).Provide DAO/helper functions for common ops (create/list/get/update/delete) with soft-delete semantics for flavors).Enable case-insensitive uniqueness forFlavor(name, company).
Acceptance:
Unit tests can create flavors (no duplicates ignoring case), recipes, and link ingredients; soft-deleted flavors are excluded by default queries.
Milestone 4 — Calculation engine
- Implement pure functions in
logic/calculations.pyto compute PG/VG/Nic and per-flavor mL from inputs (percents + size). - Include validation (non-negative PG/VG; base_pg + base_vg = 100; percent totals ≈ 100 within tolerance).
- Define rounding/display policy (e.g., 1 decimal for View screen).
Acceptance:
- Tests cover the README example (120 mL case) and edge cases (nic in PG vs VG, excessive flavor %).
Milestone 5 — Main window and navigation shell
- Build
MainWindow: menu bar (File/New Recipe/Exit; Help/About), buttons for Inventory, recipe list placeholder. - Wire basic screens/routes (View Recipe, Add/Edit Recipe, Inventory) with placeholders.
Acceptance:
- App displays main list and can navigate to empty placeholder screens and back.
Milestone 6 — Inventory screen (CRUD + soft delete)
- Implement
FlavorsTablewith add/edit/delete. - Enforce no duplicates; on delete, soft-delete if referenced by recipes; otherwise hard-delete.
- Provide toggle to view soft-deleted flavors and actions to undelete or hard-delete when safe.
Acceptance:
- Users can manage flavors per README, with correct soft/hard delete behavior.
Milestone 7 — Add/Edit Recipe screens
- Implement
RecipeFormwith PG/VG base, Nic % and base, size, and flavor lines (select existing flavors + percentage). - Auto-maintain PG + VG = 100; prevent negatives.
- On save: validate, combine duplicate flavors (prompt as specified), persist recipe + ingredients.
Acceptance:
- Users can create and edit recipes meeting validation rules and duplicate-combine flow.
Milestone 8 — View Recipe screen
- Render computed components (PG, VG, Nic, flavors) using calculation engine, rounded to 1 decimal.
- Support view mode toggle: Individual Flavors vs Flavor Prep total.
- Provide action to open Edit, Delete confirmation, and Inventory.
Acceptance:
- A saved recipe displays correct amounts; toggle updates view accordingly.
Milestone 9 — Flavor Prep mixer utility
- Implement “Mix Flavor Prep” dialog/workflow computing batch amounts from recipe flavor ratios for selectable sizes (10/30/120 mL, etc.).
- No persistence for Flavor Prep (ephemeral), but support printing/exporting batch breakdown (optional CSV).
Acceptance:
- Users can choose a batch size and see per-flavor mL for the prep; closing returns to View Recipe.
Milestone 10 — Polishing, About, and edge behaviors
- Implement About dialog (app name, version, author).
- Confirm unsaved-changes prompts on screen change and app exit while editing.
- Empty states, error dialogs, and friendly validation messages.
Acceptance:
- UX polish complete; no obvious dead-ends; dialogs work across platforms.
Milestone 11 — Packaging and distribution
- Verify
briefcase devon target OS; add icons underresources/. - Build installers with Briefcase for target platforms.
- Document install/run instructions and DB location.
Acceptance:
- Installers build successfully; smoke test of installed app passes.
Milestone 12 — Testing and CI (optional but recommended)
- Add unit tests for models/DAOs and calculations; UI smoke tests using Toga Dummy backend where feasible.
- Set up a simple CI (e.g., GitHub Actions) to run tests on push.
Acceptance:
- CI passes on main branch; coverage of calculation and DAO logic acceptable.