# twins2902/crud architecture

> Architecture diagram of the GitHub repository twins2902/crud, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/twins2902/crud
- Repository: https://github.com/twins2902/crud

## Overview

This is a small interactive anime-catalog CRUD program that stores records in a text file. The user selects an operation from the menu: add, print, update, or delete. Printing supports query and table-style views, and record lookup supports title matching. The excerpts show the main loop dispatching operations and some writes to the file; they do not show the complete read, query, or delete implementations, so those internal links are omitted where unverified.

Main entry points: [`fp_2782.py`](https://github.com/twins2902/crud/blob/main/fp_2782.py) (Main Loop)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Menu Control"]
  node_main["Main Loop<br/>[fp_2782.py]"]
  node_menu["Menu Prompt<br/>[fp_2782.py]"]
end

subgraph group_catalog["Catalog Operations"]
  node_add["Add Records<br/>[fp_2782.py]"]
  node_print["Print Records<br/>[fp_2782.py]"]
  node_query["Query View<br/>[fp_2782.py]"]
  node_table["Table View<br/>[fp_2782.py]"]
  node_search["Title Search<br/>[fp_2782.py]"]
  node_update["Update Records<br/>[fp_2782.py]"]
  node_delete["Delete Records<br/>[fp_2782.py]"]
end

subgraph group_storage["File Storage"]
  node_reader["Record Reader<br/>[fp_2782.py]"]
  node_datafile[("Catalog Text File")]
end

node_user(("User"))

node_user -->|"starts"| node_main
node_main -->|"checks data"| node_reader
node_main -->|"prompts"| node_menu
node_main -->|"dispatches"| node_add
node_main -->|"dispatches"| node_print
node_main -->|"dispatches"| node_update
node_main -->|"dispatches"| node_delete
node_main -->|"initializes"| node_datafile
node_add -->|"writes records"| node_datafile
node_update -->|"loads records"| node_reader
node_update -->|"finds title"| node_search
node_update -->|"writes records"| node_datafile
node_delete -->|"loads records"| node_reader
node_print -->|"selects view"| node_query
node_print -->|"renders view"| node_table

click node_main "https://github.com/twins2902/crud/blob/main/fp_2782.py"
click node_menu "https://github.com/twins2902/crud/blob/main/fp_2782.py"
click node_add "https://github.com/twins2902/crud/blob/main/fp_2782.py"
click node_print "https://github.com/twins2902/crud/blob/main/fp_2782.py"
click node_query "https://github.com/twins2902/crud/blob/main/fp_2782.py"
click node_table "https://github.com/twins2902/crud/blob/main/fp_2782.py"
click node_search "https://github.com/twins2902/crud/blob/main/fp_2782.py"
click node_update "https://github.com/twins2902/crud/blob/main/fp_2782.py"
click node_delete "https://github.com/twins2902/crud/blob/main/fp_2782.py"
click node_reader "https://github.com/twins2902/crud/blob/main/fp_2782.py"

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_menu,node_user toneBlue
class node_add,node_print,node_query,node_table,node_search,node_update,node_delete toneAmber
class node_reader,node_datafile toneMint
```

## Components

### Menu Control

- [Main Loop](https://github.com/twins2902/crud/blob/main/fp_2782.py): `fp_2782.py`
- [Menu Prompt](https://github.com/twins2902/crud/blob/main/fp_2782.py): `fp_2782.py`

### Catalog Operations

- [Add Records](https://github.com/twins2902/crud/blob/main/fp_2782.py): `fp_2782.py`
- [Print Records](https://github.com/twins2902/crud/blob/main/fp_2782.py): `fp_2782.py`
- [Query View](https://github.com/twins2902/crud/blob/main/fp_2782.py): `fp_2782.py`
- [Table View](https://github.com/twins2902/crud/blob/main/fp_2782.py): `fp_2782.py`
- [Title Search](https://github.com/twins2902/crud/blob/main/fp_2782.py): `fp_2782.py`
- [Update Records](https://github.com/twins2902/crud/blob/main/fp_2782.py): `fp_2782.py`
- [Delete Records](https://github.com/twins2902/crud/blob/main/fp_2782.py): `fp_2782.py`

### File Storage

- [Record Reader](https://github.com/twins2902/crud/blob/main/fp_2782.py): `fp_2782.py`
- **Catalog Text File**

### Other components

- **User**

## Connections

- User → Main Loop: starts (evidence: `fp_2782.py`)
- Main Loop → Record Reader: checks data (evidence: `fp_2782.py`)
- Main Loop → Menu Prompt: prompts (evidence: `fp_2782.py`)
- Main Loop → Add Records: dispatches (evidence: `fp_2782.py`)
- Main Loop → Print Records: dispatches (evidence: `fp_2782.py`)
- Main Loop → Update Records: dispatches (evidence: `fp_2782.py`)
- Main Loop → Delete Records: dispatches (evidence: `fp_2782.py`)
- Main Loop → Catalog Text File: initializes (evidence: `fp_2782.py`)
- Add Records → Catalog Text File: writes records (evidence: `fp_2782.py`)
- Update Records → Record Reader: loads records (evidence: `fp_2782.py`)
- Update Records → Title Search: finds title (evidence: `fp_2782.py`)
- Update Records → Catalog Text File: writes records (evidence: `fp_2782.py`)
- Delete Records → Record Reader: loads records (evidence: `fp_2782.py`)
- Print Records → Query View: selects view (evidence: `fp_2782.py`)
- Print Records → Table View: renders view (evidence: `fp_2782.py`)
