# alladinchik7/my-grpc-service architecture

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

- Interactive diagram: https://gitdiagram.com/alladinchik7/my-grpc-service
- Repository: https://github.com/alladinchik7/my-grpc-service

## Overview

Order Service is a Go gRPC server for creating, reading, updating, deleting, and listing orders. A client sends requests over gRPC to the server started by the command entry point; server handlers delegate to the order service, which translates requests and responses and uses the storage interface. The server constructs an in-memory, concurrency-safe store that generates UUIDs. The README documents the API and port; generated gRPC code is present, but its implementation was not sampled.

Main entry points: [`internal/server/server.go`](https://github.com/alladinchik7/my-grpc-service/blob/main/internal/server/server.go) (RPC handlers), [`cmd/server/main.go`](https://github.com/alladinchik7/my-grpc-service/blob/main/cmd/server/main.go) (Server entry), [`internal/storage/interface.go`](https://github.com/alladinchik7/my-grpc-service/blob/main/internal/storage/interface.go) (Storage interface), [`internal/service/service.go`](https://github.com/alladinchik7/my-grpc-service/blob/main/internal/service/service.go) (Order service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API contract"]
  node_contract["Order RPCs<br/>[api.proto]"]
  node_generated["Generated gRPC API"]
end

subgraph group_runtime["gRPC runtime"]
  node_entry["Server entry<br/>[main.go]"]
  node_handlers["RPC handlers<br/>[server.go]"]
end

subgraph group_domain["Order domain"]
  node_logic["Order service<br/>[service.go]"]
  node_store_interface["Storage interface<br/>[interface.go]"]
  node_memory[("Memory store<br/>[memory.go]")]
end

node_client(("gRPC client"))

node_client -->|"sends RPCs"| node_entry
node_contract -->|"defines RPCs"| node_generated
node_entry -->|"registers service"| node_generated
node_entry -->|"constructs server"| node_handlers
node_handlers -->|"delegates RPCs"| node_logic
node_handlers -->|"constructs store"| node_memory
node_handlers -->|"injects storage"| node_store_interface
node_logic -->|"calls storage"| node_store_interface
node_memory -->|"implements"| node_store_interface

click node_contract "https://github.com/alladinchik7/my-grpc-service/blob/main/api/api.proto"
click node_entry "https://github.com/alladinchik7/my-grpc-service/blob/main/cmd/server/main.go"
click node_handlers "https://github.com/alladinchik7/my-grpc-service/blob/main/internal/server/server.go"
click node_logic "https://github.com/alladinchik7/my-grpc-service/blob/main/internal/service/service.go"
click node_store_interface "https://github.com/alladinchik7/my-grpc-service/blob/main/internal/storage/interface.go"
click node_memory "https://github.com/alladinchik7/my-grpc-service/blob/main/internal/storage/memory.go"
click node_generated "https://github.com/alladinchik7/my-grpc-service/tree/main/pkg/api/test"

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_contract,node_generated,node_client toneBlue
class node_entry,node_handlers toneAmber
class node_logic,node_store_interface,node_memory toneMint
```

## Components

### API contract

- [Order RPCs](https://github.com/alladinchik7/my-grpc-service/blob/main/api/api.proto): `api/api.proto`
- [Generated gRPC API](https://github.com/alladinchik7/my-grpc-service/tree/main/pkg/api/test): `pkg/api/test`

### gRPC runtime

- [Server entry](https://github.com/alladinchik7/my-grpc-service/blob/main/cmd/server/main.go): `cmd/server/main.go`
- [RPC handlers](https://github.com/alladinchik7/my-grpc-service/blob/main/internal/server/server.go): `internal/server/server.go`

### Order domain

- [Order service](https://github.com/alladinchik7/my-grpc-service/blob/main/internal/service/service.go): `internal/service/service.go`
- [Storage interface](https://github.com/alladinchik7/my-grpc-service/blob/main/internal/storage/interface.go): `internal/storage/interface.go`
- [Memory store](https://github.com/alladinchik7/my-grpc-service/blob/main/internal/storage/memory.go): `internal/storage/memory.go`

### Other components

- **gRPC client**

## Connections

- gRPC client → Server entry: sends RPCs (evidence: `README.md`)
- Order RPCs → Generated gRPC API: defines RPCs (evidence: `README.md`)
- Server entry → Generated gRPC API: registers service (evidence: `cmd/server/main.go`)
- Server entry → RPC handlers: constructs server (evidence: `cmd/server/main.go`)
- RPC handlers → Order service: delegates RPCs (evidence: `internal/server/server.go`)
- RPC handlers → Memory store: constructs store (evidence: `internal/server/server.go`)
- RPC handlers → Storage interface: injects storage (evidence: `internal/server/server.go`)
- Order service → Storage interface: calls storage (evidence: `internal/service/service.go`)
- Memory store → Storage interface: implements (evidence: `internal/storage/interface.go`)
