# harshil1030/webapp_csharp architecture

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

- Interactive diagram: https://gitdiagram.com/harshil1030/webapp_csharp
- Repository: https://github.com/harshil1030/webapp_csharp

## Overview

1. **System shape**
   - This is a single **ASP.NET Web Forms** application in the classic .NET Framework stack, not a layered microservice or SPA.
   - The solution centers on one web project, `WebApplication_final`, targeting **.NET Framework 4.7.2**.

2. **Presentation layer**
   - The visible application surface is composed of `.aspx` pages with matching `.cs` code-behind and `.designer.cs` files.
   - Main user-facing pages are `Home`, `About us`, `Contact Us`, `Login`, `Registration`, and an `admin` page, plus an extra `WebForm1` page.
   - `webform1.Master` provides the shared site shell/layout used by content pages.

3. **Page-driven architecture**
   - The app follows the Web Forms event model: each page owns its own UI events and server-side logic in code-behind.
   - There is no obvious separate MVC controller layer, API layer, or front-end framework boundary.

4. **User flow boundaries**
   - The page names indicate three major flows: public content browsing (`Home`, `About us`, `Contact Us`), account creation/login (`Registration`, `Login`), and privileged administration (`admin`).
   - The README screenshots reinforce that the UI is a form-driven portal with distinct entry points for these flows.

5. **Data storage**
   - Persistent data is stored in local SQL Server database files under `App_Data`.
   - There are three database attachments: `Database1.mdf`, `Database2.mdf`, and `Registration.mdf`, each with its corresponding log file.
   - This suggests the app uses **attached local databases** rather than a remote database service.

6. **Data access pattern**
   - `SqlDatabaseSetup.cs` is the only clearly named non-page class and likely contains database initialization or connection/setup logic.
   - The repository does not show a dedicated DAL/repository layer; data access is likely handled directly from page code-behind plus the setup helper.

7. **Configuration and environment**
   - `Web.config` is the central runtime configuration file, with `Web.Debug.config` and `Web.Release.config` providing deployment-time transforms.
   - `app.config` is also present, which is common when supporting helper code or local tooling in addition to the web runtime.
   - The `.vs` folder and IIS Express-style config indicate the project is developed and run primarily in **Visual Studio**.

8. **Build and compilation**
   - The project includes `Microsoft.CodeDom.Providers.DotNetCompilerPlatform`, which enables Roslyn-based compilation for the Web Forms app.
   - `bin` contains the built assembly and Roslyn compiler binaries; `obj` contains intermediate build artifacts.

9. **Solution/project structure**
   - `WebApplication_final.sln` is the top-level solution file.
   - `WebApplication_final.csproj` defines the web project, package references, and build behavior.
   - `packages.config` pins the NuGet dependency used for the compiler platform.

10. **Primary runtime data flow**
   - Browser request hits an `.aspx` page.
   - Web Forms lifecycle loads the shared master page and page-specific content.
   - Code-behind handles events such as form submission or navigation.
   - Page logic reads/writes the local MDF database(s).
   - The rendered HTML response is returned to the browser.

11. **Important architectural takeaway**
   - The key boundary in this repository is between **UI pages** and **local SQL Server data**.
   - Everything else—master page, code-behind, and `SqlDatabaseSetup`—supports that page-centric, database-backed Web Forms structure.

Main entry points: [`WebApplication_final/WebApplication_final.csproj`](https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/WebApplication_final.csproj) (Web App), [`WebApplication_final/webform1.Master`](https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/webform1.Master) (Site Shell), [`WebApplication_final/SqlDatabaseSetup.cs`](https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/SqlDatabaseSetup.cs) (DB Setup), [`WebApplication_final/App_Data`](https://github.com/harshil1030/webapp_csharp/tree/main/WebApplication_final/App_Data) (App_Data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Presentation"]
  node_master["Site Shell<br/>master page<br/>[webform1.Master]"]
  node_home["Home<br/>aspx page<br/>[Home.aspx]"]
  node_about["About us<br/>aspx page<br/>[About us.aspx]"]
  node_contact["Contact Us<br/>aspx page<br/>[Contact Us.aspx]"]
  node_login["Login<br/>aspx page<br/>[Login.aspx]"]
  node_register["Registration<br/>aspx page<br/>[Registration.aspx]"]
  node_admin["Admin<br/>aspx page<br/>[admin.aspx]"]
  node_webform1["WebForm1<br/>aspx page<br/>[WebForm1.aspx]"]
end

subgraph group_data["Data"]
  node_setup["DB Setup<br/>helper class"]
  node_appdata[("App_Data<br/>data folder")]
  node_db1[("Database1<br/>mdf database<br/>[Database1.mdf]")]
  node_db2[("Database2<br/>mdf database<br/>[Database2.mdf]")]
  node_regdb[("Registration DB<br/>mdf database<br/>[Registration.mdf]")]
end

subgraph group_build["Build & Config"]
  node_solution["Solution<br/>sln"]
  node_project["Web App<br/>web project"]
  node_webconfig["Web.config<br/>runtime config<br/>[Web.config]"]
  node_debugconfig["Debug xform<br/>config transform<br/>[Web.Debug.config]"]
  node_releaseconfig["Release xform<br/>config transform<br/>[Web.Release.config]"]
end

node_solution -->|"contains"| node_project
node_project -->|"uses"| node_master
node_project -->|"contains"| node_home
node_project -->|"contains"| node_about
node_project -->|"contains"| node_contact
node_project -->|"contains"| node_login
node_project -->|"contains"| node_register
node_project -->|"contains"| node_admin
node_project -->|"contains"| node_webform1
node_project -->|"includes"| node_setup
node_project -->|"configured by"| node_webconfig
node_project -.->|"transformed by"| node_debugconfig
node_project -.->|"transformed by"| node_releaseconfig
node_project -->|"stores data in"| node_appdata
node_appdata -->|"contains"| node_db1
node_appdata -->|"contains"| node_db2
node_appdata -->|"contains"| node_regdb
node_home -->|"inherits layout"| node_master
node_about -->|"inherits layout"| node_master
node_contact -->|"inherits layout"| node_master
node_login -->|"inherits layout"| node_master
node_register -->|"inherits layout"| node_master
node_admin -->|"inherits layout"| node_master
node_webform1 -->|"inherits layout"| node_master
node_home -->|"reads/writes"| node_db1
node_login -->|"reads/writes"| node_regdb
node_register -->|"reads/writes"| node_regdb
node_admin -->|"reads/writes"| node_db2
node_setup -->|"initializes"| node_db1
node_setup -->|"initializes"| node_db2
node_setup -->|"initializes"| node_regdb

click node_solution "https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final.sln"
click node_project "https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/WebApplication_final.csproj"
click node_webconfig "https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/Web.config"
click node_debugconfig "https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/Web.Debug.config"
click node_releaseconfig "https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/Web.Release.config"
click node_master "https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/webform1.Master"
click node_home "https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/Home.aspx"
click node_about "https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/About us.aspx"
click node_contact "https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/Contact Us.aspx"
click node_login "https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/Login.aspx"
click node_register "https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/Registration.aspx"
click node_admin "https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/admin.aspx"
click node_webform1 "https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/WebForm1.aspx"
click node_setup "https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/SqlDatabaseSetup.cs"
click node_appdata "https://github.com/harshil1030/webapp_csharp/tree/main/WebApplication_final/App_Data"
click node_db1 "https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/App_Data/Database1.mdf"
click node_db2 "https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/App_Data/Database2.mdf"
click node_regdb "https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/App_Data/Registration.mdf"

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_master,node_home,node_about,node_contact,node_login,node_register,node_admin,node_webform1 toneBlue
class node_setup,node_appdata,node_db1,node_db2,node_regdb toneAmber
class node_solution,node_project,node_webconfig,node_debugconfig,node_releaseconfig toneMint
```

## Components

### Presentation

Web Forms pages and shared shell

- [Site Shell](https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/webform1.Master): master page · Shared layout for content pages · `WebApplication_final/webform1.Master`
- [Home](https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/Home.aspx): aspx page · Public landing page · `WebApplication_final/Home.aspx`
- [About us](https://github.com/harshil1030/webapp_csharp/blob/HEAD/WebApplication_final/About%20us.aspx): aspx page · Public informational page · `WebApplication_final/About us.aspx`
- [Contact Us](https://github.com/harshil1030/webapp_csharp/blob/HEAD/WebApplication_final/Contact%20Us.aspx): aspx page · Public contact page · `WebApplication_final/Contact Us.aspx`
- [Login](https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/Login.aspx): aspx page · Authentication entry page · `WebApplication_final/Login.aspx`
- [Registration](https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/Registration.aspx): aspx page · Account creation page · `WebApplication_final/Registration.aspx`
- [Admin](https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/admin.aspx): aspx page · Privileged administration page · `WebApplication_final/admin.aspx`
- [WebForm1](https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/WebForm1.aspx): aspx page · Additional page in the app · `WebApplication_final/WebForm1.aspx`

### Data

Local SQL Server databases and setup

- [DB Setup](https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/SqlDatabaseSetup.cs): helper class · Database initialization and connection setup helper · `WebApplication_final/SqlDatabaseSetup.cs`
- [App_Data](https://github.com/harshil1030/webapp_csharp/tree/main/WebApplication_final/App_Data): data folder · Local attached SQL Server database files · `WebApplication_final/App_Data`
- [Database1](https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/App_Data/Database1.mdf): mdf database · Attached local database · `WebApplication_final/App_Data/Database1.mdf`
- [Database2](https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/App_Data/Database2.mdf): mdf database · Attached local database · `WebApplication_final/App_Data/Database2.mdf`
- [Registration DB](https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/App_Data/Registration.mdf): mdf database · Attached local database for registration-related data · `WebApplication_final/App_Data/Registration.mdf`

### Build & Config

Solution, project, and runtime configuration

- [Solution](https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final.sln): sln · Top-level Visual Studio solution · `WebApplication_final.sln`
- [Web App](https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/WebApplication_final.csproj): web project · ASP.NET Web Forms application targeting .NET Framework 4.7.2 · `WebApplication_final/WebApplication_final.csproj`
- [Web.config](https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/Web.config): runtime config · Primary web runtime configuration · `WebApplication_final/Web.config`
- [Debug xform](https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/Web.Debug.config): config transform · Debug deployment transform · `WebApplication_final/Web.Debug.config`
- [Release xform](https://github.com/harshil1030/webapp_csharp/blob/main/WebApplication_final/Web.Release.config): config transform · Release deployment transform · `WebApplication_final/Web.Release.config`

## Connections

- Solution → Web App: contains · Solution hosts the web project
- Web App → Site Shell: uses · Project defines the shared master page
- Web App → Home: contains · Project contains public page
- Web App → About us: contains · Project contains public page
- Web App → Contact Us: contains · Project contains public page
- Web App → Login: contains · Project contains account page
- Web App → Registration: contains · Project contains account page
- Web App → Admin: contains · Project contains admin page
- Web App → WebForm1: contains · Project contains extra page
- Web App → DB Setup: includes · Project includes database setup helper
- Web App → Web.config: configured by · Primary runtime settings for the web app
- Web App → Debug xform: transformed by · Debug build transform
- Web App → Release xform: transformed by · Release build transform
- Web App → App_Data: stores data in · Local databases live under App_Data
- App_Data → Database1: contains · Attached database file
- App_Data → Database2: contains · Attached database file
- App_Data → Registration DB: contains · Attached database file
- Home → Site Shell: inherits layout · Page uses shared shell
- About us → Site Shell: inherits layout · Page uses shared shell
- Contact Us → Site Shell: inherits layout · Page uses shared shell
- Login → Site Shell: inherits layout · Page uses shared shell
- Registration → Site Shell: inherits layout · Page uses shared shell
- Admin → Site Shell: inherits layout · Page uses shared shell
- WebForm1 → Site Shell: inherits layout · Page uses shared shell
- Home → Database1: reads/writes · Page logic likely uses local database
- Login → Registration DB: reads/writes · Authentication and registration data
- Registration → Registration DB: reads/writes · Account creation data
- Admin → Database2: reads/writes · Admin page likely accesses application data
- DB Setup → Database1: initializes · Helper sets up database connectivity
- DB Setup → Database2: initializes · Helper sets up database connectivity
- DB Setup → Registration DB: initializes · Helper sets up database connectivity
