# s-abdullaev2005/golang architecture

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

- Interactive diagram: https://gitdiagram.com/s-abdullaev2005/golang
- Repository: https://github.com/s-abdullaev2005/golang

## Overview

OCM is a small Go course-management HTTP API. A client request enters the mux routes, reaches course handlers for JSON validation and CRUD, and course operations use SQL-backed models against PostgreSQL. The repository also contains an in-memory student lookup and SQL student mutations, but no student HTTP workflow is shown. The README is empty, so this map relies on the supplied source excerpts; it does not infer additional features from the migrations directory.

Main entry points: [`GoLang-Project-2024-main/cmd/OCM/main.go`](https://github.com/s-abdullaev2005/golang/blob/main/GoLang-Project-2024-main/cmd/OCM/main.go) (HTTP server and routes), [`GoLang-Project-2024-main/cmd/OCM/handlers.go`](https://github.com/s-abdullaev2005/golang/blob/main/GoLang-Project-2024-main/cmd/OCM/handlers.go) (Course handlers), [`GoLang-Project-2024-main/pkg/OCM/model/courses.go`](https://github.com/s-abdullaev2005/golang/blob/main/GoLang-Project-2024-main/pkg/OCM/model/courses.go) (Course model), [`GoLang-Project-2024-main/pkg/OCM/model/model.go`](https://github.com/s-abdullaev2005/golang/blob/main/GoLang-Project-2024-main/pkg/OCM/model/model.go) (Model setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_server["HTTP server and routes<br/>[main.go]"]
  node_course_handlers["Course handlers<br/>[handlers.go]"]
end

subgraph group_domain["Models"]
  node_course_model["Course model<br/>[courses.go]"]
  node_student_model["Student model<br/>[students.go]"]
  node_model_setup["Model setup<br/>[model.go]"]
end

subgraph group_storage["Persistence"]
  node_postgres[("PostgreSQL")]
end

node_client(("API client"))

node_client -->|"sends HTTP"| node_server
node_server -->|"routes requests"| node_course_handlers
node_server -->|"initializes models"| node_model_setup
node_course_handlers -->|"calls CRUD"| node_course_model
node_course_model -->|"queries"| node_postgres
node_student_model -->|"queries"| node_postgres
node_model_setup -->|"stores connection"| node_postgres

click node_server "https://github.com/s-abdullaev2005/golang/blob/main/GoLang-Project-2024-main/cmd/OCM/main.go"
click node_course_handlers "https://github.com/s-abdullaev2005/golang/blob/main/GoLang-Project-2024-main/cmd/OCM/handlers.go"
click node_course_model "https://github.com/s-abdullaev2005/golang/blob/main/GoLang-Project-2024-main/pkg/OCM/model/courses.go"
click node_student_model "https://github.com/s-abdullaev2005/golang/blob/main/GoLang-Project-2024-main/pkg/OCM/model/students.go"
click node_model_setup "https://github.com/s-abdullaev2005/golang/blob/main/GoLang-Project-2024-main/pkg/OCM/model/model.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_server,node_course_handlers,node_client toneBlue
class node_course_model,node_student_model,node_model_setup toneAmber
class node_postgres toneMint
```

## Components

### HTTP API

- [HTTP server and routes](https://github.com/s-abdullaev2005/golang/blob/main/GoLang-Project-2024-main/cmd/OCM/main.go): `GoLang-Project-2024-main/cmd/OCM/main.go`
- [Course handlers](https://github.com/s-abdullaev2005/golang/blob/main/GoLang-Project-2024-main/cmd/OCM/handlers.go): `GoLang-Project-2024-main/cmd/OCM/handlers.go`

### Models

- [Course model](https://github.com/s-abdullaev2005/golang/blob/main/GoLang-Project-2024-main/pkg/OCM/model/courses.go): `GoLang-Project-2024-main/pkg/OCM/model/courses.go`
- [Student model](https://github.com/s-abdullaev2005/golang/blob/main/GoLang-Project-2024-main/pkg/OCM/model/students.go): `GoLang-Project-2024-main/pkg/OCM/model/students.go`
- [Model setup](https://github.com/s-abdullaev2005/golang/blob/main/GoLang-Project-2024-main/pkg/OCM/model/model.go): `GoLang-Project-2024-main/pkg/OCM/model/model.go`

### Persistence

- **PostgreSQL**

### Other components

- **API client**

## Connections

- API client → HTTP server and routes: sends HTTP (evidence: `GoLang-Project-2024-main/cmd/OCM/main.go`)
- HTTP server and routes → Course handlers: routes requests (evidence: `GoLang-Project-2024-main/cmd/OCM/main.go`)
- HTTP server and routes → Model setup: initializes models (evidence: `GoLang-Project-2024-main/cmd/OCM/main.go`)
- Course handlers → Course model: calls CRUD (evidence: `GoLang-Project-2024-main/cmd/OCM/handlers.go`)
- Course model → PostgreSQL: queries (evidence: `GoLang-Project-2024-main/pkg/OCM/model/courses.go`)
- Student model → PostgreSQL: queries (evidence: `GoLang-Project-2024-main/pkg/OCM/model/students.go`)
- Model setup → PostgreSQL: stores connection (evidence: `GoLang-Project-2024-main/pkg/OCM/model/model.go`)
