# ganesang/snipe-it architecture

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

- Interactive diagram: https://gitdiagram.com/ganesang/snipe-it
- Repository: https://github.com/ganesang/snipe-it

## Overview

This repository automates deploying Snipe-IT and MySQL on AWS: an operator configures and applies Terraform, which provisions the cloud deployment; Docker Compose runs the application services. The deployment also schedules daily MySQL backups to S3 and keeps service configuration there for use if the EC2 instance must be recreated. The graph reflects README-documented relationships only; source excerpts were not provided, so internal Terraform resource details and service-level interactions are not inferred.

Main entry points: [`deployment`](https://github.com/ganesang/snipe-it/tree/main/deployment) (S3 bucket), [`src/docker-compose.yml`](https://github.com/ganesang/snipe-it/blob/main/src/docker-compose.yml) (Docker Compose), [`deployment/snipeit/main.tf`](https://github.com/ganesang/snipe-it/blob/main/deployment/snipeit/main.tf) (Backup cron job), [`deployment/snipeit`](https://github.com/ganesang/snipe-it/tree/main/deployment/snipeit) (EC2 instance)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_deployment["Cloud deployment"]
  node_terraform["Terraform config"]
  node_aws["AWS resources"]
  node_ec2["EC2 instance"]
end

subgraph group_services["Application services"]
  node_compose["Docker Compose<br/>[docker-compose.yml]"]
  node_snipeit["Snipe-IT<br/>[docker-compose.yml]"]
  node_mysql[("MySQL<br/>[docker-compose.yml]")]
end

subgraph group_operations["Recovery and backups"]
  node_backup_job["Backup cron job<br/>[main.tf]"]
  node_s3[("S3 bucket")]
  node_service_config["Service configuration<br/>[env.example]"]
end

node_operator(("Operator"))

node_operator -->|"configures and applies"| node_terraform
node_terraform -->|"provisions resources"| node_aws
node_compose -->|"runs"| node_snipeit
node_compose -->|"runs"| node_mysql
node_backup_job -->|"backs up"| node_mysql
node_backup_job -->|"stores backups"| node_s3
node_operator -->|"uploads configuration"| node_s3
node_s3 -->|"supplies configuration on recreation"| node_ec2

click node_terraform "https://github.com/ganesang/snipe-it/tree/main/deployment"
click node_compose "https://github.com/ganesang/snipe-it/blob/main/src/docker-compose.yml"
click node_snipeit "https://github.com/ganesang/snipe-it/blob/main/src/docker-compose.yml"
click node_mysql "https://github.com/ganesang/snipe-it/blob/main/src/docker-compose.yml"
click node_backup_job "https://github.com/ganesang/snipe-it/blob/main/deployment/snipeit/main.tf"
click node_s3 "https://github.com/ganesang/snipe-it/tree/main/deployment"
click node_service_config "https://github.com/ganesang/snipe-it/blob/main/src/env.example"
click node_ec2 "https://github.com/ganesang/snipe-it/tree/main/deployment/snipeit"

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_terraform,node_aws,node_ec2 toneBlue
class node_compose,node_snipeit,node_mysql toneAmber
class node_backup_job,node_s3,node_service_config toneMint
class node_operator toneIndigo
```

## Components

### Cloud deployment

- [Terraform config](https://github.com/ganesang/snipe-it/tree/main/deployment): `deployment`
- **AWS resources**
- [EC2 instance](https://github.com/ganesang/snipe-it/tree/main/deployment/snipeit): `deployment/snipeit`

### Application services

- [Docker Compose](https://github.com/ganesang/snipe-it/blob/main/src/docker-compose.yml): `src/docker-compose.yml`
- [Snipe-IT](https://github.com/ganesang/snipe-it/blob/main/src/docker-compose.yml): `src/docker-compose.yml`
- [MySQL](https://github.com/ganesang/snipe-it/blob/main/src/docker-compose.yml): `src/docker-compose.yml`

### Recovery and backups

- [Backup cron job](https://github.com/ganesang/snipe-it/blob/main/deployment/snipeit/main.tf): `deployment/snipeit/main.tf`
- [S3 bucket](https://github.com/ganesang/snipe-it/tree/main/deployment): `deployment`
- [Service configuration](https://github.com/ganesang/snipe-it/blob/main/src/env.example): `src/env.example`

### Other components

- **Operator**

## Connections

- Operator → Terraform config: configures and applies (evidence: `README.org`)
- Terraform config → AWS resources: provisions resources (evidence: `README.org`)
- Docker Compose → Snipe-IT: runs (evidence: `README.org`)
- Docker Compose → MySQL: runs (evidence: `README.org`)
- Backup cron job → MySQL: backs up (evidence: `README.org`)
- Backup cron job → S3 bucket: stores backups (evidence: `README.org`)
- Operator → S3 bucket: uploads configuration (evidence: `README.org`)
- S3 bucket → EC2 instance: supplies configuration on recreation (evidence: `README.org`)
