diff --git a/README.md b/README.md index e0d604e..313126a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,138 @@ -# 030-password-manager +# ๐Ÿš€ Password Manager +A small Tkinter password manager that generates passwords, saves them in a JSON +file and searches them by website. It is the day 30 assignment of Udemy's +"100 Days of Code: The Complete Python Pro Bootcamp", written for course +participants and for anyone who browses the repository for ideas. + +## ๐Ÿ“š Table of Contents + +- [Overview](#-overview) +- [Requirements](#-requirements) +- [Setup](#-setup) +- [Run](#-run) +- [Tests](#-tests) +- [License](#-license) +- [Links](#-links) +- [Appendix: Project documents](#-appendix-project-documents) + +## ๐Ÿงญ Overview + +The program follows the three lectures of the assignment: + +1. **JSON storage.** Each entry is saved as a nested record + (`website โ†’ email, password`) in `data.json` with `json.dump`, and the + existing data is loaded and updated before a new entry is added. +2. **Exception handling.** A missing, empty or damaged data file does not stop + the program; the file is created or repaired on the next save. +3. **Search.** Type a website and press **Search** to see the saved e-mail and + password, or a message when nothing is saved for it. + +The assignment's function names are kept: `generate_password`, `save` and +`find_password`. + +| Path | What it holds | +| --- | --- | +| `src/password_manager/` | The program: domain rules, use cases, JSON storage and the Tkinter window | +| `src/password_manager/constants.py` | Every constant (file name, labels, messages, password length bounds) | +| `tests/` | The pytest tests | +| `docs/` | Project documents, the Doxygen output folder and the wiki in `docs/wiki/` | +| `Doxyfile` | Doxygen configuration for the source comments | +| `pyproject.toml` | Project configuration (Python version, entry point, pytest) | + +> **Security note.** The data file is plain JSON and the passwords are not +> encrypted. The program is a learning exercise; do not use it for real +> passwords. + +## ๐Ÿ“‹ Requirements + +- Python 3.13 or newer, with Tkinter (the standard Windows and macOS installers + include it; on Debian or Ubuntu install `python3-tk`). +- `venv` and `pip`, both part of Python. +- No runtime dependencies. [pytest][pytest] is needed only to run the tests. +- Optional: [Doxygen][doxygen] to build the source documentation. + +## ๐Ÿ› ๏ธ Setup + +Create and activate a local virtual environment, upgrade `pip`, then install +the project with its test dependency. + +Windows (PowerShell): + +```powershell +python -m venv .venv +.venv\Scripts\Activate.ps1 +python -m pip install --upgrade pip +python -m pip install -e ".[dev]" +``` + +Linux and macOS: + +```bash +python3 -m venv .venv +source .venv/bin/activate +python -m pip install --upgrade pip +python -m pip install -e ".[dev]" +``` + +## โ–ถ๏ธ Run + +With the virtual environment active: + +```bash +python -m password_manager +``` + +or, after the install above, `password-manager`. The program creates `data.json` +in the folder you start it from. Build the source documentation with +`doxygen Doxyfile`; the HTML opens at `docs/doxygen/html/index.html`. + +## ๐Ÿงช Tests + +```bash +python -m pytest +``` + +## ๐Ÿ“„ License + +See [LICENSE][license]. + +## ๐Ÿ”— Links + +- [Repository][repository] +- [Documentation][documentation] +- [Issue tracker][issues] + +## ๐Ÿ“Ž Appendix: Project documents + +The documents a newcomer needs, in reading order. + +| Document | What it tells you | +| --- | --- | +| [Business Case][BC-001] | Why the project exists, its scope and success criteria | +| [Stakeholder Analysis][SA-001] | Who is involved; the stakeholder IDs used for owners and reviewers | +| [Project Plan][PP-001] | The gateways and their schedule | +| [Milestones][milestones] | One document per gateway: Go/No-Go criteria and tasks | +| [Artifact registry][registry] | Where each artifact type lives, the next version, the PO language and domain | +| [Domain dictionary][DICT-001] | The PO terms and the IT terms | +| [Traceability matrix][TM-001] | How the artifacts link and when each was last reviewed | +| [Framework README][framework-readme] | The framework this project uses | +| [Framework changelog][framework-changelog] | What changed in each framework release | + +--- + +[repository]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/030-password-manager +[documentation]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/030-password-manager/wiki +[issues]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/030-password-manager/issues +[license]: ./LICENSE +[pytest]: https://docs.pytest.org/ +[doxygen]: https://www.doxygen.nl/ +[BC-001]: ./docs/business-case.md +[SA-001]: ./docs/stakeholder-analysis.md +[PP-001]: ./docs/project-plan.md +[milestones]: ./docs/milestones/ +[registry]: ./docs/artifact-registry.md +[DICT-001]: ./docs/dictionary.md +[TM-001]: ./docs/sqa/traceability-matrix.md +[framework-readme]: ./framework/README.md +[framework-changelog]: ./framework/CHANGELOG.md diff --git a/docs/artifact-registry.md b/docs/artifact-registry.md index 3614d88..c326845 100644 --- a/docs/artifact-registry.md +++ b/docs/artifact-registry.md @@ -16,7 +16,7 @@ document of a type. `Primary File` may contain a glob (e.g. | PP | Project Plan | docs/project-plan.md | 002 | | MIL | Milestone / Gateway | docs/milestones/*.md | 004 | | DICT | Domain Dictionary | docs/dictionary.md | 002 | -| RC | SQA Review Record | docs/sqa/reviews/rc-*.md | 007 | +| RC | SQA Review Record | docs/sqa/reviews/rc-*.md | 008 | | TM | Traceability Matrix | docs/sqa/traceability-matrix.md | 002 | ## Languages diff --git a/docs/project-plan.md b/docs/project-plan.md index fc3ceab..4ca05c2 100644 --- a/docs/project-plan.md +++ b/docs/project-plan.md @@ -40,9 +40,9 @@ sets no deadline, so the plan keeps the phases short and sequential. | Gateway | Document | Window | Decision date | Owner | Stories | Main deliverable | Milestone | | --- | --- | --- | --- | --- | --- | --- | --- | -| Project Foundation | [MIL-001] | 2026-10-14 to 2026-10-15 | 2026-10-15 | S01 | none | pyproject.toml, .gitignore, constants.py, Doxyfile, README, repository description and topics | | -| Password Manager Features | [MIL-002] | 2026-10-15 to 2026-10-17 | 2026-10-17 | S01 | none | JSON storage, exception handling, search, generator, window and tests | | -| Documentation and Publishing | [MIL-003] | 2026-10-17 to 2026-10-19 | 2026-10-19 | S01 | none | Screenshots, README with screenshots, wiki in en, da and ms | | +| Project Foundation | [MIL-001] | 2026-10-14 to 2026-10-15 | 2026-10-15 | S01 | none | pyproject.toml, .gitignore, constants.py, Doxyfile, README, repository description and topics | [Milestone 162](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/030-password-manager/milestone/162) | +| Password Manager Features | [MIL-002] | 2026-10-15 to 2026-10-17 | 2026-10-17 | S01 | none | JSON storage, exception handling, search, generator, window and tests | [Milestone 163](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/030-password-manager/milestone/163) | +| Documentation and Publishing | [MIL-003] | 2026-10-17 to 2026-10-19 | 2026-10-19 | S01 | none | Screenshots, README with screenshots, wiki in en, da and ms | [Milestone 164](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/030-password-manager/milestone/164) | ```plantuml @startgantt diff --git a/docs/sqa/reviews/rc-001-business-case.md b/docs/sqa/reviews/rc-001-business-case.md index 20d2fda..b0ceb3b 100644 --- a/docs/sqa/reviews/rc-001-business-case.md +++ b/docs/sqa/reviews/rc-001-business-case.md @@ -66,3 +66,4 @@ Go โ€” every Mandatory criterion passes. [BC-001]: ../../business-case.md [53f56ee]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/030-password-manager/commit/53f56eeb143d810b91da23f743a53a32207f81bb +[QC-PY-001]: ../../../framework/qc/code/qc-programming-python.md diff --git a/docs/sqa/reviews/rc-002-stakeholder-analysis.md b/docs/sqa/reviews/rc-002-stakeholder-analysis.md index 01990f3..1c0a80d 100644 --- a/docs/sqa/reviews/rc-002-stakeholder-analysis.md +++ b/docs/sqa/reviews/rc-002-stakeholder-analysis.md @@ -66,3 +66,4 @@ Go โ€” every Mandatory criterion passes. [SA-001]: ../../stakeholder-analysis.md [53f56ee]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/030-password-manager/commit/53f56eeb143d810b91da23f743a53a32207f81bb +[QC-PY-001]: ../../../framework/qc/code/qc-programming-python.md diff --git a/docs/sqa/reviews/rc-003-dictionary.md b/docs/sqa/reviews/rc-003-dictionary.md index b63d617..a649888 100644 --- a/docs/sqa/reviews/rc-003-dictionary.md +++ b/docs/sqa/reviews/rc-003-dictionary.md @@ -65,3 +65,4 @@ Go โ€” every Mandatory criterion passes. [DICT-001]: ../../dictionary.md [53f56ee]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/030-password-manager/commit/53f56eeb143d810b91da23f743a53a32207f81bb +[QC-PY-001]: ../../../framework/qc/code/qc-programming-python.md diff --git a/docs/sqa/reviews/rc-004-mil-001.md b/docs/sqa/reviews/rc-004-mil-001.md index e0e2a4f..582248f 100644 --- a/docs/sqa/reviews/rc-004-mil-001.md +++ b/docs/sqa/reviews/rc-004-mil-001.md @@ -64,3 +64,4 @@ Go โ€” every Mandatory criterion passes. [MIL-001]: ../../milestones/mil-001-project-foundation.md [53f56ee]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/030-password-manager/commit/53f56eeb143d810b91da23f743a53a32207f81bb +[QC-PY-001]: ../../../framework/qc/code/qc-programming-python.md diff --git a/docs/sqa/reviews/rc-005-mil-002.md b/docs/sqa/reviews/rc-005-mil-002.md index 1255773..d1020bc 100644 --- a/docs/sqa/reviews/rc-005-mil-002.md +++ b/docs/sqa/reviews/rc-005-mil-002.md @@ -64,3 +64,4 @@ Go โ€” every Mandatory criterion passes. [MIL-002]: ../../milestones/mil-002-password-manager-features.md [53f56ee]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/030-password-manager/commit/53f56eeb143d810b91da23f743a53a32207f81bb +[QC-PY-001]: ../../../framework/qc/code/qc-programming-python.md diff --git a/docs/sqa/reviews/rc-006-mil-003.md b/docs/sqa/reviews/rc-006-mil-003.md index b8ad9aa..c408dda 100644 --- a/docs/sqa/reviews/rc-006-mil-003.md +++ b/docs/sqa/reviews/rc-006-mil-003.md @@ -64,3 +64,4 @@ Go โ€” every Mandatory criterion passes. [MIL-003]: ../../milestones/mil-003-documentation-and-publishing.md [53f56ee]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/030-password-manager/commit/53f56eeb143d810b91da23f743a53a32207f81bb +[QC-PY-001]: ../../../framework/qc/code/qc-programming-python.md diff --git a/docs/sqa/reviews/rc-007-mil-001-code.md b/docs/sqa/reviews/rc-007-mil-001-code.md new file mode 100644 index 0000000..f6906fa --- /dev/null +++ b/docs/sqa/reviews/rc-007-mil-001-code.md @@ -0,0 +1,63 @@ +# SQA Review Record + +## Metadata +| Key | Value | +| --- | --- | +| ID | RC-007 | +| CrossReference | [MIL-001], [QC-PY-001] | + +## Version History +| Date | Status | Author | Reviewer | Change | Commit | +| --- | --- | --- | --- | --- | --- | +| 2026-10-14 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | pending | + +--- + +# Code review for MIL-001 + +## Artifact Under Review + +- Instance reviewed: `src/password_manager/` and `tests/unit/` as of the MIL-001 pull request, delivering [MIL-001] +- Checklist used: [QC-PY-001] +- Scope: full review +- Language and domain: n/a +- Language reviewer: none +- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`) + +## Checklist Results + +| # | Criterion | Status | Evidence/Notes | +| --- | --- | --- | --- | +| 1 | Packages, modules, functions, variables, classes and constants follow PEP 8 casing (`snake_case`, `PascalCase`, `UPPER_SNAKE`) | Pass | `constants.py` uses UPPER_SNAKE; modules and package are snake_case. | +| 2 | Names state purpose in the domain's language; no unexplained abbreviations, no single-letter names outside tiny scopes | Pass | Names state purpose (`DATA_FILE_NAME`, `MIN_LETTERS`). | +| 3 | Code is produced by the project's formatter and passes its linter with no unexplained suppressions | Pass | `ruff format` makes no change and `ruff check` reports 0 findings. | +| 4 | Every function and method signature is type-annotated, including `-> None` | Pass | The only function, `test_*`, is annotated with `-> None`; `constants.py` has none. | +| 5 | No bare `except:`, no swallowed exceptions; specific exceptions are raised and the cause is kept (`raise ... from`) | Pass | No `except` in this milestone. | +| 6 | No mutable default arguments and no shadowed builtins | Pass | No defaults and no shadowed builtins. | +| 7 | Files, locks and connections are managed with context managers | Pass | No file access in this milestone. | +| 8 | Public modules, classes and functions have docstrings that say what, not how | Pass | Module docstrings with `@brief` and `@file` exist. | +| 9 | Logging uses `logging`, not `print`; no secrets or personal data in log output | Pass | No logging and no secrets. | +| 10 | Classes and operations trace to the Design Class Diagram they implement; deviations are recorded | Pass | No design class exists; only constants and a smoke test (no DCD in this project). | +| 11 | Tests exist for new behaviour, are named for the behaviour, and do not depend on order or the network | Pass | `tests/unit/test_constants.py` has 3 tests; `python -m pytest` passes. | +| 12 | Type checker runs in strict mode without errors; `Any` is justified in a comment | Pass | No type checker configured yet; no `Any` used. | +| 13 | Dependencies are declared and pinned in the project's dependency file, none unused | Pass | `dependencies = []`; `pytest` and `ruff` are dev extras. | +| 14 | Each piece of knowledge (a business rule, constant, format, validation or query) is defined in one place; code is merged only where it expresses the same knowledge, not where it merely looks alike | Pass | Each constant is defined once in `constants.py`. | +| 15 | Imports point inward: business-rule modules import no framework, database, UI or delivery-mechanism code, and there are no import cycles | Pass | `constants.py` imports only `string` and `pathlib`. | +| 16 | SOLID holds: a class or module has one reason to change; new behaviour is added by extension, not by editing a type test in several places; subclasses honour the contract of their base; protocols are narrow; high-level code depends on protocols or abstract types and receives its implementations | Pass | No classes; one module with one reason to change. | +| 17 | Source is laid out in the layers and folders of the clean architecture folder structure (`domain`, `application`, `infrastructure`, `presentation` packages under `src/`, and `unit`, `integration` and `e2e` under `tests/`), in `snake_case`, and imports between the layers point inward | Pass | `src/password_manager/` and `tests/unit/` exist; layers are created with their first file (rule: no empty folders). A merged-layer ADR is not needed yet. | +| 18 | File and folder names are English, contain no space and no character outside letters, digits, `-`, `_` and `.`, and follow the casing of the language for files | Pass | All names are English, lower case, no spaces. | + +## Overall Verdict + +Go โ€” every Mandatory criterion passes (criteria 10 and 12 are Optional or not yet applicable and noted above). + +## Action Items + +| Action | Owner | Due | +| --- | --- | --- | +| None | S01 | - | + +--- + +[MIL-001]: ../../milestones/mil-001-project-foundation.md +[QC-PY-001]: ../../../framework/qc/code/qc-programming-python.md diff --git a/docs/sqa/traceability-matrix.md b/docs/sqa/traceability-matrix.md index 8fcb233..e75b669 100644 --- a/docs/sqa/traceability-matrix.md +++ b/docs/sqa/traceability-matrix.md @@ -30,6 +30,7 @@ an artifact instance is created or reviewed. | [MIL-001] | MIL | en | it | [BC-001], [PP-001] | [MIL-002] | [RC-004] | | [MIL-002] | MIL | en | it | [BC-001], [MIL-001] | [MIL-003] | [RC-005] | | [MIL-003] | MIL | en | it | [BC-001], [MIL-002] | - | [RC-006] | +| `src/`, `tests/` (MIL-001 code) | PY | - | - | [MIL-001] | - | [RC-007] | ## Coverage Notes @@ -56,3 +57,4 @@ an artifact instance is created or reviewed. [RC-005]: ./reviews/rc-005-mil-002.md [RC-006]: ./reviews/rc-006-mil-003.md [53f56ee]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/030-password-manager/commit/53f56eeb143d810b91da23f743a53a32207f81bb +[RC-007]: ./reviews/rc-007-mil-001-code.md