# davo75/custinvoicedb architecture

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

- Interactive diagram: https://gitdiagram.com/davo75/custinvoicedb
- Repository: https://github.com/davo75/custinvoicedb

## Overview

#### Purpose and Runtime
CustInvoiceDB is a C# Windows Forms college assignment for managing customer and invoice records backed by MySQL. It is organized as Visual Studio solutions, with a primary multi-form application and a separate database-oriented variant.

#### Application Entry Points
WinForms startup is defined by `UIAssignment3/Program.cs`, with project metadata/build targeting in `UIAssignment3/UIAssignment3.csproj` and solution orchestration in `UIAssignment3.sln`. The alternate implementation starts at `UI_Assignment_3_With_DB/UIAssignment3_DB/UIAssignment3_DB/Program.cs`.

#### Primary UI Flow
The main application is divided into role-specific forms:
- Authentication: `UIAssignment3/LoginForm.cs`
- Main navigation/shell: `UIAssignment3/MainForm.cs`
- Customer management: `UIAssignment3/CustomerForm.cs`
- Invoice management: `UIAssignment3/InvoiceForm.cs`

Each form has a paired `.Designer.cs` file defining controls and event wiring, creating the boundary between generated WinForms layout and hand-written interaction logic.

#### Data Access Boundary
`UIAssignment3/DataConnect.cs` is the central database connectivity abstraction and likely mediates form operations against MySQL. Runtime connection/configuration values are expected in `UIAssignment3/App.config`; generated application settings live under `UIAssignment3/Properties/Settings.settings`.

The database schema/data setup is represented by `custinvoice.sql`, making MySQL an external deployment prerequisite rather than an embedded datastore.

#### Alternate Database Variant
A second, self-contained Visual Studio solution exists at `UI_Assignment_3_With_DB/UIAssignment3_DB/UIAssignment3_DB/UIAssignment3_DB.sln`. Its UI is consolidated around:
- Startup: `UI_Assignment_3_With_DB/UIAssignment3_DB/UIAssignment3_DB/Program.cs`
- Main form: `UI_Assignment_3_With_DB/UIAssignment3_DB/UIAssignment3_DB/Form1.cs`
- Configuration: `UI_Assignment_3_With_DB/UIAssignment3_DB/UIAssignment3_DB/App.config`

This appears to be a separate or earlier DB-focused implementation, not a shared library consumed by the primary application.

#### Control and Data Flow
User interaction begins at login, transitions into the main navigation form, then opens customer or invoice workflows. Those workflows perform CRUD-style record operations through the data connection layer into MySQL. Form code owns presentation and event handling; `DataConnect.cs` is the important persistence boundary; `custinvoice.sql` defines the database-side contract.

#### Supporting Assets
WinForms resources are compiled from `.resx` files such as `UIAssignment3/CustomerForm.resx` and centralized generated resource definitions under `UIAssignment3/Properties/Resources.resx`. `Report/Assignment 3 UI.docx` is assignment documentation rather than executable architecture.

Main entry points: [`UIAssignment3/MainForm.cs`](https://github.com/davo75/custinvoicedb/blob/master/UIAssignment3/MainForm.cs) (Main navigation), [`UIAssignment3/DataConnect.cs`](https://github.com/davo75/custinvoicedb/blob/master/UIAssignment3/DataConnect.cs) (Data connection), [`UIAssignment3/UIAssignment3.csproj`](https://github.com/davo75/custinvoicedb/blob/master/UIAssignment3/UIAssignment3.csproj) (WinForms project), [`UIAssignment3/LoginForm.cs`](https://github.com/davo75/custinvoicedb/blob/master/UIAssignment3/LoginForm.cs) (Login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_primary["Primary WinForms App"]
  node_primary_solution["Primary solution<br/>Visual Studio solution<br/>[UIAssignment3.sln]"]
  node_primary_project["WinForms project<br/>C&#35; project"]
  node_primary_startup["Application startup<br/>WinForms entry point<br/>[Program.cs]"]
  node_login["Login<br/>authentication form<br/>[LoginForm.cs]"]
  node_main_form["Main navigation<br/>shell form<br/>[MainForm.cs]"]
  node_customer_form["Customer management<br/>CRUD form<br/>[CustomerForm.cs]"]
  node_invoice_form["Invoice management<br/>CRUD form<br/>[InvoiceForm.cs]"]
  node_form_designers["Form designers<br/>generated WinForms layouts"]
  node_data_connect{{"Data connection<br/>persistence boundary<br/>[DataConnect.cs]"}}
  node_app_config["Runtime configuration<br/>application config<br/>[App.config]"]
  node_settings["Generated settings<br/>application settings<br/>[Settings.settings]"]
  node_resources["WinForms resources<br/>resource definitions<br/>[Resources.resx]"]
end

subgraph group_alternate["Alternate DB Variant"]
  node_alternate_solution["Alternate solution<br/>Visual Studio solution"]
  node_alternate_startup["Alternate startup<br/>WinForms entry point<br/>[Program.cs]"]
  node_alternate_form["Alternate main form<br/>consolidated UI form<br/>[Form1.cs]"]
  node_alternate_config["Alternate configuration<br/>application config<br/>[App.config]"]
end

node_mysql[("MySQL database<br/>external datastore")]
node_schema["Database schema and seed data<br/>SQL setup script<br/>[custinvoice.sql]"]

node_primary_solution -->|"orchestrates"| node_primary_project
node_primary_project -->|"builds"| node_primary_startup
node_primary_startup -->|"starts"| node_login
node_login -->|"authenticates into"| node_main_form
node_main_form -->|"opens"| node_customer_form
node_main_form -->|"opens"| node_invoice_form
node_form_designers -.->|"layouts"| node_login
node_form_designers -.->|"layouts"| node_main_form
node_form_designers -.->|"layouts"| node_customer_form
node_form_designers -.->|"layouts"| node_invoice_form
node_customer_form -->|"CRUD operations"| node_data_connect
node_invoice_form -->|"CRUD operations"| node_data_connect
node_data_connect -->|"queries"| node_mysql
node_app_config -.->|"connection values"| node_data_connect
node_settings -.->|"generated into"| node_app_config
node_resources -.->|"compiled by"| node_primary_project
node_schema -->|"provisions"| node_mysql
node_alternate_solution -->|"starts"| node_alternate_startup
node_alternate_startup -->|"launches"| node_alternate_form
node_alternate_config -.->|"configures"| node_alternate_form
node_alternate_form -->|"database operations"| node_mysql

click node_primary_solution "https://github.com/davo75/custinvoicedb/blob/master/UIAssignment3.sln"
click node_primary_project "https://github.com/davo75/custinvoicedb/blob/master/UIAssignment3/UIAssignment3.csproj"
click node_primary_startup "https://github.com/davo75/custinvoicedb/blob/master/UIAssignment3/Program.cs"
click node_login "https://github.com/davo75/custinvoicedb/blob/master/UIAssignment3/LoginForm.cs"
click node_main_form "https://github.com/davo75/custinvoicedb/blob/master/UIAssignment3/MainForm.cs"
click node_customer_form "https://github.com/davo75/custinvoicedb/blob/master/UIAssignment3/CustomerForm.cs"
click node_invoice_form "https://github.com/davo75/custinvoicedb/blob/master/UIAssignment3/InvoiceForm.cs"
click node_data_connect "https://github.com/davo75/custinvoicedb/blob/master/UIAssignment3/DataConnect.cs"
click node_app_config "https://github.com/davo75/custinvoicedb/blob/master/UIAssignment3/App.config"
click node_settings "https://github.com/davo75/custinvoicedb/blob/master/UIAssignment3/Properties/Settings.settings"
click node_resources "https://github.com/davo75/custinvoicedb/blob/master/UIAssignment3/Properties/Resources.resx"
click node_schema "https://github.com/davo75/custinvoicedb/blob/master/custinvoice.sql"
click node_alternate_startup "https://github.com/davo75/custinvoicedb/blob/master/UI_Assignment_3_With_DB/UIAssignment3_DB/UIAssignment3_DB/Program.cs"
click node_alternate_form "https://github.com/davo75/custinvoicedb/blob/master/UI_Assignment_3_With_DB/UIAssignment3_DB/UIAssignment3_DB/Form1.cs"
click node_alternate_config "https://github.com/davo75/custinvoicedb/blob/master/UI_Assignment_3_With_DB/UIAssignment3_DB/UIAssignment3_DB/App.config"

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_primary_solution,node_primary_project,node_primary_startup,node_login,node_main_form,node_customer_form,node_invoice_form,node_form_designers,node_data_connect,node_app_config,node_settings,node_resources toneBlue
class node_alternate_solution,node_alternate_startup,node_alternate_form,node_alternate_config toneAmber
class node_mysql,node_schema toneNeutral
```

## Components

### Primary WinForms App

- [Primary solution](https://github.com/davo75/custinvoicedb/blob/master/UIAssignment3.sln): Visual Studio solution · `UIAssignment3.sln`
- [WinForms project](https://github.com/davo75/custinvoicedb/blob/master/UIAssignment3/UIAssignment3.csproj): C# project · `UIAssignment3/UIAssignment3.csproj`
- [Application startup](https://github.com/davo75/custinvoicedb/blob/master/UIAssignment3/Program.cs): WinForms entry point · `UIAssignment3/Program.cs`
- [Login](https://github.com/davo75/custinvoicedb/blob/master/UIAssignment3/LoginForm.cs): authentication form · `UIAssignment3/LoginForm.cs`
- [Main navigation](https://github.com/davo75/custinvoicedb/blob/master/UIAssignment3/MainForm.cs): shell form · `UIAssignment3/MainForm.cs`
- [Customer management](https://github.com/davo75/custinvoicedb/blob/master/UIAssignment3/CustomerForm.cs): CRUD form · `UIAssignment3/CustomerForm.cs`
- [Invoice management](https://github.com/davo75/custinvoicedb/blob/master/UIAssignment3/InvoiceForm.cs): CRUD form · `UIAssignment3/InvoiceForm.cs`
- **Form designers**: generated WinForms layouts · Paired Designer.cs files define controls and event wiring.
- [Data connection](https://github.com/davo75/custinvoicedb/blob/master/UIAssignment3/DataConnect.cs): persistence boundary · Central abstraction for form database operations. · `UIAssignment3/DataConnect.cs`
- [Runtime configuration](https://github.com/davo75/custinvoicedb/blob/master/UIAssignment3/App.config): application config · `UIAssignment3/App.config`
- [Generated settings](https://github.com/davo75/custinvoicedb/blob/master/UIAssignment3/Properties/Settings.settings): application settings · `UIAssignment3/Properties/Settings.settings`
- [WinForms resources](https://github.com/davo75/custinvoicedb/blob/master/UIAssignment3/Properties/Resources.resx): resource definitions · `UIAssignment3/Properties/Resources.resx`

### Alternate DB Variant

Separate DB-focused implementation.

- **Alternate solution**: Visual Studio solution
- [Alternate startup](https://github.com/davo75/custinvoicedb/blob/master/UI_Assignment_3_With_DB/UIAssignment3_DB/UIAssignment3_DB/Program.cs): WinForms entry point · `UI_Assignment_3_With_DB/UIAssignment3_DB/UIAssignment3_DB/Program.cs`
- [Alternate main form](https://github.com/davo75/custinvoicedb/blob/master/UI_Assignment_3_With_DB/UIAssignment3_DB/UIAssignment3_DB/Form1.cs): consolidated UI form · `UI_Assignment_3_With_DB/UIAssignment3_DB/UIAssignment3_DB/Form1.cs`
- [Alternate configuration](https://github.com/davo75/custinvoicedb/blob/master/UI_Assignment_3_With_DB/UIAssignment3_DB/UIAssignment3_DB/App.config): application config · `UI_Assignment_3_With_DB/UIAssignment3_DB/UIAssignment3_DB/App.config`

### Other components

- **MySQL database**: external datastore
- [Database schema and seed data](https://github.com/davo75/custinvoicedb/blob/master/custinvoice.sql): SQL setup script · `custinvoice.sql`

## Connections

- Primary solution → WinForms project: orchestrates
- WinForms project → Application startup: builds
- Application startup → Login: starts
- Login → Main navigation: authenticates into
- Main navigation → Customer management: opens
- Main navigation → Invoice management: opens
- Form designers → Login: layouts
- Form designers → Main navigation: layouts
- Form designers → Customer management: layouts
- Form designers → Invoice management: layouts
- Customer management → Data connection: CRUD operations
- Invoice management → Data connection: CRUD operations
- Data connection → MySQL database: queries
- Runtime configuration → Data connection: connection values
- Generated settings → Runtime configuration: generated into
- WinForms resources → WinForms project: compiled by
- Database schema and seed data → MySQL database: provisions
- Alternate solution → Alternate startup: starts
- Alternate startup → Alternate main form: launches
- Alternate configuration → Alternate main form: configures
- Alternate main form → MySQL database: database operations
