# rohitz999/devops-assessment architecture

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

- Interactive diagram: https://gitdiagram.com/rohitz999/devops-assessment
- Repository: https://github.com/rohitz999/devops-assessment

## Overview

This repository provides infrastructure and database automation for a hotel-booking platform, rather than the booking application itself. The operator’s workflows are to provision dev or prod AWS infrastructure with Terraform, and to run PostgreSQL locally, where initialization scripts create and populate the booking schema; separate scripts support database backup and restore. The map preserves the documented Terraform modules and database lifecycle stages. Source excerpts were unavailable, so relationships are limited to those stated in the README.

Main entry points: [`database/docker-compose.yml`](https://github.com/rohitz999/devops-assessment/blob/main/database/docker-compose.yml) (Compose setup), [`infra/envs/dev`](https://github.com/rohitz999/devops-assessment/tree/main/infra/envs/dev) (Dev environment), [`infra/envs/prod`](https://github.com/rohitz999/devops-assessment/tree/main/infra/envs/prod) (Prod environment), [`infra/modules/network`](https://github.com/rohitz999/devops-assessment/tree/main/infra/modules/network) (Network module)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_infra["Cloud infrastructure"]
  node_dev["Dev environment"]
  node_prod["Prod environment"]
  node_network["Network module"]
  node_alb["Load balancer module"]
  node_ecs["ECS module"]
  node_rds["RDS module"]
end

subgraph group_db["Database lifecycle"]
  node_compose["Compose setup<br/>[docker-compose.yml]"]
  node_schema["Booking tables"]
  node_seed["Seed records<br/>[002_seed_data.sql]"]
  node_indexes["Booking indexes<br/>[003_indexes.sql]"]
  node_events["Booking events"]
  node_postgres[("PostgreSQL")]
end

subgraph group_ops["Database operations"]
  node_backup["Backup<br/>[backup.sh]"]
  node_restore["Restore<br/>[restore.sh]"]
end

node_operator(("Operator"))
node_aws{{"AWS resources"}}

node_operator -->|"runs Terraform"| node_dev
node_operator -->|"runs Terraform"| node_prod
node_dev -->|"uses modules"| node_network
node_dev -->|"uses modules"| node_alb
node_dev -->|"uses modules"| node_ecs
node_dev -->|"uses modules"| node_rds
node_prod -->|"uses modules"| node_network
node_prod -->|"uses modules"| node_alb
node_prod -->|"uses modules"| node_ecs
node_prod -->|"uses modules"| node_rds
node_network -->|"provisions resources"| node_aws
node_alb -->|"provisions resources"| node_aws
node_ecs -->|"provisions resources"| node_aws
node_rds -->|"provisions resources"| node_aws
node_operator -->|"starts database"| node_compose
node_compose -->|"starts PostgreSQL"| node_postgres
node_compose -->|"initializes tables"| node_schema
node_compose -->|"loads seed data"| node_seed
node_compose -->|"creates indexes"| node_indexes
node_compose -->|"initializes events"| node_events
node_operator -->|"runs backup"| node_backup
node_backup -->|"dumps database"| node_postgres
node_operator -->|"runs restore"| node_restore
node_restore -->|"restores database"| node_postgres

click node_dev "https://github.com/rohitz999/devops-assessment/tree/main/infra/envs/dev"
click node_prod "https://github.com/rohitz999/devops-assessment/tree/main/infra/envs/prod"
click node_network "https://github.com/rohitz999/devops-assessment/tree/main/infra/modules/network"
click node_alb "https://github.com/rohitz999/devops-assessment/tree/main/infra/modules/alb"
click node_ecs "https://github.com/rohitz999/devops-assessment/tree/main/infra/modules/ecs"
click node_rds "https://github.com/rohitz999/devops-assessment/tree/main/infra/modules/rds"
click node_compose "https://github.com/rohitz999/devops-assessment/blob/main/database/docker-compose.yml"
click node_schema "https://github.com/rohitz999/devops-assessment/blob/main/database/init/001_create_tables.sql"
click node_seed "https://github.com/rohitz999/devops-assessment/blob/main/database/init/002_seed_data.sql"
click node_indexes "https://github.com/rohitz999/devops-assessment/blob/main/database/init/003_indexes.sql"
click node_events "https://github.com/rohitz999/devops-assessment/blob/main/database/init/004_booking_events.sql"
click node_backup "https://github.com/rohitz999/devops-assessment/blob/main/scripts/backup.sh"
click node_restore "https://github.com/rohitz999/devops-assessment/blob/main/scripts/restore.sh"

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_dev,node_prod,node_network,node_alb,node_ecs,node_rds toneBlue
class node_compose,node_schema,node_seed,node_indexes,node_events,node_postgres toneAmber
class node_backup,node_restore toneMint
class node_operator,node_aws toneIndigo
```

## Components

### Cloud infrastructure

- [Dev environment](https://github.com/rohitz999/devops-assessment/tree/main/infra/envs/dev): `infra/envs/dev`
- [Prod environment](https://github.com/rohitz999/devops-assessment/tree/main/infra/envs/prod): `infra/envs/prod`
- [Network module](https://github.com/rohitz999/devops-assessment/tree/main/infra/modules/network): `infra/modules/network`
- [Load balancer module](https://github.com/rohitz999/devops-assessment/tree/main/infra/modules/alb): `infra/modules/alb`
- [ECS module](https://github.com/rohitz999/devops-assessment/tree/main/infra/modules/ecs): `infra/modules/ecs`
- [RDS module](https://github.com/rohitz999/devops-assessment/tree/main/infra/modules/rds): `infra/modules/rds`

### Database lifecycle

- [Compose setup](https://github.com/rohitz999/devops-assessment/blob/main/database/docker-compose.yml): `database/docker-compose.yml`
- [Booking tables](https://github.com/rohitz999/devops-assessment/blob/main/database/init/001_create_tables.sql): `database/init/001_create_tables.sql`
- [Seed records](https://github.com/rohitz999/devops-assessment/blob/main/database/init/002_seed_data.sql): `database/init/002_seed_data.sql`
- [Booking indexes](https://github.com/rohitz999/devops-assessment/blob/main/database/init/003_indexes.sql): `database/init/003_indexes.sql`
- [Booking events](https://github.com/rohitz999/devops-assessment/blob/main/database/init/004_booking_events.sql): `database/init/004_booking_events.sql`
- **PostgreSQL**

### Database operations

- [Backup](https://github.com/rohitz999/devops-assessment/blob/main/scripts/backup.sh): `scripts/backup.sh`
- [Restore](https://github.com/rohitz999/devops-assessment/blob/main/scripts/restore.sh): `scripts/restore.sh`

### Other components

- **Operator**
- **AWS resources**

## Connections

- Operator → Dev environment: runs Terraform (evidence: `README.md`)
- Operator → Prod environment: runs Terraform (evidence: `README.md`)
- Dev environment → Network module: uses modules (evidence: `README.md`)
- Dev environment → Load balancer module: uses modules (evidence: `README.md`)
- Dev environment → ECS module: uses modules (evidence: `README.md`)
- Dev environment → RDS module: uses modules (evidence: `README.md`)
- Prod environment → Network module: uses modules (evidence: `README.md`)
- Prod environment → Load balancer module: uses modules (evidence: `README.md`)
- Prod environment → ECS module: uses modules (evidence: `README.md`)
- Prod environment → RDS module: uses modules (evidence: `README.md`)
- Network module → AWS resources: provisions resources (evidence: `README.md`)
- Load balancer module → AWS resources: provisions resources (evidence: `README.md`)
- ECS module → AWS resources: provisions resources (evidence: `README.md`)
- RDS module → AWS resources: provisions resources (evidence: `README.md`)
- Operator → Compose setup: starts database (evidence: `README.md`)
- Compose setup → PostgreSQL: starts PostgreSQL (evidence: `README.md`)
- Compose setup → Booking tables: initializes tables (evidence: `README.md`)
- Compose setup → Seed records: loads seed data (evidence: `README.md`)
- Compose setup → Booking indexes: creates indexes (evidence: `README.md`)
- Compose setup → Booking events: initializes events (evidence: `README.md`)
- Operator → Backup: runs backup (evidence: `README.md`)
- Backup → PostgreSQL: dumps database (evidence: `README.md`)
- Operator → Restore: runs restore (evidence: `README.md`)
- Restore → PostgreSQL: restores database (evidence: `README.md`)
