# ahmadomar/appgenerator architecture

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

- Interactive diagram: https://gitdiagram.com/ahmadomar/appgenerator
- Repository: https://github.com/ahmadomar/appgenerator

## Overview

AppGenerator is an ASP.NET MVC service for configuring, generating, compiling, theming, and publishing user applications. The main workflow starts with an application owner supplying database details and selecting tables; the application controller coordinates schema discovery and generated controllers/views, then project creation and optional compilation or Azure deployment. The README also documents project-file generation and theme selection. Several generator and deployment relationships are documented rather than fully visible in the excerpts, so those links cite the README or are omitted where ownership is unclear.

Main entry points: [`WebApp/AppsGenerator/Controllers/ApplicationController.cs`](https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/Controllers/ApplicationController.cs) (Generation workflow), [`WebApp/AppsGenerator/Controllers/ThemesController.cs`](https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/Controllers/ThemesController.cs) (Theme selection), [`WebApp/AppsGenerator/Classes/Generator/ControllerGenerator.cs`](https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/Classes/Generator/ControllerGenerator.cs) (Controller generation), [`WebApp/AppsGenerator/Classes/Generator/MyGenerator.cs`](https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/Classes/Generator/MyGenerator.cs) (Schema discovery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_appui["Generation workflow"]
  node_account["Account management"]
  node_themechoice["Theme selection"]
end

subgraph group_generation["Application generation"]
  node_schema["Schema discovery<br/>[MyGenerator.cs]"]
  node_mapping["Entity mapping<br/>[EdmMapping.cs]"]
  node_controllergen["Controller generation"]
  node_viewgen["CRUD view generation<br/>[ViewsGenerator.cs]"]
  node_controllertemplate["Generated controllers<br/>[Controller.cs]"]
  node_viewtemplates["Generated CRUD views"]
  node_projectfile["Project file output<br/>[AppProj.cs]"]
  node_themeasset["Theme assets"]
end

subgraph group_delivery["Build and deployment"]
  node_compile["Application compilation<br/>[Compile.cs]"]
  node_azuredeploy["Azure deployment<br/>[WebDeploy.cs]"]
  node_azure{{"Azure Websites"}}
end

subgraph group_data["Application data"]
  node_apprecords[("Application records")]
  node_memberrecords[("Member records")]
  node_themerecords[("Theme records<br/>[ThemeRepository.cs]")]
end

node_owner(("Application owner"))
node_generatedapp["Generated web app"]

node_owner -->|"configures"| node_appui
node_appui -->|"discovers schema"| node_schema
node_appui -->|"generates controllers"| node_controllergen
node_schema -.->|"uses mappings"| node_mapping
node_controllergen -->|"invokes"| node_viewgen
node_controllergen -->|"renders"| node_controllertemplate
node_viewgen -.->|"renders"| node_viewtemplates
node_appui -.->|"creates project"| node_projectfile
node_appui -->|"requests compilation"| node_compile
node_appui -->|"starts deployment"| node_azuredeploy
node_azuredeploy -.->|"publishes to"| node_azure
node_projectfile -.->|"packages project"| node_generatedapp
node_compile -->|"compiles"| node_generatedapp
node_appui -.->|"manages records"| node_apprecords
node_account -->|"manages members"| node_memberrecords
node_themechoice -->|"loads themes"| node_themerecords
node_owner -.->|"chooses theme"| node_themechoice
node_themechoice -.->|"applies theme"| node_themeasset

click node_appui "https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/Controllers/ApplicationController.cs"
click node_account "https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/Controllers/MemberController.cs"
click node_themechoice "https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/Controllers/ThemesController.cs"
click node_apprecords "https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/Models/Repositories/ApplicationRepository.cs"
click node_memberrecords "https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/Models/Repositories/MemberRepository.cs"
click node_themerecords "https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/Models/Repositories/ThemeRepository.cs"
click node_schema "https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/Classes/Generator/MyGenerator.cs"
click node_mapping "https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/Classes/Generator/EdmMapping.cs"
click node_controllergen "https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/Classes/Generator/ControllerGenerator.cs"
click node_viewgen "https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/Classes/Generator/ViewsGenerator.cs"
click node_controllertemplate "https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/CSharpGenerator/Web/MvcControllerWithContext/Controller.cs"
click node_viewtemplates "https://github.com/ahmadomar/appgenerator/tree/master/WebApp/AppsGenerator/CSharpGenerator/Web/MvcView"
click node_projectfile "https://github.com/ahmadomar/appgenerator/blob/master/WebApp/CSharpGenerator/Web/App/AppProj.cs"
click node_compile "https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/Classes/Publish/Compile.cs"
click node_azuredeploy "https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/Classes/Azure/WebDeploy.cs"
click node_themeasset "https://github.com/ahmadomar/appgenerator/tree/master/WebApp/AppsGenerator/App_Data/ApplicationFolders"

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_appui,node_account,node_themechoice toneBlue
class node_schema,node_mapping,node_controllergen,node_viewgen,node_controllertemplate,node_viewtemplates,node_projectfile,node_themeasset toneAmber
class node_compile,node_azuredeploy,node_azure toneMint
class node_apprecords,node_memberrecords,node_themerecords toneRose
class node_owner,node_generatedapp toneIndigo
```

## Components

### Web application

- [Generation workflow](https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/Controllers/ApplicationController.cs): `WebApp/AppsGenerator/Controllers/ApplicationController.cs`
- [Account management](https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/Controllers/MemberController.cs): `WebApp/AppsGenerator/Controllers/MemberController.cs`
- [Theme selection](https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/Controllers/ThemesController.cs): `WebApp/AppsGenerator/Controllers/ThemesController.cs`

### Application generation

- [Schema discovery](https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/Classes/Generator/MyGenerator.cs): `WebApp/AppsGenerator/Classes/Generator/MyGenerator.cs`
- [Entity mapping](https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/Classes/Generator/EdmMapping.cs): `WebApp/AppsGenerator/Classes/Generator/EdmMapping.cs`
- [Controller generation](https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/Classes/Generator/ControllerGenerator.cs): `WebApp/AppsGenerator/Classes/Generator/ControllerGenerator.cs`
- [CRUD view generation](https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/Classes/Generator/ViewsGenerator.cs): `WebApp/AppsGenerator/Classes/Generator/ViewsGenerator.cs`
- [Generated controllers](https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/CSharpGenerator/Web/MvcControllerWithContext/Controller.cs): `WebApp/AppsGenerator/CSharpGenerator/Web/MvcControllerWithContext/Controller.cs`
- [Generated CRUD views](https://github.com/ahmadomar/appgenerator/tree/master/WebApp/AppsGenerator/CSharpGenerator/Web/MvcView): `WebApp/AppsGenerator/CSharpGenerator/Web/MvcView`
- [Project file output](https://github.com/ahmadomar/appgenerator/blob/master/WebApp/CSharpGenerator/Web/App/AppProj.cs): `WebApp/CSharpGenerator/Web/App/AppProj.cs`
- [Theme assets](https://github.com/ahmadomar/appgenerator/tree/master/WebApp/AppsGenerator/App_Data/ApplicationFolders): `WebApp/AppsGenerator/App_Data/ApplicationFolders`

### Build and deployment

- [Application compilation](https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/Classes/Publish/Compile.cs): `WebApp/AppsGenerator/Classes/Publish/Compile.cs`
- [Azure deployment](https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/Classes/Azure/WebDeploy.cs): `WebApp/AppsGenerator/Classes/Azure/WebDeploy.cs`
- **Azure Websites**

### Application data

- [Application records](https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/Models/Repositories/ApplicationRepository.cs): `WebApp/AppsGenerator/Models/Repositories/ApplicationRepository.cs`
- [Member records](https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/Models/Repositories/MemberRepository.cs): `WebApp/AppsGenerator/Models/Repositories/MemberRepository.cs`
- [Theme records](https://github.com/ahmadomar/appgenerator/blob/master/WebApp/AppsGenerator/Models/Repositories/ThemeRepository.cs): `WebApp/AppsGenerator/Models/Repositories/ThemeRepository.cs`

### Other components

- **Application owner**
- **Generated web app**

## Connections

- Application owner → Generation workflow: configures (evidence: `WebApp/AppsGenerator/Controllers/ApplicationController.cs`)
- Generation workflow → Schema discovery: discovers schema (evidence: `WebApp/AppsGenerator/Controllers/ApplicationController.cs`)
- Generation workflow → Controller generation: generates controllers (evidence: `WebApp/AppsGenerator/Controllers/ApplicationController.cs`)
- Schema discovery → Entity mapping: uses mappings (evidence: `WebApp/AppsGenerator/Classes/Generator/MyGenerator.cs`)
- Controller generation → CRUD view generation: invokes (evidence: `WebApp/AppsGenerator/Classes/Generator/ControllerGenerator.cs`)
- Controller generation → Generated controllers: renders (evidence: `WebApp/AppsGenerator/Classes/Generator/ControllerGenerator.cs`)
- CRUD view generation → Generated CRUD views: renders
- Generation workflow → Project file output: creates project
- Generation workflow → Application compilation: requests compilation (evidence: `WebApp/AppsGenerator/Controllers/ApplicationController.cs`)
- Generation workflow → Azure deployment: starts deployment (evidence: `WebApp/AppsGenerator/Controllers/ApplicationController.cs`)
- Azure deployment → Azure Websites: publishes to
- Project file output → Generated web app: packages project
- Application compilation → Generated web app: compiles
- Generation workflow → Application records: manages records
- Account management → Member records: manages members (evidence: `WebApp/AppsGenerator/Controllers/MemberController.cs`)
- Theme selection → Theme records: loads themes (evidence: `WebApp/AppsGenerator/Controllers/ThemesController.cs`)
- Application owner → Theme selection: chooses theme
- Theme selection → Theme assets: applies theme
