# skakke/todolist_uke4 architecture

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

- Interactive diagram: https://gitdiagram.com/skakke/todolist_uke4
- Repository: https://github.com/skakke/todolist_uke4

## Overview

This is a PyQt desktop to-do list with SQLite-backed accounts and shared tasks. The main workflow is login, load a user’s owned and shared tasks, then add, share, or delete tasks. The README also documents initial table creation and account provisioning. The UI files and database schema are visible in the tree, but their full contents were not sampled, so the graph omits details beyond documented behavior and observed calls.

Main entry points: [`src/database.py`](https://github.com/skakke/todolist_uke4/blob/main/src/database.py) (Database operations), [`src/main_window.py`](https://github.com/skakke/todolist_uke4/blob/main/src/main_window.py) (Task window), [`src/login_window.py`](https://github.com/skakke/todolist_uke4/blob/main/src/login_window.py) (Login window), [`src/app.py`](https://github.com/skakke/todolist_uke4/blob/main/src/app.py) (App controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application flow"]
  node_entry["Application entry<br/>[main.py]"]
  node_app_controller["App controller<br/>[app.py]"]
  node_login["Login window<br/>[login_window.py]"]
  node_login_ui["Login UI<br/>[login_window.ui]"]
end

subgraph group_tasks["Task management"]
  node_main_window["Task window<br/>[main_window.py]"]
  node_main_ui["Task UI<br/>[main_window.ui]"]
  node_task_model["Task model<br/>[gjoremaal.py]"]
end

subgraph group_accounts["Accounts and setup"]
  node_user_model["User model<br/>[bruker.py]"]
  node_schema_setup["Schema setup<br/>[lagetabeller.py]"]
  node_user_setup["Account provisioning"]
end

subgraph group_storage["Persistent storage"]
  node_db_api["Database operations<br/>[database.py]"]
  node_sqlite[("SQLite database<br/>[todolist.db]")]
end

node_user(("User"))

node_user -->|"enters credentials"| node_login
node_entry -->|"starts"| node_app_controller
node_app_controller -->|"creates and shows"| node_login
node_login -->|"loads"| node_login_ui
node_login -->|"checks credentials"| node_db_api
node_db_api -->|"queries accounts"| node_sqlite
node_db_api -->|"constructs user"| node_user_model
node_login -->|"signals success"| node_app_controller
node_app_controller -->|"creates after login"| node_main_window
node_main_window -->|"loads"| node_main_ui
node_main_window -->|"loads, adds, shares, deletes tasks"| node_db_api
node_main_window -->|"queries user list"| node_db_api
node_db_api -->|"reads and writes tasks"| node_sqlite
node_db_api -->|"constructs loaded tasks"| node_task_model
node_main_window -->|"creates task objects"| node_task_model
node_schema_setup -->|"calls table creation"| node_db_api
node_db_api -->|"creates tables"| node_sqlite
node_user_setup -->|"inserts hashed accounts"| node_sqlite

click node_entry "https://github.com/skakke/todolist_uke4/blob/main/src/main.py"
click node_app_controller "https://github.com/skakke/todolist_uke4/blob/main/src/app.py"
click node_login "https://github.com/skakke/todolist_uke4/blob/main/src/login_window.py"
click node_login_ui "https://github.com/skakke/todolist_uke4/blob/main/src/login_window.ui"
click node_main_window "https://github.com/skakke/todolist_uke4/blob/main/src/main_window.py"
click node_main_ui "https://github.com/skakke/todolist_uke4/blob/main/src/main_window.ui"
click node_task_model "https://github.com/skakke/todolist_uke4/blob/main/src/gjoremaal.py"
click node_db_api "https://github.com/skakke/todolist_uke4/blob/main/src/database.py"
click node_sqlite "https://github.com/skakke/todolist_uke4/blob/main/todolist.db"
click node_user_model "https://github.com/skakke/todolist_uke4/blob/main/src/bruker.py"
click node_schema_setup "https://github.com/skakke/todolist_uke4/blob/main/src/lagetabeller.py"
click node_user_setup "https://github.com/skakke/todolist_uke4/blob/main/src/opprette_brukere.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_entry,node_app_controller,node_login,node_login_ui,node_user toneBlue
class node_main_window,node_main_ui,node_task_model toneAmber
class node_user_model,node_schema_setup,node_user_setup toneMint
class node_db_api,node_sqlite toneRose
```

## Components

### Application flow

- [Application entry](https://github.com/skakke/todolist_uke4/blob/main/src/main.py): `src/main.py`
- [App controller](https://github.com/skakke/todolist_uke4/blob/main/src/app.py): `src/app.py`
- [Login window](https://github.com/skakke/todolist_uke4/blob/main/src/login_window.py): `src/login_window.py`
- [Login UI](https://github.com/skakke/todolist_uke4/blob/main/src/login_window.ui): `src/login_window.ui`

### Task management

- [Task window](https://github.com/skakke/todolist_uke4/blob/main/src/main_window.py): `src/main_window.py`
- [Task UI](https://github.com/skakke/todolist_uke4/blob/main/src/main_window.ui): `src/main_window.ui`
- [Task model](https://github.com/skakke/todolist_uke4/blob/main/src/gjoremaal.py): `src/gjoremaal.py`

### Accounts and setup

- [User model](https://github.com/skakke/todolist_uke4/blob/main/src/bruker.py): `src/bruker.py`
- [Schema setup](https://github.com/skakke/todolist_uke4/blob/main/src/lagetabeller.py): `src/lagetabeller.py`
- [Account provisioning](https://github.com/skakke/todolist_uke4/blob/main/src/opprette_brukere.py): `src/opprette_brukere.py`

### Persistent storage

- [Database operations](https://github.com/skakke/todolist_uke4/blob/main/src/database.py): `src/database.py`
- [SQLite database](https://github.com/skakke/todolist_uke4/blob/main/todolist.db): `todolist.db`

### Other components

- **User**

## Connections

- User → Login window: enters credentials
- Application entry → App controller: starts
- App controller → Login window: creates and shows
- Login window → Login UI: loads
- Login window → Database operations: checks credentials
- Database operations → SQLite database: queries accounts
- Database operations → User model: constructs user
- Login window → App controller: signals success
- App controller → Task window: creates after login
- Task window → Task UI: loads
- Task window → Database operations: loads, adds, shares, deletes tasks
- Task window → Database operations: queries user list
- Database operations → SQLite database: reads and writes tasks
- Database operations → Task model: constructs loaded tasks
- Task window → Task model: creates task objects
- Schema setup → Database operations: calls table creation
- Database operations → SQLite database: creates tables
- Account provisioning → SQLite database: inserts hashed accounts
