# adriankiv/go-portoapi architecture

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

- Interactive diagram: https://gitdiagram.com/adriankiv/go-portoapi
- Repository: https://github.com/adriankiv/go-portoapi

## Overview

This is a Go/Gin portfolio-content API. Clients can browse achievements/certifications, experience, and featured projects; authenticated users can manage those records, while registration and login provide credentials and JWTs for protected operations. Featured-project images are stored through ImageKit. The two entry points configure overlapping routes: `main.go` runs a Gin server, while `api/index.go` exposes a serverless handler. Source excerpts show the domain handlers and persistence calls; no README is present, and unexcerpted modules are not mapped beyond what the routes establish.

Main entry points: [`main.go`](https://github.com/adriankiv/go-portoapi/blob/main/main.go) (Gin server), [`api/index.go`](https://github.com/adriankiv/go-portoapi/blob/main/api/index.go) (Serverless handler), [`controllers/fea_controller.go`](https://github.com/adriankiv/go-portoapi/blob/main/controllers/fea_controller.go) (Featured project handlers), [`controllers/user_controller.go`](https://github.com/adriankiv/go-portoapi/blob/main/controllers/user_controller.go) (Auth handlers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["HTTP entry points"]
  node_server["Gin server<br/>[main.go]"]
  node_function["Serverless handler<br/>[index.go]"]
end

subgraph group_identity["Authentication"]
  node_auth["Auth handlers<br/>[user_controller.go]"]
  node_middleware["JWT middleware<br/>[auth_middleware.go]"]
  node_user["User model<br/>[user.go]"]
end

subgraph group_content["Portfolio content"]
  node_ac["Achievement handlers<br/>[ac_controller.go]"]
  node_acmodel["Achievement model"]
  node_experience["Experience handlers<br/>[expe_controller.go]"]
  node_expmodel["Experience model<br/>[experience.go]"]
  node_featured["Featured project handlers<br/>[fea_controller.go]"]
  node_featuredmodel["Featured project model"]
  node_legacyfeatured["Duplicate project handlers<br/>[fea_controller.go]"]
end

subgraph group_persistence["Persistence and media"]
  node_dbconfig["DB connection setup<br/>[db.go]"]
  node_postgres[("PostgreSQL database")]
  node_imagekit["ImageKit media"]
end

node_client(("API client"))

node_client -->|"sends requests"| node_server
node_client -->|"sends requests"| node_function
node_server -->|"connects database"| node_dbconfig
node_function -->|"connects database"| node_dbconfig
node_server -->|"routes auth"| node_auth
node_server -->|"routes content"| node_ac
node_server -->|"routes content"| node_experience
node_server -->|"routes content"| node_featured
node_function -->|"routes login"| node_auth
node_function -->|"routes content"| node_ac
node_function -->|"routes content"| node_experience
node_function -->|"routes content"| node_featured
node_server -->|"protects routes"| node_middleware
node_function -->|"protects routes"| node_middleware
node_auth -->|"uses model"| node_user
node_auth -->|"reads and writes"| node_postgres
node_middleware -->|"rejects invalid token"| node_client
node_ac -->|"reads and writes"| node_acmodel
node_ac -->|"reads and writes"| node_postgres
node_experience -->|"reads and writes"| node_expmodel
node_experience -->|"reads and writes"| node_postgres
node_featured -->|"reads and writes"| node_featuredmodel
node_featured -->|"reads and writes"| node_postgres
node_featured -->|"uploads and deletes"| node_imagekit
node_dbconfig -->|"opens and migrates"| node_postgres

click node_server "https://github.com/adriankiv/go-portoapi/blob/main/main.go"
click node_function "https://github.com/adriankiv/go-portoapi/blob/main/api/index.go"
click node_auth "https://github.com/adriankiv/go-portoapi/blob/main/controllers/user_controller.go"
click node_middleware "https://github.com/adriankiv/go-portoapi/blob/main/middleware/auth_middleware.go"
click node_user "https://github.com/adriankiv/go-portoapi/blob/main/models/user.go"
click node_ac "https://github.com/adriankiv/go-portoapi/blob/main/controllers/ac_controller.go"
click node_acmodel "https://github.com/adriankiv/go-portoapi/blob/main/models/achievements%26certifications.go"
click node_experience "https://github.com/adriankiv/go-portoapi/blob/main/controllers/expe_controller.go"
click node_expmodel "https://github.com/adriankiv/go-portoapi/blob/main/models/experience.go"
click node_featured "https://github.com/adriankiv/go-portoapi/blob/main/controllers/fea_controller.go"
click node_featuredmodel "https://github.com/adriankiv/go-portoapi/blob/main/models/featuredprojects.go"
click node_legacyfeatured "https://github.com/adriankiv/go-portoapi/blob/main/controller/fea_controller.go"
click node_dbconfig "https://github.com/adriankiv/go-portoapi/blob/main/config/db.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_function,node_client toneBlue
class node_auth,node_middleware,node_user toneAmber
class node_ac,node_acmodel,node_experience,node_expmodel,node_featured,node_featuredmodel,node_legacyfeatured toneMint
class node_dbconfig,node_postgres,node_imagekit toneRose
```

## Components

### HTTP entry points

- [Gin server](https://github.com/adriankiv/go-portoapi/blob/main/main.go): `main.go`
- [Serverless handler](https://github.com/adriankiv/go-portoapi/blob/main/api/index.go): `api/index.go`

### Authentication

- [Auth handlers](https://github.com/adriankiv/go-portoapi/blob/main/controllers/user_controller.go): `controllers/user_controller.go`
- [JWT middleware](https://github.com/adriankiv/go-portoapi/blob/main/middleware/auth_middleware.go): `middleware/auth_middleware.go`
- [User model](https://github.com/adriankiv/go-portoapi/blob/main/models/user.go): `models/user.go`

### Portfolio content

- [Achievement handlers](https://github.com/adriankiv/go-portoapi/blob/main/controllers/ac_controller.go): `controllers/ac_controller.go`
- [Achievement model](https://github.com/adriankiv/go-portoapi/blob/main/models/achievements%26certifications.go): `models/achievements&certifications.go`
- [Experience handlers](https://github.com/adriankiv/go-portoapi/blob/main/controllers/expe_controller.go): `controllers/expe_controller.go`
- [Experience model](https://github.com/adriankiv/go-portoapi/blob/main/models/experience.go): `models/experience.go`
- [Featured project handlers](https://github.com/adriankiv/go-portoapi/blob/main/controllers/fea_controller.go): `controllers/fea_controller.go`
- [Featured project model](https://github.com/adriankiv/go-portoapi/blob/main/models/featuredprojects.go): `models/featuredprojects.go`
- [Duplicate project handlers](https://github.com/adriankiv/go-portoapi/blob/main/controller/fea_controller.go): `controller/fea_controller.go`

### Persistence and media

- [DB connection setup](https://github.com/adriankiv/go-portoapi/blob/main/config/db.go): `config/db.go`
- **PostgreSQL database**
- **ImageKit media**

### Other components

- **API client**

## Connections

- API client → Gin server: sends requests (evidence: `main.go`)
- API client → Serverless handler: sends requests (evidence: `api/index.go`)
- Gin server → DB connection setup: connects database (evidence: `main.go`)
- Serverless handler → DB connection setup: connects database (evidence: `api/index.go`)
- Gin server → Auth handlers: routes auth (evidence: `main.go`)
- Gin server → Achievement handlers: routes content (evidence: `main.go`)
- Gin server → Experience handlers: routes content (evidence: `main.go`)
- Gin server → Featured project handlers: routes content (evidence: `main.go`)
- Serverless handler → Auth handlers: routes login (evidence: `api/index.go`)
- Serverless handler → Achievement handlers: routes content (evidence: `api/index.go`)
- Serverless handler → Experience handlers: routes content (evidence: `api/index.go`)
- Serverless handler → Featured project handlers: routes content (evidence: `api/index.go`)
- Gin server → JWT middleware: protects routes (evidence: `main.go`)
- Serverless handler → JWT middleware: protects routes (evidence: `api/index.go`)
- Auth handlers → User model: uses model (evidence: `controllers/user_controller.go`)
- Auth handlers → PostgreSQL database: reads and writes (evidence: `controllers/user_controller.go`)
- JWT middleware → API client: rejects invalid token (evidence: `middleware/auth_middleware.go`)
- Achievement handlers → Achievement model: reads and writes (evidence: `controllers/ac_controller.go`)
- Achievement handlers → PostgreSQL database: reads and writes (evidence: `controllers/ac_controller.go`)
- Experience handlers → Experience model: reads and writes (evidence: `controllers/expe_controller.go`)
- Experience handlers → PostgreSQL database: reads and writes (evidence: `controllers/expe_controller.go`)
- Featured project handlers → Featured project model: reads and writes (evidence: `controllers/fea_controller.go`)
- Featured project handlers → PostgreSQL database: reads and writes (evidence: `controllers/fea_controller.go`)
- Featured project handlers → ImageKit media: uploads and deletes (evidence: `controllers/fea_controller.go`)
- DB connection setup → PostgreSQL database: opens and migrates (evidence: `config/db.go`)
