# alexandr1830/labs_web architecture

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

- Interactive diagram: https://gitdiagram.com/alexandr1830/labs_web
- Repository: https://github.com/alexandr1830/labs_web

## Overview

This is a small Go web app for browsing a catalog of document-like orders. A user opens the listing, optionally searches by title, or follows an order detail route; handlers retrieve in-memory records and render HTML templates. The API server wires routes, repository, templates, and static resources. The README is empty, so the graph reflects only the sampled source and file tree; template contents and browser-side behavior are not inspected.

Main entry points: [`lab1/internal/api/server.go`](https://github.com/alexandr1830/labs_web/blob/master/lab1/internal/api/server.go) (HTTP server), [`lab1/internal/app/handler/handler.go`](https://github.com/alexandr1830/labs_web/blob/master/lab1/internal/app/handler/handler.go) (Order handlers), [`lab1/internal/app/repository/repository.go`](https://github.com/alexandr1830/labs_web/blob/master/lab1/internal/app/repository/repository.go) (Order repository), [`lab1/cmd/awesomeProject/main.go`](https://github.com/alexandr1830/labs_web/blob/master/lab1/cmd/awesomeProject/main.go) (Program entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_main["Program entry<br/>[main.go]"]
end

subgraph group_web["Web layer"]
  node_server["HTTP server<br/>[server.go]"]
  node_handler["Order handlers<br/>[handler.go]"]
  node_listing["Order listing<br/>[index.html]"]
  node_detail["Order detail<br/>[order.html]"]
  node_assets["Static resources"]
end

subgraph group_catalog["Order catalog"]
  node_repository["Order repository<br/>[repository.go]"]
end

node_user(("Browser user"))

node_user -->|"requests pages"| node_server
node_main -->|"starts"| node_server
node_server -->|"creates"| node_repository
node_server -->|"constructs"| node_handler
node_server -->|"routes requests"| node_handler
node_handler -->|"queries"| node_repository
node_handler -->|"renders listing"| node_listing
node_handler -->|"renders detail"| node_detail
node_server -->|"serves static files"| node_assets

click node_main "https://github.com/alexandr1830/labs_web/blob/master/lab1/cmd/awesomeProject/main.go"
click node_server "https://github.com/alexandr1830/labs_web/blob/master/lab1/internal/api/server.go"
click node_handler "https://github.com/alexandr1830/labs_web/blob/master/lab1/internal/app/handler/handler.go"
click node_listing "https://github.com/alexandr1830/labs_web/blob/master/lab1/templates/index.html"
click node_detail "https://github.com/alexandr1830/labs_web/blob/master/lab1/templates/order.html"
click node_assets "https://github.com/alexandr1830/labs_web/tree/master/lab1/resources"
click node_repository "https://github.com/alexandr1830/labs_web/blob/master/lab1/internal/app/repository/repository.go"

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_main,node_user toneBlue
class node_server,node_handler,node_listing,node_detail,node_assets toneAmber
class node_repository toneMint
```

## Components

### Application entry

- [Program entry](https://github.com/alexandr1830/labs_web/blob/master/lab1/cmd/awesomeProject/main.go): `lab1/cmd/awesomeProject/main.go`

### Web layer

- [HTTP server](https://github.com/alexandr1830/labs_web/blob/master/lab1/internal/api/server.go): `lab1/internal/api/server.go`
- [Order handlers](https://github.com/alexandr1830/labs_web/blob/master/lab1/internal/app/handler/handler.go): `lab1/internal/app/handler/handler.go`
- [Order listing](https://github.com/alexandr1830/labs_web/blob/master/lab1/templates/index.html): `lab1/templates/index.html`
- [Order detail](https://github.com/alexandr1830/labs_web/blob/master/lab1/templates/order.html): `lab1/templates/order.html`
- [Static resources](https://github.com/alexandr1830/labs_web/tree/master/lab1/resources): `lab1/resources`

### Order catalog

- [Order repository](https://github.com/alexandr1830/labs_web/blob/master/lab1/internal/app/repository/repository.go): `lab1/internal/app/repository/repository.go`

### Other components

- **Browser user**

## Connections

- Browser user → HTTP server: requests pages (evidence: `lab1/internal/api/server.go`)
- Program entry → HTTP server: starts (evidence: `lab1/cmd/awesomeProject/main.go`)
- HTTP server → Order repository: creates (evidence: `lab1/internal/api/server.go`)
- HTTP server → Order handlers: constructs (evidence: `lab1/internal/api/server.go`)
- HTTP server → Order handlers: routes requests (evidence: `lab1/internal/api/server.go`)
- Order handlers → Order repository: queries (evidence: `lab1/internal/app/handler/handler.go`)
- Order handlers → Order listing: renders listing (evidence: `lab1/internal/app/handler/handler.go`)
- Order handlers → Order detail: renders detail (evidence: `lab1/internal/app/handler/handler.go`)
- HTTP server → Static resources: serves static files (evidence: `lab1/internal/api/server.go`)
