# wicketbr/freecrm architecture

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

- Interactive diagram: https://gitdiagram.com/wicketbr/freecrm
- Repository: https://github.com/wicketbr/freecrm

## Overview

FreeCRM is a multi-tenant CRM built with a Blazor WebAssembly client and an ASP.NET Core server. Users work with CRM records through the client; server controllers expose operations that the data-access layer performs against EF-backed storage. The repository also documents optional CRM modules, extensible plugins, dynamic code compilation, and periodic background processing. The graph includes those documented capabilities, but some connections are dashed where the supplied excerpts do not establish runtime wiring; unsampled modules are represented by their existing directories.

Main entry points: [`CRM/Controllers/DataController.cs`](https://github.com/wicketbr/freecrm/blob/main/CRM/Controllers/DataController.cs) (HTTP controllers), [`CRM.Client/Program.cs`](https://github.com/wicketbr/freecrm/blob/main/CRM.Client/Program.cs) (Blazor client), [`CRM.DataAccess/DataAccess.cs`](https://github.com/wicketbr/freecrm/blob/main/CRM.DataAccess/DataAccess.cs) (Data access), [`CRM.Plugins/Plugins.cs`](https://github.com/wicketbr/freecrm/blob/main/CRM.Plugins/Plugins.cs) (Plugin runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client experience"]
  node_blazor["Blazor client<br/>[Program.cs]"]
  node_workflow["Workflow editor<br/>[WorkflowEngine.cs]"]
  node_compiler["Dynamic compiler"]
end

subgraph group_server["Server services"]
  node_api["HTTP controllers<br/>[DataController.cs]"]
  node_auth["Authentication"]
  node_background["Background processor"]
end

subgraph group_domain["CRM capabilities"]
  node_appointments["Appointments"]
  node_invoices["Invoices and payments"]
  node_files["File management"]
  node_optional["Other CRM modules"]
end

subgraph group_data["Data layer"]
  node_access["Data access<br/>[DataAccess.cs]"]
  node_records["CRM data contracts<br/>[DataObjects.cs]"]
  node_entities["EF entities<br/>[EFModels]"]
  node_database[("Configured database<br/>[EFDataModel.cs]")]
end

subgraph group_extensions["Extensions"]
  node_plugins["Plugin runtime<br/>[Plugins.cs]"]
  node_examples["Plugin examples"]
end

node_user(("CRM user"))
node_external["External assemblies"]

node_user -.->|"uses"| node_blazor
node_blazor -.->|"requests"| node_api
node_blazor -.->|"edits workflows"| node_workflow
node_workflow -->|"uses types"| node_records
node_blazor -.->|"compiles plugins"| node_compiler
node_compiler -->|"checks cached binaries"| node_api
node_api -->|"invokes"| node_access
node_api -->|"exchanges data"| node_records
node_api -.->|"authenticates"| node_auth
node_api -.->|"serves"| node_appointments
node_api -.->|"serves"| node_invoices
node_api -->|"serves"| node_files
node_api -.->|"serves"| node_optional
node_access -->|"maps data"| node_records
node_access -->|"queries"| node_entities
node_access -->|"persists records"| node_database
node_background -->|"runs plugins"| node_plugins
node_examples -->|"implements"| node_plugins
node_plugins -->|"loads assemblies"| node_external

click node_blazor "https://github.com/wicketbr/freecrm/blob/main/CRM.Client/Program.cs"
click node_workflow "https://github.com/wicketbr/freecrm/blob/main/CRM.Client/WorkflowEngine.cs"
click node_compiler "https://github.com/wicketbr/freecrm/blob/main/CRM.Client/DynamicBlazorSupport/CompilationService.cs"
click node_api "https://github.com/wicketbr/freecrm/blob/main/CRM/Controllers/DataController.cs"
click node_auth "https://github.com/wicketbr/freecrm/blob/main/CRM/Controllers/AuthorizationController.cs"
click node_background "https://github.com/wicketbr/freecrm/blob/main/CRM/Classes/BackgroundProcessor.cs"
click node_appointments "https://github.com/wicketbr/freecrm/tree/main/CRM/Controllers"
click node_invoices "https://github.com/wicketbr/freecrm/tree/main/CRM/Controllers"
click node_files "https://github.com/wicketbr/freecrm/blob/main/CRM/Controllers/DataController.FileStorage.cs"
click node_optional "https://github.com/wicketbr/freecrm/tree/main/CRM/Controllers"
click node_access "https://github.com/wicketbr/freecrm/blob/main/CRM.DataAccess/DataAccess.cs"
click node_records "https://github.com/wicketbr/freecrm/blob/main/CRM.DataObjects/DataObjects.cs"
click node_entities "https://github.com/wicketbr/freecrm/tree/main/CRM.EFModels/EFModels"
click node_database "https://github.com/wicketbr/freecrm/blob/main/CRM.EFModels/EFModels/EFDataModel.cs"
click node_plugins "https://github.com/wicketbr/freecrm/blob/main/CRM.Plugins/Plugins.cs"
click node_examples "https://github.com/wicketbr/freecrm/tree/main/CRM/PluginFiles"

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_blazor,node_workflow,node_compiler,node_user toneBlue
class node_api,node_auth,node_background toneAmber
class node_appointments,node_invoices,node_files,node_optional toneMint
class node_access,node_records,node_entities,node_database toneRose
class node_plugins,node_examples,node_external toneIndigo
```

## Components

### Client experience

- [Blazor client](https://github.com/wicketbr/freecrm/blob/main/CRM.Client/Program.cs): `CRM.Client/Program.cs`
- [Workflow editor](https://github.com/wicketbr/freecrm/blob/main/CRM.Client/WorkflowEngine.cs): `CRM.Client/WorkflowEngine.cs`
- [Dynamic compiler](https://github.com/wicketbr/freecrm/blob/main/CRM.Client/DynamicBlazorSupport/CompilationService.cs): `CRM.Client/DynamicBlazorSupport/CompilationService.cs`

### Server services

- [HTTP controllers](https://github.com/wicketbr/freecrm/blob/main/CRM/Controllers/DataController.cs): `CRM/Controllers/DataController.cs`
- [Authentication](https://github.com/wicketbr/freecrm/blob/main/CRM/Controllers/AuthorizationController.cs): `CRM/Controllers/AuthorizationController.cs`
- [Background processor](https://github.com/wicketbr/freecrm/blob/main/CRM/Classes/BackgroundProcessor.cs): `CRM/Classes/BackgroundProcessor.cs`

### CRM capabilities

- [Appointments](https://github.com/wicketbr/freecrm/tree/main/CRM/Controllers): `CRM/Controllers`
- [Invoices and payments](https://github.com/wicketbr/freecrm/tree/main/CRM/Controllers): `CRM/Controllers`
- [File management](https://github.com/wicketbr/freecrm/blob/main/CRM/Controllers/DataController.FileStorage.cs): `CRM/Controllers/DataController.FileStorage.cs`
- [Other CRM modules](https://github.com/wicketbr/freecrm/tree/main/CRM/Controllers): `CRM/Controllers`

### Data layer

- [Data access](https://github.com/wicketbr/freecrm/blob/main/CRM.DataAccess/DataAccess.cs): `CRM.DataAccess/DataAccess.cs`
- [CRM data contracts](https://github.com/wicketbr/freecrm/blob/main/CRM.DataObjects/DataObjects.cs): `CRM.DataObjects/DataObjects.cs`
- [EF entities](https://github.com/wicketbr/freecrm/tree/main/CRM.EFModels/EFModels): `CRM.EFModels/EFModels`
- [Configured database](https://github.com/wicketbr/freecrm/blob/main/CRM.EFModels/EFModels/EFDataModel.cs): `CRM.EFModels/EFModels/EFDataModel.cs`

### Extensions

- [Plugin runtime](https://github.com/wicketbr/freecrm/blob/main/CRM.Plugins/Plugins.cs): `CRM.Plugins/Plugins.cs`
- [Plugin examples](https://github.com/wicketbr/freecrm/tree/main/CRM/PluginFiles): `CRM/PluginFiles`

### Other components

- **CRM user**
- **External assemblies**

## Connections

- CRM user → Blazor client: uses (evidence: `README.md`)
- Blazor client → HTTP controllers: requests
- Blazor client → Workflow editor: edits workflows
- Workflow editor → CRM data contracts: uses types (evidence: `CRM.Client/WorkflowEngine.cs`)
- Blazor client → Dynamic compiler: compiles plugins
- Dynamic compiler → HTTP controllers: checks cached binaries (evidence: `CRM.Client/DynamicBlazorSupport/CompilationService.cs`)
- HTTP controllers → Data access: invokes
- HTTP controllers → CRM data contracts: exchanges data (evidence: `CRM/Controllers/DataController.cs`)
- HTTP controllers → Authentication: authenticates
- HTTP controllers → Appointments: serves (evidence: `CRM/Controllers/DataController.FileStorage.cs`)
- HTTP controllers → Invoices and payments: serves (evidence: `CRM/Controllers/DataController.FileStorage.cs`)
- HTTP controllers → File management: serves (evidence: `CRM/Controllers/DataController.FileStorage.cs`)
- HTTP controllers → Other CRM modules: serves (evidence: `CRM/Controllers/DataController.FileStorage.cs`)
- Data access → CRM data contracts: maps data (evidence: `CRM.DataAccess/DataAccess.cs`)
- Data access → EF entities: queries (evidence: `CRM.DataAccess/DataAccess.FileStorage.cs`)
- Data access → Configured database: persists records (evidence: `CRM.DataAccess/DataAccess.cs`)
- Background processor → Plugin runtime: runs plugins (evidence: `CRM/Classes/BackgroundProcessor.cs`)
- Plugin examples → Plugin runtime: implements (evidence: `CRM/PluginFiles/Example1.cs`)
- Plugin runtime → External assemblies: loads assemblies (evidence: `CRM.Plugins/Plugins.cs`)
