# tri-p/covid-contact-tracing-app architecture

> Architecture diagram of the GitHub repository tri-p/covid-contact-tracing-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tri-p/covid-contact-tracing-app
- Repository: https://github.com/tri-p/covid-contact-tracing-app

## Overview

#### Purpose and Entry Point
This is a local desktop COVID contact-tracing data-entry application. Users enter personal and COVID-related details, persist them to CSV, and search stored records by surname.

- Startup module: `main_app.py`
- Primary application/UI implementation: `application_ui.py`

#### Runtime Model
The application runs as a Python process with a Tkinter GUI event loop. `main_app.py` initializes the application and starts the interactive window; user actions are handled through GUI callbacks implemented in `application_ui.py`.

There is no server, browser client, database service, or network integration indicated.

#### UI/Application Controller
`application_ui.py` is the architectural center: it contains the form layout, form state, command buttons, dialog/window behavior, and application logic. Its object-oriented design likely groups related UI and action behavior so changes can be made centrally.

- `application_ui.py`
- `main_app.py`

#### Data Capture and Submission Flow
1. A user fills in personal-information fields and COVID-related questions in the primary Tkinter form.
2. The Submit action collects the current form values.
3. Submitted values are appended to the local CSV data store.
4. Clear resets the form fields for the next entry.

The persistence boundary is filesystem-based CSV rather than a database.

- `application_ui.py`
- `details.csv`

#### Search Flow
1. The Search action opens a secondary search interface/window.
2. The user supplies a last name.
3. Application logic reads `details.csv` and matches records by surname.
4. Matching details are displayed; an unsuccessful lookup presents “No result found.”

Search is constrained to surname input, and CSV column ordering/schema must remain compatible with the UI’s read/write logic.

- `application_ui.py`
- `details.csv`

#### Storage Contract
`details.csv` is the sole durable record store and is both written during submission and read during searches. It is an important boundary: manually edited data must remain comma-separated and match the expected application columns.

- `details.csv`
- `application_ui.py`

#### User-Controlled Lifecycle
The primary command surface consists of Clear, Submit, Search, and Exit. Exit terminates the GUI/application process; the Tkinter event loop and process bootstrap reside across:

- `main_app.py`
- `application_ui.py`

Main entry points: [`application_ui.py`](https://github.com/tri-p/covid-contact-tracing-app/blob/main/application_ui.py) (Primary entry form), [`main_app.py`](https://github.com/tri-p/covid-contact-tracing-app/blob/main/main_app.py) (Application bootstrap), [`details.csv`](https://github.com/tri-p/covid-contact-tracing-app/blob/main/details.csv) (Contact records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Desktop runtime"]
  node_main["Application bootstrap<br/>Python entry point<br/>[main_app.py]"]
  node_event_loop["Tkinter event loop<br/>GUI runtime"]
end

subgraph group_ui["Tkinter application"]
  node_controller["Application controller<br/>UI/application logic<br/>[application_ui.py]"]
  node_entry_form["Primary entry form<br/>Tkinter form<br/>[application_ui.py]"]
  node_submit["Submit action<br/>GUI callback<br/>[application_ui.py]"]
  node_clear["Clear action<br/>GUI callback<br/>[application_ui.py]"]
  node_search_window["Search window<br/>Secondary Tkinter UI<br/>[application_ui.py]"]
  node_search_lookup["Surname lookup<br/>Search logic<br/>[application_ui.py]"]
  node_exit["Exit action<br/>GUI callback<br/>[application_ui.py]"]
end

subgraph group_storage["Local storage"]
  node_details_csv[("Contact records<br/>CSV data store<br/>[details.csv]")]
end

node_user(("Data-entry user<br/>actor"))

node_main -->|"initializes"| node_controller
node_main -->|"starts"| node_event_loop
node_event_loop -->|"dispatches events to"| node_controller
node_user -->|"fills in"| node_entry_form
node_controller -->|"renders and manages"| node_entry_form
node_entry_form -->|"Submit"| node_submit
node_submit -->|"appends record"| node_details_csv
node_entry_form -->|"Clear"| node_clear
node_clear -->|"resets fields"| node_entry_form
node_entry_form -->|"Search"| node_search_window
node_user -->|"supplies surname"| node_search_window
node_search_window -->|"submits query"| node_search_lookup
node_search_lookup -->|"reads records"| node_details_csv
node_search_lookup -->|"shows matches or no result"| node_search_window
node_entry_form -->|"Exit"| node_exit
node_exit -->|"stops"| node_event_loop

click node_main "https://github.com/tri-p/covid-contact-tracing-app/blob/main/main_app.py"
click node_controller "https://github.com/tri-p/covid-contact-tracing-app/blob/main/application_ui.py"
click node_entry_form "https://github.com/tri-p/covid-contact-tracing-app/blob/main/application_ui.py"
click node_submit "https://github.com/tri-p/covid-contact-tracing-app/blob/main/application_ui.py"
click node_clear "https://github.com/tri-p/covid-contact-tracing-app/blob/main/application_ui.py"
click node_search_window "https://github.com/tri-p/covid-contact-tracing-app/blob/main/application_ui.py"
click node_search_lookup "https://github.com/tri-p/covid-contact-tracing-app/blob/main/application_ui.py"
click node_exit "https://github.com/tri-p/covid-contact-tracing-app/blob/main/application_ui.py"
click node_details_csv "https://github.com/tri-p/covid-contact-tracing-app/blob/main/details.csv"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_event_loop toneBlue
class node_controller,node_entry_form,node_submit,node_clear,node_search_window,node_search_lookup,node_exit toneAmber
class node_details_csv toneMint
class node_user toneNeutral
```

## Components

### Desktop runtime

- [Application bootstrap](https://github.com/tri-p/covid-contact-tracing-app/blob/main/main_app.py): Python entry point · Initializes the application and starts the GUI. · `main_app.py`
- **Tkinter event loop**: GUI runtime · Dispatches interactive window events.

### Tkinter application

- [Application controller](https://github.com/tri-p/covid-contact-tracing-app/blob/main/application_ui.py): UI/application logic · Centralizes form layout, dialogs, and command behavior. · `application_ui.py`
- [Primary entry form](https://github.com/tri-p/covid-contact-tracing-app/blob/main/application_ui.py): Tkinter form · Captures personal and COVID-related details. · `application_ui.py`
- [Submit action](https://github.com/tri-p/covid-contact-tracing-app/blob/main/application_ui.py): GUI callback · Collects current form values for persistence. · `application_ui.py`
- [Clear action](https://github.com/tri-p/covid-contact-tracing-app/blob/main/application_ui.py): GUI callback · Resets fields for the next entry. · `application_ui.py`
- [Search window](https://github.com/tri-p/covid-contact-tracing-app/blob/main/application_ui.py): Secondary Tkinter UI · Accepts a surname lookup. · `application_ui.py`
- [Surname lookup](https://github.com/tri-p/covid-contact-tracing-app/blob/main/application_ui.py): Search logic · Matches CSV records and displays results or no-result feedback. · `application_ui.py`
- [Exit action](https://github.com/tri-p/covid-contact-tracing-app/blob/main/application_ui.py): GUI callback · Terminates the GUI process. · `application_ui.py`

### Local storage

- [Contact records](https://github.com/tri-p/covid-contact-tracing-app/blob/main/details.csv): CSV data store · Shared durable store; column order must match UI read/write logic. · `details.csv`

### Other components

- **Data-entry user**: actor · Enters records and searches by surname.

## Connections

- Application bootstrap → Application controller: initializes
- Application bootstrap → Tkinter event loop: starts
- Tkinter event loop → Application controller: dispatches events to
- Data-entry user → Primary entry form: fills in
- Application controller → Primary entry form: renders and manages
- Primary entry form → Submit action: Submit
- Submit action → Contact records: appends record
- Primary entry form → Clear action: Clear
- Clear action → Primary entry form: resets fields
- Primary entry form → Search window: Search
- Data-entry user → Search window: supplies surname
- Search window → Surname lookup: submits query
- Surname lookup → Contact records: reads records
- Surname lookup → Search window: shows matches or no result
- Primary entry form → Exit action: Exit
- Exit action → Tkinter event loop: stops
