# bakhtiyarovdj/mypassportuz architecture

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

- Interactive diagram: https://gitdiagram.com/bakhtiyarovdj/mypassportuz
- Repository: https://github.com/bakhtiyarovdj/mypassportuz

## Overview

MyPassportUZ is a Windows Forms passport and citizen-record management application with user authentication and role-aware account administration. The visible startup flow opens authentication; successful login stores the user ID and opens the main application. Profile and account-creation forms call the shared SQL data layer, which persists citizen and user records in the attached LocalDB database. The main form is a substantial but unsampled part of the application, so its internal workflows are not expanded here. Image handling and spreadsheet export are visible utility capabilities, but their callers are not established by the excerpts.

Main entry points: [`Classes/Base.cs`](https://github.com/bakhtiyarovdj/mypassportuz/blob/develop/Classes/Base.cs) (SQL data access), [`Auth.cs`](https://github.com/bakhtiyarovdj/mypassportuz/blob/develop/Auth.cs) (Sign-in), [`Profile.cs`](https://github.com/bakhtiyarovdj/mypassportuz/blob/develop/Profile.cs) (User profile), [`NewUser.cs`](https://github.com/bakhtiyarovdj/mypassportuz/blob/develop/NewUser.cs) (Add user)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_program["Application startup<br/>[Program.cs]"]
  node_main["Main workspace<br/>[Main.cs]"]
end

subgraph group_accounts["Authentication and accounts"]
  node_auth["Sign-in<br/>[Auth.cs]"]
  node_profile["User profile<br/>[Profile.cs]"]
  node_newuser["Add user<br/>[NewUser.cs]"]
  node_storage["Session user ID<br/>[Storage.cs]"]
  node_user["User model<br/>[User.cs]"]
end

subgraph group_citizens["Citizen records"]
  node_citizen["Citizen model<br/>[Citizen.cs]"]
end

subgraph group_data["Persistence and utilities"]
  node_base["SQL data access<br/>[Base.cs]"]
  node_database[("LocalDB database<br/>[Base.mdf]")]
  node_tools["Image and Excel tools<br/>[Tools.cs]"]
end

node_operator(("Staff user"))

node_operator -->|"starts application"| node_program
node_program -->|"opens sign-in"| node_auth
node_operator -->|"submits credentials"| node_auth
node_auth -->|"checks credentials"| node_base
node_auth -->|"stores user ID"| node_storage
node_auth -->|"opens workspace"| node_main
node_profile -->|"reads session ID"| node_storage
node_profile -->|"loads and updates users"| node_base
node_profile -->|"opens user form"| node_newuser
node_newuser -->|"adds user"| node_base
node_newuser -->|"refreshes user list"| node_profile
node_base -->|"reads and writes"| node_database
node_base -->|"maps citizen records"| node_citizen
node_base -->|"maps user records"| node_user

click node_program "https://github.com/bakhtiyarovdj/mypassportuz/blob/develop/Program.cs"
click node_auth "https://github.com/bakhtiyarovdj/mypassportuz/blob/develop/Auth.cs"
click node_main "https://github.com/bakhtiyarovdj/mypassportuz/blob/develop/Main.cs"
click node_profile "https://github.com/bakhtiyarovdj/mypassportuz/blob/develop/Profile.cs"
click node_newuser "https://github.com/bakhtiyarovdj/mypassportuz/blob/develop/NewUser.cs"
click node_storage "https://github.com/bakhtiyarovdj/mypassportuz/blob/develop/Classes/Storage.cs"
click node_citizen "https://github.com/bakhtiyarovdj/mypassportuz/blob/develop/Classes/Citizen.cs"
click node_user "https://github.com/bakhtiyarovdj/mypassportuz/blob/develop/Classes/User.cs"
click node_base "https://github.com/bakhtiyarovdj/mypassportuz/blob/develop/Classes/Base.cs"
click node_database "https://github.com/bakhtiyarovdj/mypassportuz/blob/develop/Base.mdf"
click node_tools "https://github.com/bakhtiyarovdj/mypassportuz/blob/develop/Classes/Tools.cs"

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_program,node_main,node_operator toneBlue
class node_auth,node_profile,node_newuser,node_storage,node_user toneAmber
class node_citizen toneMint
class node_base,node_database,node_tools toneRose
```

## Components

### Application entry

- [Application startup](https://github.com/bakhtiyarovdj/mypassportuz/blob/develop/Program.cs): `Program.cs`
- [Main workspace](https://github.com/bakhtiyarovdj/mypassportuz/blob/develop/Main.cs): `Main.cs`

### Authentication and accounts

- [Sign-in](https://github.com/bakhtiyarovdj/mypassportuz/blob/develop/Auth.cs): `Auth.cs`
- [User profile](https://github.com/bakhtiyarovdj/mypassportuz/blob/develop/Profile.cs): `Profile.cs`
- [Add user](https://github.com/bakhtiyarovdj/mypassportuz/blob/develop/NewUser.cs): `NewUser.cs`
- [Session user ID](https://github.com/bakhtiyarovdj/mypassportuz/blob/develop/Classes/Storage.cs): `Classes/Storage.cs`
- [User model](https://github.com/bakhtiyarovdj/mypassportuz/blob/develop/Classes/User.cs): `Classes/User.cs`

### Citizen records

- [Citizen model](https://github.com/bakhtiyarovdj/mypassportuz/blob/develop/Classes/Citizen.cs): `Classes/Citizen.cs`

### Persistence and utilities

- [SQL data access](https://github.com/bakhtiyarovdj/mypassportuz/blob/develop/Classes/Base.cs): `Classes/Base.cs`
- [LocalDB database](https://github.com/bakhtiyarovdj/mypassportuz/blob/develop/Base.mdf): `Base.mdf`
- [Image and Excel tools](https://github.com/bakhtiyarovdj/mypassportuz/blob/develop/Classes/Tools.cs): `Classes/Tools.cs`

### Other components

- **Staff user**

## Connections

- Staff user → Application startup: starts application (evidence: `Program.cs`)
- Application startup → Sign-in: opens sign-in (evidence: `Program.cs`)
- Staff user → Sign-in: submits credentials (evidence: `Auth.cs`)
- Sign-in → SQL data access: checks credentials (evidence: `Auth.cs`)
- Sign-in → Session user ID: stores user ID (evidence: `Auth.cs`)
- Sign-in → Main workspace: opens workspace (evidence: `Auth.cs`)
- User profile → Session user ID: reads session ID (evidence: `Profile.cs`)
- User profile → SQL data access: loads and updates users (evidence: `Profile.cs`)
- User profile → Add user: opens user form (evidence: `Profile.cs`)
- Add user → SQL data access: adds user (evidence: `NewUser.cs`)
- Add user → User profile: refreshes user list (evidence: `NewUser.cs`)
- SQL data access → LocalDB database: reads and writes (evidence: `Classes/Base.cs`)
- SQL data access → Citizen model: maps citizen records (evidence: `Classes/Base.cs`)
- SQL data access → User model: maps user records (evidence: `Classes/Base.cs`)
