# paulo-aragao/services-and-bootstrapping-system architecture

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

- Interactive diagram: https://gitdiagram.com/paulo-aragao/services-and-bootstrapping-system
- Repository: https://github.com/paulo-aragao/services-and-bootstrapping-system

## Overview

This Unity package provides dependency-ordered startup for registered bootables, service registration and lookup, and built-in configuration and save services. The principal workflow starts before the first scene: GameBoot loads BootRegistry, BootRunner orders its bootables using DependsOn metadata, and each bootable is started. Services register with ServiceLocator and initialize through Service.Init(). The graph follows the documented and excerpted calls; it does not infer additional runtime integrations.

Main entry points: [`Runtime/Services/Service.cs`](https://github.com/paulo-aragao/services-and-bootstrapping-system/blob/main/Runtime/Services/Service.cs) (Service), [`Runtime/BootSystem/BootRunner.cs`](https://github.com/paulo-aragao/services-and-bootstrapping-system/blob/main/Runtime/BootSystem/BootRunner.cs) (BootRunner), [`Runtime/BootSystem/GameBoot.cs`](https://github.com/paulo-aragao/services-and-bootstrapping-system/blob/main/Runtime/BootSystem/GameBoot.cs) (GameBoot), [`Runtime/Services/Config/SaveService.cs`](https://github.com/paulo-aragao/services-and-bootstrapping-system/blob/main/Runtime/Services/Config/SaveService.cs) (SaveService)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Startup orchestration"]
  node_gameboot["GameBoot<br/>[GameBoot.cs]"]
  node_registry[("BootRegistry<br/>[BootRegistry.cs]")]
  node_runner["BootRunner<br/>[BootRunner.cs]"]
  node_bootable["IBootable<br/>[IBootable.cs]"]
  node_depends["DependsOnAttribute"]
end

subgraph group_services["Service lifecycle"]
  node_service["Service<br/>[Service.cs]"]
  node_locator[("ServiceLocator<br/>[ServiceLocator.cs]")]
end

subgraph group_builtins["Built-in services"]
  node_config["ConfigService<br/>[ConfigService.cs]"]
  node_save["SaveService<br/>[SaveService.cs]"]
end

node_runtime(("Unity runtime"))
node_client(("Game code"))

node_runtime -->|"triggers before scene"| node_gameboot
node_gameboot -->|"loads"| node_registry
node_gameboot -->|"runs"| node_runner
node_registry -->|"supplies bootables"| node_runner
node_runner -->|"reads dependencies"| node_depends
node_runner -->|"orders and boots"| node_bootable
node_service -->|"implements"| node_bootable
node_service -->|"registers"| node_locator
node_service -->|"dispatches Init"| node_config
node_service -->|"dispatches Init"| node_save
node_config -->|"extends"| node_service
node_save -->|"extends"| node_service
node_save -->|"declares dependency"| node_depends
node_client -->|"requests service"| node_locator

click node_gameboot "https://github.com/paulo-aragao/services-and-bootstrapping-system/blob/main/Runtime/BootSystem/GameBoot.cs"
click node_registry "https://github.com/paulo-aragao/services-and-bootstrapping-system/blob/main/Runtime/BootSystem/BootRegistry.cs"
click node_runner "https://github.com/paulo-aragao/services-and-bootstrapping-system/blob/main/Runtime/BootSystem/BootRunner.cs"
click node_bootable "https://github.com/paulo-aragao/services-and-bootstrapping-system/blob/main/Runtime/BootSystem/IBootable.cs"
click node_depends "https://github.com/paulo-aragao/services-and-bootstrapping-system/blob/main/Runtime/Services/DependsOnAttribute.cs"
click node_service "https://github.com/paulo-aragao/services-and-bootstrapping-system/blob/main/Runtime/Services/Service.cs"
click node_locator "https://github.com/paulo-aragao/services-and-bootstrapping-system/blob/main/Runtime/Services/ServiceLocator.cs"
click node_config "https://github.com/paulo-aragao/services-and-bootstrapping-system/blob/main/Runtime/Services/Config/ConfigService.cs"
click node_save "https://github.com/paulo-aragao/services-and-bootstrapping-system/blob/main/Runtime/Services/Config/SaveService.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_gameboot,node_registry,node_runner,node_bootable,node_depends toneBlue
class node_service,node_locator toneAmber
class node_config,node_save toneMint
class node_runtime,node_client toneIndigo
```

## Components

### Startup orchestration

- [GameBoot](https://github.com/paulo-aragao/services-and-bootstrapping-system/blob/main/Runtime/BootSystem/GameBoot.cs): `Runtime/BootSystem/GameBoot.cs`
- [BootRegistry](https://github.com/paulo-aragao/services-and-bootstrapping-system/blob/main/Runtime/BootSystem/BootRegistry.cs): `Runtime/BootSystem/BootRegistry.cs`
- [BootRunner](https://github.com/paulo-aragao/services-and-bootstrapping-system/blob/main/Runtime/BootSystem/BootRunner.cs): `Runtime/BootSystem/BootRunner.cs`
- [IBootable](https://github.com/paulo-aragao/services-and-bootstrapping-system/blob/main/Runtime/BootSystem/IBootable.cs): `Runtime/BootSystem/IBootable.cs`
- [DependsOnAttribute](https://github.com/paulo-aragao/services-and-bootstrapping-system/blob/main/Runtime/Services/DependsOnAttribute.cs): `Runtime/Services/DependsOnAttribute.cs`

### Service lifecycle

- [Service](https://github.com/paulo-aragao/services-and-bootstrapping-system/blob/main/Runtime/Services/Service.cs): `Runtime/Services/Service.cs`
- [ServiceLocator](https://github.com/paulo-aragao/services-and-bootstrapping-system/blob/main/Runtime/Services/ServiceLocator.cs): `Runtime/Services/ServiceLocator.cs`

### Built-in services

- [ConfigService](https://github.com/paulo-aragao/services-and-bootstrapping-system/blob/main/Runtime/Services/Config/ConfigService.cs): `Runtime/Services/Config/ConfigService.cs`
- [SaveService](https://github.com/paulo-aragao/services-and-bootstrapping-system/blob/main/Runtime/Services/Config/SaveService.cs): `Runtime/Services/Config/SaveService.cs`

### Other components

- **Unity runtime**
- **Game code**

## Connections

- Unity runtime → GameBoot: triggers before scene (evidence: `Runtime/BootSystem/GameBoot.cs`)
- GameBoot → BootRegistry: loads (evidence: `Runtime/BootSystem/GameBoot.cs`)
- GameBoot → BootRunner: runs (evidence: `Runtime/BootSystem/GameBoot.cs`)
- BootRegistry → BootRunner: supplies bootables (evidence: `Runtime/BootSystem/GameBoot.cs`)
- BootRunner → DependsOnAttribute: reads dependencies (evidence: `Runtime/BootSystem/BootRunner.cs`)
- BootRunner → IBootable: orders and boots (evidence: `Runtime/BootSystem/BootRunner.cs`)
- Service → IBootable: implements (evidence: `Runtime/Services/Service.cs`)
- Service → ServiceLocator: registers (evidence: `Runtime/Services/Service.cs`)
- Service → ConfigService: dispatches Init (evidence: `Runtime/Services/Service.cs`)
- Service → SaveService: dispatches Init (evidence: `Runtime/Services/Service.cs`)
- ConfigService → Service: extends (evidence: `Runtime/Services/Config/ConfigService.cs`)
- SaveService → Service: extends (evidence: `Runtime/Services/Config/SaveService.cs`)
- SaveService → DependsOnAttribute: declares dependency (evidence: `Runtime/Services/Config/SaveService.cs`)
- Game code → ServiceLocator: requests service (evidence: `README.md`)
