# kiran04-code/image-building_microservice architecture

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

- Interactive diagram: https://gitdiagram.com/kiran04-code/image-building_microservice
- Repository: https://github.com/kiran04-code/image-building_microservice

## Overview

ImageForge is a source-to-container-image microservice with a React console and an API for starting builds and polling their status. The core path is: submit a GitHub repository, inspect its files, detect its stack, generate a Dockerfile when needed, then start AWS CodeBuild to build and push an image to ECR; status reads query CodeBuild. The frontend also presents build history and API documentation, though the shown history rows are local sample data. Edges follow the excerpts and README; unsampled implementation details are omitted.

Main entry points: [`Source_image_Platfrom/backend/services/build.service.ts`](https://github.com/kiran04-code/image-building_microservice/blob/main/Source_image_Platfrom/backend/services/build.service.ts) (Build orchestration), [`Source_image_Platfrom/frontend/src/App.tsx`](https://github.com/kiran04-code/image-building_microservice/blob/main/Source_image_Platfrom/frontend/src/App.tsx) (Build console), [`Source_image_Platfrom/backend/src/index.ts`](https://github.com/kiran04-code/image-building_microservice/blob/main/Source_image_Platfrom/backend/src/index.ts) (Express server), [`Source_image_Platfrom/backend/src/routes/build.route.ts`](https://github.com/kiran04-code/image-building_microservice/blob/main/Source_image_Platfrom/backend/src/routes/build.route.ts) (Build routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User interface"]
  node_console["Build console<br/>[App.tsx]"]
  node_frontend_entry["React entry<br/>[main.tsx]"]
  node_api_docs["API docs and tester<br/>[App.tsx]"]
end

subgraph group_api["Build API"]
  node_api_server["Express server<br/>[index.ts]"]
  node_build_routes["Build routes<br/>[build.route.ts]"]
  node_build_controller["Build controller"]
end

subgraph group_analysis["Repository analysis"]
  node_github_inspection["GitHub inspection<br/>[github.service.ts]"]
  node_project_detection["Project detection"]
  node_dockerfile_generation["Dockerfile generation"]
end

subgraph group_build["Image build and registry"]
  node_build_service["Build orchestration<br/>[build.service.ts]"]
  node_codebuild["AWS CodeBuild"]
  node_ecr[("Amazon ECR")]
end

node_user(("Build user"))
node_github["GitHub repository"]

node_user -->|"submits repository"| node_console
node_frontend_entry -->|"renders"| node_console
node_console -->|"starts and polls builds"| node_api_server
node_api_docs -.->|"tests API"| node_api_server
node_api_server -->|"mounts routes"| node_build_routes
node_build_routes -->|"dispatches requests"| node_build_controller
node_build_controller -->|"starts or reads build"| node_build_service
node_build_service -->|"inspects repository"| node_github_inspection
node_github_inspection -->|"reads repository metadata"| node_github
node_build_service -->|"detects project"| node_project_detection
node_build_service -->|"generates Dockerfile"| node_dockerfile_generation
node_dockerfile_generation -->|"uses detection result"| node_project_detection
node_build_service -->|"starts and queries builds"| node_codebuild
node_codebuild -->|"fetches build source"| node_github
node_codebuild -->|"pushes image"| node_ecr

click node_console "https://github.com/kiran04-code/image-building_microservice/blob/main/Source_image_Platfrom/frontend/src/App.tsx"
click node_frontend_entry "https://github.com/kiran04-code/image-building_microservice/blob/main/Source_image_Platfrom/frontend/src/main.tsx"
click node_api_docs "https://github.com/kiran04-code/image-building_microservice/blob/main/Source_image_Platfrom/frontend/src/App.tsx"
click node_api_server "https://github.com/kiran04-code/image-building_microservice/blob/main/Source_image_Platfrom/backend/src/index.ts"
click node_build_routes "https://github.com/kiran04-code/image-building_microservice/blob/main/Source_image_Platfrom/backend/src/routes/build.route.ts"
click node_build_controller "https://github.com/kiran04-code/image-building_microservice/blob/main/Source_image_Platfrom/backend/src/controller/build.controller.ts"
click node_build_service "https://github.com/kiran04-code/image-building_microservice/blob/main/Source_image_Platfrom/backend/services/build.service.ts"
click node_github_inspection "https://github.com/kiran04-code/image-building_microservice/blob/main/Source_image_Platfrom/backend/services/github.service.ts"
click node_project_detection "https://github.com/kiran04-code/image-building_microservice/blob/main/Source_image_Platfrom/backend/services/project-detector.service.ts"
click node_dockerfile_generation "https://github.com/kiran04-code/image-building_microservice/blob/main/Source_image_Platfrom/backend/services/dockerfile-generator.service.ts"

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_console,node_frontend_entry,node_api_docs,node_user toneBlue
class node_api_server,node_build_routes,node_build_controller toneAmber
class node_github_inspection,node_project_detection,node_dockerfile_generation toneMint
class node_build_service,node_codebuild,node_ecr toneRose
class node_github toneIndigo
```

## Components

### User interface

- [Build console](https://github.com/kiran04-code/image-building_microservice/blob/main/Source_image_Platfrom/frontend/src/App.tsx): `Source_image_Platfrom/frontend/src/App.tsx`
- [React entry](https://github.com/kiran04-code/image-building_microservice/blob/main/Source_image_Platfrom/frontend/src/main.tsx): `Source_image_Platfrom/frontend/src/main.tsx`
- [API docs and tester](https://github.com/kiran04-code/image-building_microservice/blob/main/Source_image_Platfrom/frontend/src/App.tsx): `Source_image_Platfrom/frontend/src/App.tsx`

### Build API

- [Express server](https://github.com/kiran04-code/image-building_microservice/blob/main/Source_image_Platfrom/backend/src/index.ts): `Source_image_Platfrom/backend/src/index.ts`
- [Build routes](https://github.com/kiran04-code/image-building_microservice/blob/main/Source_image_Platfrom/backend/src/routes/build.route.ts): `Source_image_Platfrom/backend/src/routes/build.route.ts`
- [Build controller](https://github.com/kiran04-code/image-building_microservice/blob/main/Source_image_Platfrom/backend/src/controller/build.controller.ts): `Source_image_Platfrom/backend/src/controller/build.controller.ts`

### Repository analysis

- [GitHub inspection](https://github.com/kiran04-code/image-building_microservice/blob/main/Source_image_Platfrom/backend/services/github.service.ts): `Source_image_Platfrom/backend/services/github.service.ts`
- [Project detection](https://github.com/kiran04-code/image-building_microservice/blob/main/Source_image_Platfrom/backend/services/project-detector.service.ts): `Source_image_Platfrom/backend/services/project-detector.service.ts`
- [Dockerfile generation](https://github.com/kiran04-code/image-building_microservice/blob/main/Source_image_Platfrom/backend/services/dockerfile-generator.service.ts): `Source_image_Platfrom/backend/services/dockerfile-generator.service.ts`

### Image build and registry

- [Build orchestration](https://github.com/kiran04-code/image-building_microservice/blob/main/Source_image_Platfrom/backend/services/build.service.ts): `Source_image_Platfrom/backend/services/build.service.ts`
- **AWS CodeBuild**
- **Amazon ECR**

### Other components

- **Build user**
- **GitHub repository**

## Connections

- Build user → Build console: submits repository (evidence: `Source_image_Platfrom/frontend/src/App.tsx`)
- React entry → Build console: renders (evidence: `Source_image_Platfrom/frontend/src/main.tsx`)
- Build console → Express server: starts and polls builds (evidence: `Source_image_Platfrom/frontend/src/App.tsx`)
- API docs and tester → Express server: tests API
- Express server → Build routes: mounts routes (evidence: `Source_image_Platfrom/backend/src/index.ts`)
- Build routes → Build controller: dispatches requests (evidence: `Source_image_Platfrom/backend/src/routes/build.route.ts`)
- Build controller → Build orchestration: starts or reads build (evidence: `Source_image_Platfrom/backend/src/controller/build.controller.ts`)
- Build orchestration → GitHub inspection: inspects repository (evidence: `Source_image_Platfrom/backend/services/build.service.ts`)
- GitHub inspection → GitHub repository: reads repository metadata (evidence: `Source_image_Platfrom/backend/services/github.service.ts`)
- Build orchestration → Project detection: detects project (evidence: `Source_image_Platfrom/backend/services/build.service.ts`)
- Build orchestration → Dockerfile generation: generates Dockerfile (evidence: `Source_image_Platfrom/backend/services/build.service.ts`)
- Dockerfile generation → Project detection: uses detection result (evidence: `Source_image_Platfrom/backend/services/dockerfile-generator.service.ts`)
- Build orchestration → AWS CodeBuild: starts and queries builds (evidence: `Source_image_Platfrom/backend/services/build.service.ts`)
- AWS CodeBuild → GitHub repository: fetches build source
- AWS CodeBuild → Amazon ECR: pushes image
