# domenick1991/students architecture

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

- Interactive diagram: https://gitdiagram.com/domenick1991/students
- Repository: https://github.com/domenick1991/students

## Overview

This is a student-information service exposing gRPC and HTTP/JSON APIs, plus asynchronous Kafka upserts. API requests are translated to domain models, handled by the student service, and backed by PostgreSQL; Kafka messages pass through a consumer and processor into the same service. The graph includes the protobuf contract and the principal runtime components. Several wiring files were indexed but not excerpted, so edges based on those references are limited to visible construction or documented registration; uncertain internal calls are omitted.

Main entry points: [`cmd/app/main.go`](https://github.com/domenick1991/students/blob/master/cmd/app/main.go) (Application startup), [`internal/api/student_service_api`](https://github.com/domenick1991/students/tree/master/internal/api/student_service_api) (Student API handlers), [`internal/services/studentsService`](https://github.com/domenick1991/students/tree/master/internal/services/studentsService) (Student service), [`internal/bootstrap/server.go`](https://github.com/domenick1991/students/blob/master/internal/bootstrap/server.go) (Server runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Runtime entrypoints"]
  node_main["Application startup<br/>[main.go]"]
  node_server["Server runtime<br/>[server.go]"]
end

subgraph group_api["API surface"]
  node_contract["Students API contract<br/>[students.proto]"]
  node_student_model["Student model contract"]
  node_gateway["HTTP gateway<br/>[server.go]"]
  node_api_impl["Student API handlers"]
end

subgraph group_async["Kafka ingestion"]
  node_consumer["Upsert consumer<br/>[consume.go]"]
  node_processor["Upsert processor"]
end

subgraph group_domain["Student domain"]
  node_service["Student service"]
  node_model["Student domain model<br/>[models.go]"]
end

subgraph group_storage["Persistence"]
  node_pg["PostgreSQL storage"]
end

node_caller(("API client"))
node_kafka["Kafka broker"]
node_database[("PostgreSQL database")]

node_main -->|"starts"| node_server
node_main -->|"initializes"| node_service
node_main -->|"initializes"| node_consumer
node_main -->|"initializes"| node_processor
node_server -->|"serves"| node_api_impl
node_server -->|"runs"| node_gateway
node_gateway -->|"serves HTTP"| node_caller
node_gateway -->|"registers routes"| node_contract
node_caller -.->|"calls gRPC"| node_api_impl
node_contract -->|"uses model"| node_student_model
node_api_impl -->|"calls"| node_service
node_api_impl -->|"maps data"| node_model
node_kafka -->|"delivers messages"| node_consumer
node_consumer -->|"handles message"| node_processor
node_processor -.->|"upserts"| node_service
node_service -->|"uses storage"| node_pg
node_pg -->|"queries"| node_database

click node_main "https://github.com/domenick1991/students/blob/master/cmd/app/main.go"
click node_server "https://github.com/domenick1991/students/blob/master/internal/bootstrap/server.go"
click node_contract "https://github.com/domenick1991/students/blob/master/api/students_api/students.proto"
click node_student_model "https://github.com/domenick1991/students/blob/master/api/models/student_model.proto"
click node_gateway "https://github.com/domenick1991/students/blob/master/internal/bootstrap/server.go"
click node_api_impl "https://github.com/domenick1991/students/tree/master/internal/api/student_service_api"
click node_consumer "https://github.com/domenick1991/students/blob/master/internal/consumer/students_Info_upsert_consumer/consume.go"
click node_processor "https://github.com/domenick1991/students/tree/master/internal/services/processors/students_info_processor"
click node_service "https://github.com/domenick1991/students/tree/master/internal/services/studentsService"
click node_model "https://github.com/domenick1991/students/blob/master/internal/models/models.go"
click node_pg "https://github.com/domenick1991/students/tree/master/internal/storage/pgstorage"

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_server,node_caller toneBlue
class node_contract,node_student_model,node_gateway,node_api_impl,node_database toneAmber
class node_consumer,node_processor toneMint
class node_service,node_model toneRose
class node_pg,node_kafka toneIndigo
```

## Components

### Runtime entrypoints

- [Application startup](https://github.com/domenick1991/students/blob/master/cmd/app/main.go): `cmd/app/main.go`
- [Server runtime](https://github.com/domenick1991/students/blob/master/internal/bootstrap/server.go): `internal/bootstrap/server.go`

### API surface

- [Students API contract](https://github.com/domenick1991/students/blob/master/api/students_api/students.proto): `api/students_api/students.proto`
- [Student model contract](https://github.com/domenick1991/students/blob/master/api/models/student_model.proto): `api/models/student_model.proto`
- [HTTP gateway](https://github.com/domenick1991/students/blob/master/internal/bootstrap/server.go): `internal/bootstrap/server.go`
- [Student API handlers](https://github.com/domenick1991/students/tree/master/internal/api/student_service_api): `internal/api/student_service_api`

### Kafka ingestion

- [Upsert consumer](https://github.com/domenick1991/students/blob/master/internal/consumer/students_Info_upsert_consumer/consume.go): `internal/consumer/students_Info_upsert_consumer/consume.go`
- [Upsert processor](https://github.com/domenick1991/students/tree/master/internal/services/processors/students_info_processor): `internal/services/processors/students_info_processor`

### Student domain

- [Student service](https://github.com/domenick1991/students/tree/master/internal/services/studentsService): `internal/services/studentsService`
- [Student domain model](https://github.com/domenick1991/students/blob/master/internal/models/models.go): `internal/models/models.go`

### Persistence

- [PostgreSQL storage](https://github.com/domenick1991/students/tree/master/internal/storage/pgstorage): `internal/storage/pgstorage`

### Other components

- **API client**
- **Kafka broker**
- **PostgreSQL database**

## Connections

- Application startup → Server runtime: starts (evidence: `cmd/app/main.go`)
- Application startup → Student service: initializes (evidence: `cmd/app/main.go`)
- Application startup → Upsert consumer: initializes (evidence: `cmd/app/main.go`)
- Application startup → Upsert processor: initializes (evidence: `cmd/app/main.go`)
- Server runtime → Student API handlers: serves (evidence: `internal/bootstrap/server.go`)
- Server runtime → HTTP gateway: runs (evidence: `internal/bootstrap/server.go`)
- HTTP gateway → API client: serves HTTP (evidence: `internal/bootstrap/server.go`)
- HTTP gateway → Students API contract: registers routes (evidence: `internal/bootstrap/server.go`)
- API client → Student API handlers: calls gRPC
- Students API contract → Student model contract: uses model (evidence: `api/students_api/students.proto`)
- Student API handlers → Student service: calls (evidence: `internal/api/student_service_api/get_student_info_by_ids.go`)
- Student API handlers → Student domain model: maps data (evidence: `internal/api/student_service_api/get_student_info_by_ids.go`)
- Kafka broker → Upsert consumer: delivers messages (evidence: `internal/consumer/students_Info_upsert_consumer/consume.go`)
- Upsert consumer → Upsert processor: handles message (evidence: `internal/consumer/students_Info_upsert_consumer/consume.go`)
- Upsert processor → Student service: upserts
- Student service → PostgreSQL storage: uses storage (evidence: `internal/bootstrap/student_service.go`)
- PostgreSQL storage → PostgreSQL database: queries
