# paolo-rossi/delphi-neon architecture

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

- Interactive diagram: https://gitdiagram.com/paolo-rossi/delphi-neon
- Repository: https://github.com/paolo-rossi/delphi-neon

## Overview

Neon is a Delphi library for converting Delphi values and objects to and from JSON. The main workflow is an application providing a value and configuration to Neon, then receiving JSON or a populated value. The README also documents entity generation and JSON Schema generation and validation. The tree identifies relevant modules, but no source excerpts were available, so internal call wiring beyond documented behavior is left unspecified.

Main entry points: [`Source/Neon.Core.Persistence.JSON.pas`](https://github.com/paolo-rossi/delphi-neon/blob/master/Source/Neon.Core.Persistence.JSON.pas) (JSON persistence), [`Source/Neon.Core.Generator.pas`](https://github.com/paolo-rossi/delphi-neon/blob/master/Source/Neon.Core.Generator.pas) (Entity generator), [`Source/Neon.Core.Persistence.pas`](https://github.com/paolo-rossi/delphi-neon/blob/master/Source/Neon.Core.Persistence.pas) (Persistence API), [`Source/Neon.Core.Persistence.JSON.Schema.pas`](https://github.com/paolo-rossi/delphi-neon/blob/master/Source/Neon.Core.Persistence.JSON.Schema.pas) (Schema generation and validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_serialization["JSON Serialization"]
  node_persistence["Persistence API"]
  node_json_persistence["JSON persistence"]
  node_configuration["Configuration and attributes"]
end

subgraph group_type_support["Type Support"]
  node_type_info["RTTI and types"]
  node_serializers["Type serializers"]
  node_db_serializer["Dataset serializer"]
  node_vcl_serializer["VCL serializer"]
  node_dynamic_types["Dynamic types"]
end

subgraph group_generation_schema["Generation and Schema"]
  node_generator["Entity generator"]
  node_schema["Schema generation and validation"]
end

node_application(("Delphi application"))
node_json_document["JSON document"]
node_delphi_values["Delphi values"]
node_generated_entities["Delphi entities"]

node_application -->|"provides values"| node_persistence
node_persistence -->|"serializes and reads"| node_json_persistence
node_json_persistence -->|"produces or consumes"| node_json_document
node_json_persistence -->|"populates"| node_delphi_values
node_application -->|"requests generation"| node_generator
node_json_document -->|"provides input"| node_generator
node_generator -->|"generates"| node_generated_entities
node_application -->|"requests schema work"| node_schema
node_schema -->|"generates or validates"| node_json_document

click node_persistence "https://github.com/paolo-rossi/delphi-neon/blob/master/Source/Neon.Core.Persistence.pas"
click node_json_persistence "https://github.com/paolo-rossi/delphi-neon/blob/master/Source/Neon.Core.Persistence.JSON.pas"
click node_configuration "https://github.com/paolo-rossi/delphi-neon/blob/master/Source/Neon.Core.Attributes.pas"
click node_type_info "https://github.com/paolo-rossi/delphi-neon/blob/master/Source/Neon.Core.TypeInfo.pas"
click node_serializers "https://github.com/paolo-rossi/delphi-neon/blob/master/Source/Neon.Core.Serializers.RTL.pas"
click node_db_serializer "https://github.com/paolo-rossi/delphi-neon/blob/master/Source/Neon.Core.Serializers.DB.pas"
click node_vcl_serializer "https://github.com/paolo-rossi/delphi-neon/blob/master/Source/Neon.Core.Serializers.VCL.pas"
click node_dynamic_types "https://github.com/paolo-rossi/delphi-neon/blob/master/Source/Neon.Core.DynamicTypes.pas"
click node_generator "https://github.com/paolo-rossi/delphi-neon/blob/master/Source/Neon.Core.Generator.pas"
click node_schema "https://github.com/paolo-rossi/delphi-neon/blob/master/Source/Neon.Core.Persistence.JSON.Schema.pas"

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_persistence,node_json_persistence,node_configuration toneBlue
class node_type_info,node_serializers,node_db_serializer,node_vcl_serializer,node_dynamic_types toneAmber
class node_generator,node_schema toneMint
class node_application,node_json_document,node_delphi_values,node_generated_entities toneIndigo
```

## Components

### JSON Serialization

- [Persistence API](https://github.com/paolo-rossi/delphi-neon/blob/master/Source/Neon.Core.Persistence.pas): `Source/Neon.Core.Persistence.pas`
- [JSON persistence](https://github.com/paolo-rossi/delphi-neon/blob/master/Source/Neon.Core.Persistence.JSON.pas): `Source/Neon.Core.Persistence.JSON.pas`
- [Configuration and attributes](https://github.com/paolo-rossi/delphi-neon/blob/master/Source/Neon.Core.Attributes.pas): `Source/Neon.Core.Attributes.pas`

### Type Support

- [RTTI and types](https://github.com/paolo-rossi/delphi-neon/blob/master/Source/Neon.Core.TypeInfo.pas): `Source/Neon.Core.TypeInfo.pas`
- [Type serializers](https://github.com/paolo-rossi/delphi-neon/blob/master/Source/Neon.Core.Serializers.RTL.pas): `Source/Neon.Core.Serializers.RTL.pas`
- [Dataset serializer](https://github.com/paolo-rossi/delphi-neon/blob/master/Source/Neon.Core.Serializers.DB.pas): `Source/Neon.Core.Serializers.DB.pas`
- [VCL serializer](https://github.com/paolo-rossi/delphi-neon/blob/master/Source/Neon.Core.Serializers.VCL.pas): `Source/Neon.Core.Serializers.VCL.pas`
- [Dynamic types](https://github.com/paolo-rossi/delphi-neon/blob/master/Source/Neon.Core.DynamicTypes.pas): `Source/Neon.Core.DynamicTypes.pas`

### Generation and Schema

- [Entity generator](https://github.com/paolo-rossi/delphi-neon/blob/master/Source/Neon.Core.Generator.pas): `Source/Neon.Core.Generator.pas`
- [Schema generation and validation](https://github.com/paolo-rossi/delphi-neon/blob/master/Source/Neon.Core.Persistence.JSON.Schema.pas): `Source/Neon.Core.Persistence.JSON.Schema.pas`

### Other components

- **Delphi application**
- **JSON document**
- **Delphi values**
- **Delphi entities**

## Connections

- Delphi application → Persistence API: provides values
- Persistence API → JSON persistence: serializes and reads
- JSON persistence → JSON document: produces or consumes
- JSON persistence → Delphi values: populates
- Delphi application → Entity generator: requests generation
- JSON document → Entity generator: provides input
- Entity generator → Delphi entities: generates
- Delphi application → Schema generation and validation: requests schema work
- Schema generation and validation → JSON document: generates or validates
