# nikicha2209/notehub architecture

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

- Interactive diagram: https://gitdiagram.com/nikicha2209/notehub
- Repository: https://github.com/nikicha2209/notehub

## Overview

NoteHub is an ASP.NET MVC CRUD application for personal notes. A browser request enters through MVC routing and the NoteController, which validates submitted view models and delegates note operations to NoteService. The service maps between view models and Note entities, while NotesDbContext persists them through Entity Framework to SQL Server. The README documents the full create, list, edit, delete, and detail experience; exact view-to-action wiring is supported by MVC conventions, but individual Razor view contents were not sampled.

Main entry points: [`NoteHub.Services.Data/NoteService.cs`](https://github.com/nikicha2209/notehub/blob/master/NoteHub.Services.Data/NoteService.cs) (Note service), [`NoteHub.Web/Controllers/NoteController.cs`](https://github.com/nikicha2209/notehub/blob/master/NoteHub.Web/Controllers/NoteController.cs) (Note actions), [`NoteHub.Web.ViewModels/NoteViewModel.cs`](https://github.com/nikicha2209/notehub/blob/master/NoteHub.Web.ViewModels/NoteViewModel.cs) (Note view model), [`NoteHub.Data/NotesDbContext.cs`](https://github.com/nikicha2209/notehub/blob/master/NoteHub.Data/NotesDbContext.cs) (Notes context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["MVC Web"]
  node_routing["MVC routing<br/>[Program.cs]"]
  node_controller["Note actions<br/>[NoteController.cs]"]
  node_views["CRUD views<br/>[Note]"]
  node_viewmodel["Note view model<br/>[NoteViewModel.cs]"]
end

subgraph group_domain["Note Domain"]
  node_service["Note service<br/>[NoteService.cs]"]
  node_interface["Service contract<br/>[INoteService.cs]"]
  node_validation["Validation rules"]
  node_messages["Validation messages"]
  node_note["Note entity<br/>[Note.cs]"]
end

subgraph group_persistence["Persistence"]
  node_context["Notes context<br/>[NotesDbContext.cs]"]
  node_sqlserver[("SQL Server")]
end

node_browser(("User browser"))

node_browser -->|"sends request"| node_routing
node_routing -->|"routes requests"| node_controller
node_controller -->|"invokes contract"| node_interface
node_controller -->|"binds and validates"| node_viewmodel
node_controller -.->|"returns views"| node_views
node_service -->|"implements"| node_interface
node_service -->|"reads and writes"| node_context
node_service -->|"maps entities"| node_note
node_service -->|"maps data"| node_viewmodel
node_viewmodel -->|"uses limits"| node_validation
node_viewmodel -->|"uses messages"| node_messages
node_note -->|"uses limits"| node_validation
node_context -->|"tracks entities"| node_note
node_context -->|"persists via EF"| node_sqlserver

click node_routing "https://github.com/nikicha2209/notehub/blob/master/NoteHub.Web/Program.cs"
click node_controller "https://github.com/nikicha2209/notehub/blob/master/NoteHub.Web/Controllers/NoteController.cs"
click node_views "https://github.com/nikicha2209/notehub/tree/master/NoteHub.Web/Views/Note"
click node_viewmodel "https://github.com/nikicha2209/notehub/blob/master/NoteHub.Web.ViewModels/NoteViewModel.cs"
click node_service "https://github.com/nikicha2209/notehub/blob/master/NoteHub.Services.Data/NoteService.cs"
click node_interface "https://github.com/nikicha2209/notehub/blob/master/NoteHub.Services.Data/Interfaces/INoteService.cs"
click node_validation "https://github.com/nikicha2209/notehub/blob/master/NoteHub.Common/EntityValidationConstants.cs"
click node_messages "https://github.com/nikicha2209/notehub/blob/master/NoteHub.Common/EntityValidationMessages.cs"
click node_note "https://github.com/nikicha2209/notehub/blob/master/NoteHub.Data.Models/Note.cs"
click node_context "https://github.com/nikicha2209/notehub/blob/master/NoteHub.Data/NotesDbContext.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_routing,node_controller,node_views,node_viewmodel,node_browser toneBlue
class node_service,node_interface,node_validation,node_messages,node_note toneAmber
class node_context,node_sqlserver toneMint
```

## Components

### MVC Web

- [MVC routing](https://github.com/nikicha2209/notehub/blob/master/NoteHub.Web/Program.cs): `NoteHub.Web/Program.cs`
- [Note actions](https://github.com/nikicha2209/notehub/blob/master/NoteHub.Web/Controllers/NoteController.cs): `NoteHub.Web/Controllers/NoteController.cs`
- [CRUD views](https://github.com/nikicha2209/notehub/tree/master/NoteHub.Web/Views/Note): `NoteHub.Web/Views/Note`
- [Note view model](https://github.com/nikicha2209/notehub/blob/master/NoteHub.Web.ViewModels/NoteViewModel.cs): `NoteHub.Web.ViewModels/NoteViewModel.cs`

### Note Domain

- [Note service](https://github.com/nikicha2209/notehub/blob/master/NoteHub.Services.Data/NoteService.cs): `NoteHub.Services.Data/NoteService.cs`
- [Service contract](https://github.com/nikicha2209/notehub/blob/master/NoteHub.Services.Data/Interfaces/INoteService.cs): `NoteHub.Services.Data/Interfaces/INoteService.cs`
- [Validation rules](https://github.com/nikicha2209/notehub/blob/master/NoteHub.Common/EntityValidationConstants.cs): `NoteHub.Common/EntityValidationConstants.cs`
- [Validation messages](https://github.com/nikicha2209/notehub/blob/master/NoteHub.Common/EntityValidationMessages.cs): `NoteHub.Common/EntityValidationMessages.cs`
- [Note entity](https://github.com/nikicha2209/notehub/blob/master/NoteHub.Data.Models/Note.cs): `NoteHub.Data.Models/Note.cs`

### Persistence

- [Notes context](https://github.com/nikicha2209/notehub/blob/master/NoteHub.Data/NotesDbContext.cs): `NoteHub.Data/NotesDbContext.cs`
- **SQL Server**

### Other components

- **User browser**

## Connections

- User browser → MVC routing: sends request (evidence: `README.md`)
- MVC routing → Note actions: routes requests (evidence: `NoteHub.Web/Program.cs`)
- Note actions → Service contract: invokes contract (evidence: `NoteHub.Web/Controllers/NoteController.cs`)
- Note actions → Note view model: binds and validates (evidence: `NoteHub.Web/Controllers/NoteController.cs`)
- Note actions → CRUD views: returns views
- Note service → Service contract: implements (evidence: `NoteHub.Services.Data/NoteService.cs`)
- Note service → Notes context: reads and writes (evidence: `NoteHub.Services.Data/NoteService.cs`)
- Note service → Note entity: maps entities (evidence: `NoteHub.Services.Data/NoteService.cs`)
- Note service → Note view model: maps data (evidence: `NoteHub.Services.Data/NoteService.cs`)
- Note view model → Validation rules: uses limits (evidence: `NoteHub.Web.ViewModels/NoteViewModel.cs`)
- Note view model → Validation messages: uses messages (evidence: `NoteHub.Web.ViewModels/NoteViewModel.cs`)
- Note entity → Validation rules: uses limits (evidence: `NoteHub.Data.Models/Note.cs`)
- Notes context → Note entity: tracks entities (evidence: `NoteHub.Data/NotesDbContext.cs`)
- Notes context → SQL Server: persists via EF
