# jackfrt/minimarket-alpha architecture

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

- Interactive diagram: https://gitdiagram.com/jackfrt/minimarket-alpha
- Repository: https://github.com/jackfrt/minimarket-alpha

## Overview

Minimarket is a small HTTP application for managing products and suppliers. A user sends requests to the API, which serves a home page and handles product and supplier reads, creates, updates, and deletes; product cloning is an additional operation. The application service validates and assigns identities for writes, while a JSON-backed repository persists the records. The sampled source shows startup wiring and these API paths; it does not establish further behavior for the unsampled HTML or deployment configuration.

Main entry points: [`internal/presentation/interfaz_http.go`](https://github.com/jackfrt/minimarket-alpha/blob/master/internal/presentation/interfaz_http.go) (HTTP routes), [`internal/infrastructure/repositorio_json.go`](https://github.com/jackfrt/minimarket-alpha/blob/master/internal/infrastructure/repositorio_json.go) (JSON repository adapter), [`cmd/api/principal.go`](https://github.com/jackfrt/minimarket-alpha/blob/master/cmd/api/principal.go) (HTTP server setup), [`internal/application/servicio.go`](https://github.com/jackfrt/minimarket-alpha/blob/master/internal/application/servicio.go) (Product and supplier service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Startup and HTTP"]
  node_server["HTTP server setup<br/>[principal.go]"]
  node_handler["HTTP routes<br/>[interfaz_http.go]"]
  node_home["Home page<br/>[pagina.html]"]
end

subgraph group_application["Application logic"]
  node_service["Product and supplier service<br/>[servicio.go]"]
end

subgraph group_domain["Domain model"]
  node_entities["Product and supplier entities<br/>[entidades.go]"]
end

subgraph group_storage["JSON persistence"]
  node_repository["JSON repository adapter"]
  node_jsonfile[("JSON data file")]
end

node_user(("API user"))

node_user -->|"sends HTTP"| node_server
node_server -->|"configures routes"| node_handler
node_server -->|"creates repository"| node_repository
node_handler -->|"serves page"| node_home
node_handler -->|"calls service"| node_service
node_handler -->|"reads and deletes"| node_repository
node_service -->|"saves and loads"| node_repository
node_service -->|"validates and clones"| node_entities
node_repository -->|"reads and writes"| node_jsonfile

click node_server "https://github.com/jackfrt/minimarket-alpha/blob/master/cmd/api/principal.go"
click node_handler "https://github.com/jackfrt/minimarket-alpha/blob/master/internal/presentation/interfaz_http.go"
click node_home "https://github.com/jackfrt/minimarket-alpha/blob/master/internal/presentation/pagina.html"
click node_service "https://github.com/jackfrt/minimarket-alpha/blob/master/internal/application/servicio.go"
click node_entities "https://github.com/jackfrt/minimarket-alpha/blob/master/internal/domain/entidades.go"
click node_repository "https://github.com/jackfrt/minimarket-alpha/blob/master/internal/infrastructure/repositorio_json.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_handler,node_home,node_user toneBlue
class node_service toneAmber
class node_entities toneMint
class node_repository,node_jsonfile toneRose
```

## Components

### Startup and HTTP

- [HTTP server setup](https://github.com/jackfrt/minimarket-alpha/blob/master/cmd/api/principal.go): `cmd/api/principal.go`
- [HTTP routes](https://github.com/jackfrt/minimarket-alpha/blob/master/internal/presentation/interfaz_http.go): `internal/presentation/interfaz_http.go`
- [Home page](https://github.com/jackfrt/minimarket-alpha/blob/master/internal/presentation/pagina.html): `internal/presentation/pagina.html`

### Application logic

- [Product and supplier service](https://github.com/jackfrt/minimarket-alpha/blob/master/internal/application/servicio.go): `internal/application/servicio.go`

### Domain model

- [Product and supplier entities](https://github.com/jackfrt/minimarket-alpha/blob/master/internal/domain/entidades.go): `internal/domain/entidades.go`

### JSON persistence

- [JSON repository adapter](https://github.com/jackfrt/minimarket-alpha/blob/master/internal/infrastructure/repositorio_json.go): `internal/infrastructure/repositorio_json.go`
- **JSON data file**

### Other components

- **API user**

## Connections

- API user → HTTP server setup: sends HTTP (evidence: `cmd/api/principal.go`)
- HTTP server setup → HTTP routes: configures routes (evidence: `cmd/api/principal.go`)
- HTTP server setup → JSON repository adapter: creates repository (evidence: `cmd/api/principal.go`)
- HTTP routes → Home page: serves page (evidence: `internal/presentation/interfaz_http.go`)
- HTTP routes → Product and supplier service: calls service (evidence: `internal/presentation/interfaz_http.go`)
- HTTP routes → JSON repository adapter: reads and deletes (evidence: `internal/presentation/interfaz_http.go`)
- Product and supplier service → JSON repository adapter: saves and loads (evidence: `internal/application/servicio.go`)
- Product and supplier service → Product and supplier entities: validates and clones (evidence: `internal/application/servicio.go`)
- JSON repository adapter → JSON data file: reads and writes (evidence: `internal/infrastructure/repositorio_json.go`)
