# iamsudhirv/incubytetest architecture

> Architecture diagram of the GitHub repository iamsudhirv/incubytetest, 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/iamsudhirv/incubytetest
- Repository: https://github.com/iamsudhirv/incubytetest

## Overview

Incubyte Salary Management is an API-only Rails application for employee records, salary calculations, and salary metrics. The principal workflow is an API request routed to a v1 controller, which uses the Employee model to read or change employee data and returns JSON. Salary rules and country/job-title aggregations are model responsibilities; SQLite provides persistence. The graph reflects documented endpoints and the sampled routes, controllers, and model. Other Rails runtime details and unsampled implementation are not expanded.

Main entry points: [`app/models/employee.rb`](https://github.com/iamsudhirv/incubytetest/blob/main/app/models/employee.rb) (Employee rules), [`config/routes.rb`](https://github.com/iamsudhirv/incubytetest/blob/main/config/routes.rb) (V1 routes), [`app/controllers/api/v1/employees_controller.rb`](https://github.com/iamsudhirv/incubytetest/blob/main/app/controllers/api/v1/employees_controller.rb) (Employee API), [`app/controllers/api/v1/salary_metrics_controller.rb`](https://github.com/iamsudhirv/incubytetest/blob/main/app/controllers/api/v1/salary_metrics_controller.rb) (Metrics API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API"]
  node_routes["V1 routes<br/>[routes.rb]"]
  node_employee_api["Employee API"]
  node_metrics_api["Metrics API"]
  node_base_controller["API base"]
end

subgraph group_domain["Salary domain"]
  node_employee["Employee rules<br/>[employee.rb]"]
  node_record_base["Record base"]
end

subgraph group_persistence["Persistence"]
  node_sqlite[("SQLite database<br/>[schema.rb]")]
end

subgraph group_runtime["Rails runtime"]
  node_app_config["Application config<br/>[application.rb]"]
  node_boot["Boot setup<br/>[boot.rb]"]
end

node_client(("API client"))

node_client -->|"requests endpoints"| node_routes
node_routes -->|"dispatches employee routes"| node_employee_api
node_routes -->|"dispatches metric routes"| node_metrics_api
node_employee_api -->|"reads and updates"| node_employee
node_metrics_api -->|"queries metrics"| node_employee
node_employee_api -->|"inherits from"| node_base_controller
node_metrics_api -->|"inherits from"| node_base_controller
node_employee -->|"inherits from"| node_record_base
node_employee -->|"persists employee data"| node_sqlite
node_app_config -->|"loads boot setup"| node_boot

click node_routes "https://github.com/iamsudhirv/incubytetest/blob/main/config/routes.rb"
click node_employee_api "https://github.com/iamsudhirv/incubytetest/blob/main/app/controllers/api/v1/employees_controller.rb"
click node_metrics_api "https://github.com/iamsudhirv/incubytetest/blob/main/app/controllers/api/v1/salary_metrics_controller.rb"
click node_base_controller "https://github.com/iamsudhirv/incubytetest/blob/main/app/controllers/application_controller.rb"
click node_employee "https://github.com/iamsudhirv/incubytetest/blob/main/app/models/employee.rb"
click node_record_base "https://github.com/iamsudhirv/incubytetest/blob/main/app/models/application_record.rb"
click node_sqlite "https://github.com/iamsudhirv/incubytetest/blob/main/db/schema.rb"
click node_app_config "https://github.com/iamsudhirv/incubytetest/blob/main/config/application.rb"
click node_boot "https://github.com/iamsudhirv/incubytetest/blob/main/config/boot.rb"

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_routes,node_employee_api,node_metrics_api,node_base_controller,node_client toneBlue
class node_employee,node_record_base toneAmber
class node_sqlite toneMint
class node_app_config,node_boot toneRose
```

## Components

### API

- [V1 routes](https://github.com/iamsudhirv/incubytetest/blob/main/config/routes.rb): `config/routes.rb`
- [Employee API](https://github.com/iamsudhirv/incubytetest/blob/main/app/controllers/api/v1/employees_controller.rb): `app/controllers/api/v1/employees_controller.rb`
- [Metrics API](https://github.com/iamsudhirv/incubytetest/blob/main/app/controllers/api/v1/salary_metrics_controller.rb): `app/controllers/api/v1/salary_metrics_controller.rb`
- [API base](https://github.com/iamsudhirv/incubytetest/blob/main/app/controllers/application_controller.rb): `app/controllers/application_controller.rb`

### Salary domain

- [Employee rules](https://github.com/iamsudhirv/incubytetest/blob/main/app/models/employee.rb): `app/models/employee.rb`
- [Record base](https://github.com/iamsudhirv/incubytetest/blob/main/app/models/application_record.rb): `app/models/application_record.rb`

### Persistence

- [SQLite database](https://github.com/iamsudhirv/incubytetest/blob/main/db/schema.rb): `db/schema.rb`

### Rails runtime

- [Application config](https://github.com/iamsudhirv/incubytetest/blob/main/config/application.rb): `config/application.rb`
- [Boot setup](https://github.com/iamsudhirv/incubytetest/blob/main/config/boot.rb): `config/boot.rb`

### Other components

- **API client**

## Connections

- API client → V1 routes: requests endpoints (evidence: `README.md`)
- V1 routes → Employee API: dispatches employee routes (evidence: `config/routes.rb`)
- V1 routes → Metrics API: dispatches metric routes (evidence: `config/routes.rb`)
- Employee API → Employee rules: reads and updates (evidence: `app/controllers/api/v1/employees_controller.rb`)
- Metrics API → Employee rules: queries metrics (evidence: `app/controllers/api/v1/salary_metrics_controller.rb`)
- Employee API → API base: inherits from (evidence: `app/controllers/api/v1/employees_controller.rb`)
- Metrics API → API base: inherits from (evidence: `app/controllers/api/v1/salary_metrics_controller.rb`)
- Employee rules → Record base: inherits from (evidence: `app/models/employee.rb`)
- Employee rules → SQLite database: persists employee data (evidence: `README.md`)
- Application config → Boot setup: loads boot setup (evidence: `config/application.rb`)
