diff --git a/docs/wiki/Development.md b/docs/wiki/Development.md new file mode 100644 index 0000000..9973871 --- /dev/null +++ b/docs/wiki/Development.md @@ -0,0 +1,47 @@ +**English** · [Dansk](Development-da) · [Bahasa Malaysia](Development-ms) + +# Development + +## Layout + +| Folder | Holds | +| --- | --- | +| `src/password_manager/domain` | Entry, password generator and errors; no input or output | +| `src/password_manager/application` | Use cases and the repository port | +| `src/password_manager/infrastructure` | The JSON repository | +| `src/password_manager/presentation` | The MVVM view and view model | +| `src/password_manager/constants.py` | Every constant and message | +| `tests/` | `unit`, `integration` and `e2e` tests | +| `tools/` | `capture_screenshots.py` | + +Imports point inward; only `main.py` connects the layers. + +## Tests and lint + +```bash +python -m pytest +python -m ruff format src tests tools +python -m ruff check src tests tools +``` + +## Source documentation + +Comments are Doxygen style. Build the HTML with `doxygen Doxyfile`; it opens at +`docs/doxygen/html/index.html`. + +## Screenshots + +On Windows, with the virtual environment active: + +```bash +python tools/capture_screenshots.py +``` + +The images are written to `docs/images/` from the real window and a temporary +data file. + +## Project documents + +The project follows a planning-first workflow: Business Case, Stakeholder +Analysis, Project Plan and milestones are in `docs/`. Work is done on one branch +and one pull request per milestone. diff --git a/docs/wiki/Home.md b/docs/wiki/Home.md new file mode 100644 index 0000000..2a0272f --- /dev/null +++ b/docs/wiki/Home.md @@ -0,0 +1,27 @@ +**English** · [Dansk](Home-da) · [Bahasa Malaysia](Home-ms) + +# Password Manager + +A small Tkinter password manager from day 30 of Udemy's "100 Days of Code: The +Complete Python Pro Bootcamp". It generates passwords, saves them in a JSON +file and searches them by website. + +![The main window](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/030-password-manager/raw/branch/main/docs/images/main-window.png) + +## What it does + +- **Generate** a random password and copy it to the clipboard. +- **Add** a website, an e-mail address and a password to `data.json`. +- **Search** a website and see the saved e-mail address and password. +- Keeps running when `data.json` is missing, empty or damaged. + +> **Security note.** The passwords are stored as plain JSON and are not +> encrypted. This is a learning project; do not use it for real passwords. + +## Pages + +- [Installation](Installation) +- [Usage](Usage) +- [Development](Development) + +Source code and issues: [repository](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/030-password-manager). diff --git a/docs/wiki/Installation.md b/docs/wiki/Installation.md new file mode 100644 index 0000000..811ccb5 --- /dev/null +++ b/docs/wiki/Installation.md @@ -0,0 +1,38 @@ +**English** · [Dansk](Installation-da) · [Bahasa Malaysia](Installation-ms) + +# Installation + +## Requirements + +- Python 3.13 or newer with Tkinter. On Debian or Ubuntu install `python3-tk`. +- `venv` and `pip`, both part of Python. +- No runtime dependencies. + +## Create a local virtual environment + +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]" +``` + +The `[dev]` extra installs pytest and ruff. Leave it out +(`python -m pip install -e .`) if you only want to run the program. + +## Check the installation + +```bash +python -m pytest +``` diff --git a/docs/wiki/Usage.md b/docs/wiki/Usage.md new file mode 100644 index 0000000..7714f84 --- /dev/null +++ b/docs/wiki/Usage.md @@ -0,0 +1,50 @@ +**English** · [Dansk](Usage-da) · [Bahasa Malaysia](Usage-ms) + +# Usage + +Start the program with the virtual environment active: + +```bash +python -m password_manager +``` + +The program keeps its data in `data.json` in the folder you start it from. + +## Generate and add a password + +1. Type the website. +2. Press **Generate Password**. A password is filled in and copied to the + clipboard. +3. Check the e-mail address and press **Add**. Confirm the dialog and the entry + is saved. + +![The main window after Generate Password](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/030-password-manager/raw/branch/main/docs/images/main-window.png) + +![The confirmation before an entry is saved](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/030-password-manager/raw/branch/main/docs/images/add-confirmation.png) + +Leaving a field empty shows a warning and saves nothing. + +## Search + +Type a website and press **Search**. The saved e-mail address and password are +shown. + +![Search finds a saved website](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/030-password-manager/raw/branch/main/docs/images/search-found.png) + +If nothing is saved for the website, or no data file exists yet, a message says +so. + +![Search for an unknown website](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/030-password-manager/raw/branch/main/docs/images/search-not-found.png) + +## The data file + +`data.json` holds one record per website: + +```json +{ + "example.com": { + "email": "jens@example.com", + "password": "Sample#Pass123" + } +} +``` diff --git a/docs/wiki/_Footer.md b/docs/wiki/_Footer.md new file mode 100644 index 0000000..2acec83 --- /dev/null +++ b/docs/wiki/_Footer.md @@ -0,0 +1 @@ +Password Manager · day 30 of 100 Days of Code · [Repository](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/030-password-manager) diff --git a/docs/wiki/_Sidebar.md b/docs/wiki/_Sidebar.md new file mode 100644 index 0000000..32d6ecd --- /dev/null +++ b/docs/wiki/_Sidebar.md @@ -0,0 +1,23 @@ +**Password Manager** + +**English** + +- [Home](Home) +- [Installation](Installation) +- [Usage](Usage) +- [Development](Development) + +**Dansk** + +- [Hjem](Home-da) +- [Installation](Installation-da) +- [Brug](Usage-da) +- [Udvikling](Development-da) + +**Bahasa Malaysia** + +- [Laman Utama](Home-ms) +- [Pemasangan](Installation-ms) +- [Penggunaan](Usage-ms) +- [Pembangunan](Development-ms) +