# anshitsharma/ims-ftp architecture

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

- Interactive diagram: https://gitdiagram.com/anshitsharma/ims-ftp
- Repository: https://github.com/anshitsharma/ims-ftp

## Overview

This is a PHP infrastructure-management backend for cataloguing components, configuring servers, managing rack/location inventory, and running ticket-based operational pipelines. The main workflow enters through the API, uses domain handlers and pipeline orchestration to validate and apply configuration or workflow actions, then reports resulting state. The graph emphasizes the documented pipeline engine, component-specification and compatibility/validation layers, and location/rack capabilities. The README is empty and many handlers are unsampled, so only indexed or excerpt-supported relationships are shown.

Main entry points: [`core/models/pipelines/PipelineManager.php`](https://github.com/anshitsharma/ims-ftp/blob/main/core/models/pipelines/PipelineManager.php) (Pipeline engine), [`api/api.php`](https://github.com/anshitsharma/ims-ftp/blob/main/api/api.php) (API router), [`core/models/location/LocationResolver.php`](https://github.com/anshitsharma/ims-ftp/blob/main/core/models/location/LocationResolver.php) (Location resolver), [`core/models/components/ComponentDataService.php`](https://github.com/anshitsharma/ims-ftp/blob/main/core/models/components/ComponentDataService.php) (Component data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["API and identity"]
  node_api["API router<br/>[api.php]"]
  node_auth["Authentication handlers"]
  node_access["ACL handlers"]
  node_microsoft["Microsoft OAuth<br/>[MicrosoftOAuth.php]"]
end

subgraph group_workflow["Pipeline workflows"]
  node_pipeline_handlers["Pipeline handlers"]
  node_pipeline_manager["Pipeline engine"]
  node_templates["Pipeline templates"]
  node_actions["Action executor"]
  node_tickets["Ticket services"]
  node_workflow_config["Workflow config<br/>[WorkflowConfig.php]"]
end

subgraph group_inventory["Inventory and location"]
  node_server_handlers["Server handlers<br/>[server_api.php]"]
  node_rack_handlers["Rack handlers<br/>[rack_api.php]"]
  node_location_handlers["Location handlers<br/>[location_api.php]"]
  node_location["Location resolver"]
  node_inventory_service["Inventory services<br/>[Inventory.php]"]
end

subgraph group_configuration["Configuration and validation"]
  node_server_builder["Server builder<br/>[ServerBuilder.php]"]
  node_component_data["Component data"]
  node_spec_paths["Spec paths"]
  node_compatibility["Compatibility checks"]
  node_validation["Validation engine"]
  node_validation_rules["Validation rules"]
  node_target_state["Target state<br/>[TargetState.php]"]
end

subgraph group_shared["Shared services"]
  node_requests["Request parsing<br/>[RequestHelper.php]"]
  node_schema["Schema probes<br/>[SchemaHelper.php]"]
  node_notifications["Notifications"]
end

node_caller(("API client"))
node_database[("Application database")]

node_caller -->|"sends requests"| node_api
node_api -->|"routes to"| node_auth
node_api -->|"routes to"| node_server_handlers
node_api -->|"routes to"| node_rack_handlers
node_api -->|"routes to"| node_location_handlers
node_api -->|"routes to"| node_access
node_api -->|"loads"| node_requests
node_pipeline_handlers -->|"parses requests"| node_requests
node_pipeline_handlers -->|"creates pipelines"| node_pipeline_manager
node_pipeline_manager -->|"uses templates"| node_templates
node_pipeline_manager -->|"uses ticket services"| node_tickets
node_pipeline_manager -->|"executes actions"| node_actions
node_pipeline_manager -->|"reads config"| node_workflow_config
node_pipeline_manager -->|"builds servers"| node_server_builder
node_pipeline_manager -->|"resolves locations"| node_location
node_pipeline_manager -->|"loads notifications"| node_notifications
node_pipeline_manager -->|"updates records"| node_database
node_pipeline_manager -->|"returns outcome"| node_caller
node_server_handlers -.->|"reads and writes"| node_database
node_rack_handlers -.->|"reads and writes"| node_database
node_location_handlers -.->|"resolves locations"| node_location
node_location -->|"probes schema"| node_schema
node_location -->|"queries location data"| node_database
node_inventory_service -->|"uses component data"| node_component_data
node_inventory_service -->|"reads spec paths"| node_spec_paths
node_inventory_service -.->|"accesses inventory"| node_database
node_component_data -->|"resolves spec files"| node_spec_paths
node_compatibility -->|"loads component data"| node_component_data
node_compatibility -.->|"checks configuration"| node_database
node_validation -->|"dispatches rules"| node_validation_rules
node_validation_rules -->|"evaluates state"| node_target_state
node_validation -->|"evaluates"| node_target_state
node_server_builder -.->|"validates configuration"| node_validation
node_server_builder -.->|"uses component specs"| node_component_data
node_microsoft -.->|"authenticates"| node_caller

click node_api "https://github.com/anshitsharma/ims-ftp/blob/main/api/api.php"
click node_auth "https://github.com/anshitsharma/ims-ftp/tree/main/api/handlers/auth"
click node_access "https://github.com/anshitsharma/ims-ftp/tree/main/api/handlers/acl"
click node_pipeline_handlers "https://github.com/anshitsharma/ims-ftp/tree/main/api/handlers/pipelines"
click node_pipeline_manager "https://github.com/anshitsharma/ims-ftp/blob/main/core/models/pipelines/PipelineManager.php"
click node_templates "https://github.com/anshitsharma/ims-ftp/blob/main/core/models/pipelines/PipelineTemplateManager.php"
click node_actions "https://github.com/anshitsharma/ims-ftp/blob/main/core/models/pipelines/RequestActionExecutor.php"
click node_tickets "https://github.com/anshitsharma/ims-ftp/tree/main/core/models/tickets"
click node_workflow_config "https://github.com/anshitsharma/ims-ftp/blob/main/core/config/WorkflowConfig.php"
click node_server_handlers "https://github.com/anshitsharma/ims-ftp/blob/main/api/handlers/server/server_api.php"
click node_rack_handlers "https://github.com/anshitsharma/ims-ftp/blob/main/api/handlers/rack/rack_api.php"
click node_location_handlers "https://github.com/anshitsharma/ims-ftp/blob/main/api/handlers/location/location_api.php"
click node_location "https://github.com/anshitsharma/ims-ftp/blob/main/core/models/location/LocationResolver.php"
click node_inventory_service "https://github.com/anshitsharma/ims-ftp/blob/main/core/helpers/Inventory.php"
click node_server_builder "https://github.com/anshitsharma/ims-ftp/blob/main/core/models/server/ServerBuilder.php"
click node_component_data "https://github.com/anshitsharma/ims-ftp/blob/main/core/models/components/ComponentDataService.php"
click node_spec_paths "https://github.com/anshitsharma/ims-ftp/blob/main/core/models/components/ComponentSpecPaths.php"
click node_compatibility "https://github.com/anshitsharma/ims-ftp/blob/main/core/models/compatibility/StorageConnectionValidator.php"
click node_validation "https://github.com/anshitsharma/ims-ftp/blob/main/core/models/validation/ValidationEngine.php"
click node_validation_rules "https://github.com/anshitsharma/ims-ftp/tree/main/core/models/validation/rules"
click node_target_state "https://github.com/anshitsharma/ims-ftp/blob/main/core/models/validation/TargetState.php"
click node_requests "https://github.com/anshitsharma/ims-ftp/blob/main/core/helpers/RequestHelper.php"
click node_schema "https://github.com/anshitsharma/ims-ftp/blob/main/core/helpers/SchemaHelper.php"
click node_notifications "https://github.com/anshitsharma/ims-ftp/blob/main/core/helpers/NotificationService.php"
click node_microsoft "https://github.com/anshitsharma/ims-ftp/blob/main/core/auth/MicrosoftOAuth.php"

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_api,node_auth,node_access,node_microsoft,node_caller toneBlue
class node_pipeline_handlers,node_pipeline_manager,node_templates,node_actions,node_tickets,node_workflow_config,node_database toneAmber
class node_server_handlers,node_rack_handlers,node_location_handlers,node_location,node_inventory_service toneMint
class node_server_builder,node_component_data,node_spec_paths,node_compatibility,node_validation,node_validation_rules,node_target_state toneRose
class node_requests,node_schema,node_notifications toneIndigo
```

## Components

### API and identity

- [API router](https://github.com/anshitsharma/ims-ftp/blob/main/api/api.php): `api/api.php`
- [Authentication handlers](https://github.com/anshitsharma/ims-ftp/tree/main/api/handlers/auth): `api/handlers/auth`
- [ACL handlers](https://github.com/anshitsharma/ims-ftp/tree/main/api/handlers/acl): `api/handlers/acl`
- [Microsoft OAuth](https://github.com/anshitsharma/ims-ftp/blob/main/core/auth/MicrosoftOAuth.php): `core/auth/MicrosoftOAuth.php`

### Pipeline workflows

- [Pipeline handlers](https://github.com/anshitsharma/ims-ftp/tree/main/api/handlers/pipelines): `api/handlers/pipelines`
- [Pipeline engine](https://github.com/anshitsharma/ims-ftp/blob/main/core/models/pipelines/PipelineManager.php): `core/models/pipelines/PipelineManager.php`
- [Pipeline templates](https://github.com/anshitsharma/ims-ftp/blob/main/core/models/pipelines/PipelineTemplateManager.php): `core/models/pipelines/PipelineTemplateManager.php`
- [Action executor](https://github.com/anshitsharma/ims-ftp/blob/main/core/models/pipelines/RequestActionExecutor.php): `core/models/pipelines/RequestActionExecutor.php`
- [Ticket services](https://github.com/anshitsharma/ims-ftp/tree/main/core/models/tickets): `core/models/tickets`
- [Workflow config](https://github.com/anshitsharma/ims-ftp/blob/main/core/config/WorkflowConfig.php): `core/config/WorkflowConfig.php`

### Inventory and location

- [Server handlers](https://github.com/anshitsharma/ims-ftp/blob/main/api/handlers/server/server_api.php): `api/handlers/server/server_api.php`
- [Rack handlers](https://github.com/anshitsharma/ims-ftp/blob/main/api/handlers/rack/rack_api.php): `api/handlers/rack/rack_api.php`
- [Location handlers](https://github.com/anshitsharma/ims-ftp/blob/main/api/handlers/location/location_api.php): `api/handlers/location/location_api.php`
- [Location resolver](https://github.com/anshitsharma/ims-ftp/blob/main/core/models/location/LocationResolver.php): `core/models/location/LocationResolver.php`
- [Inventory services](https://github.com/anshitsharma/ims-ftp/blob/main/core/helpers/Inventory.php): `core/helpers/Inventory.php`

### Configuration and validation

- [Server builder](https://github.com/anshitsharma/ims-ftp/blob/main/core/models/server/ServerBuilder.php): `core/models/server/ServerBuilder.php`
- [Component data](https://github.com/anshitsharma/ims-ftp/blob/main/core/models/components/ComponentDataService.php): `core/models/components/ComponentDataService.php`
- [Spec paths](https://github.com/anshitsharma/ims-ftp/blob/main/core/models/components/ComponentSpecPaths.php): `core/models/components/ComponentSpecPaths.php`
- [Compatibility checks](https://github.com/anshitsharma/ims-ftp/blob/main/core/models/compatibility/StorageConnectionValidator.php): `core/models/compatibility/StorageConnectionValidator.php`
- [Validation engine](https://github.com/anshitsharma/ims-ftp/blob/main/core/models/validation/ValidationEngine.php): `core/models/validation/ValidationEngine.php`
- [Validation rules](https://github.com/anshitsharma/ims-ftp/tree/main/core/models/validation/rules): `core/models/validation/rules`
- [Target state](https://github.com/anshitsharma/ims-ftp/blob/main/core/models/validation/TargetState.php): `core/models/validation/TargetState.php`

### Shared services

- [Request parsing](https://github.com/anshitsharma/ims-ftp/blob/main/core/helpers/RequestHelper.php): `core/helpers/RequestHelper.php`
- [Schema probes](https://github.com/anshitsharma/ims-ftp/blob/main/core/helpers/SchemaHelper.php): `core/helpers/SchemaHelper.php`
- [Notifications](https://github.com/anshitsharma/ims-ftp/blob/main/core/helpers/NotificationService.php): `core/helpers/NotificationService.php`

### Other components

- **API client**
- **Application database**

## Connections

- API client → API router: sends requests
- API router → Authentication handlers: routes to (evidence: `api/api.php`)
- API router → Server handlers: routes to (evidence: `api/api.php`)
- API router → Rack handlers: routes to (evidence: `api/api.php`)
- API router → Location handlers: routes to (evidence: `api/api.php`)
- API router → ACL handlers: routes to (evidence: `api/api.php`)
- API router → Request parsing: loads (evidence: `api/api.php`)
- Pipeline handlers → Request parsing: parses requests (evidence: `api/handlers/pipelines/pipeline-create.php`)
- Pipeline handlers → Pipeline engine: creates pipelines (evidence: `api/handlers/pipelines/pipeline-create.php`)
- Pipeline engine → Pipeline templates: uses templates (evidence: `core/models/pipelines/PipelineManager.php`)
- Pipeline engine → Ticket services: uses ticket services (evidence: `core/models/pipelines/PipelineManager.php`)
- Pipeline engine → Action executor: executes actions (evidence: `core/models/pipelines/PipelineManager.php`)
- Pipeline engine → Workflow config: reads config (evidence: `core/models/pipelines/PipelineManager.php`)
- Pipeline engine → Server builder: builds servers (evidence: `core/models/pipelines/PipelineManager.php`)
- Pipeline engine → Location resolver: resolves locations (evidence: `core/models/pipelines/PipelineManager.php`)
- Pipeline engine → Notifications: loads notifications (evidence: `core/models/pipelines/PipelineManager.php`)
- Pipeline engine → Application database: updates records (evidence: `core/models/pipelines/PipelineManager.php`)
- Pipeline engine → API client: returns outcome (evidence: `core/models/pipelines/PipelineManager.php`)
- Server handlers → Application database: reads and writes
- Rack handlers → Application database: reads and writes
- Location handlers → Location resolver: resolves locations
- Location resolver → Schema probes: probes schema (evidence: `core/models/location/LocationResolver.php`)
- Location resolver → Application database: queries location data (evidence: `core/models/location/LocationResolver.php`)
- Inventory services → Component data: uses component data (evidence: `core/helpers/Inventory.php`)
- Inventory services → Spec paths: reads spec paths (evidence: `core/helpers/Inventory.php`)
- Inventory services → Application database: accesses inventory
- Component data → Spec paths: resolves spec files (evidence: `core/models/components/ComponentDataService.php`)
- Compatibility checks → Component data: loads component data (evidence: `core/models/compatibility/StorageConnectionValidator.php`)
- Compatibility checks → Application database: checks configuration
- Validation engine → Validation rules: dispatches rules (evidence: `core/models/validation/ValidationEngine.php`)
- Validation rules → Target state: evaluates state (evidence: `core/models/validation/rules/StorageBayCapacityRule.php`)
- Validation engine → Target state: evaluates (evidence: `core/models/validation/ValidationEngine.php`)
- Server builder → Validation engine: validates configuration (evidence: `core/models/server/ServerBuilder.php`)
- Server builder → Component data: uses component specs (evidence: `core/models/server/ServerBuilder.php`)
- Microsoft OAuth → API client: authenticates
