# jackfrt/minimarket architecture

> Architecture diagram of the GitHub repository jackfrt/minimarket, 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
- Repository: https://github.com/jackfrt/minimarket

## Overview

Minimarket Cloud is a multi-company minimarket management SaaS with a React interface and Go service. The user signs in, selects a company, and works across sales, catalog, inventory, HR, and dashboard views; the frontend sends company-scoped requests to the API. The Go application layer contains business operations for these domains and uses repository methods, with JSON and in-memory repository implementations present in the tree. Backend wiring between the HTTP handlers, service, and concrete repositories is not established by the available excerpts, so those connections are omitted.

Main entry points: [`frontend/src/App.jsx`](https://github.com/jackfrt/minimarket/blob/main/frontend/src/App.jsx) (App shell), [`frontend/src/api.js`](https://github.com/jackfrt/minimarket/blob/main/frontend/src/api.js) (API client), [`internal/application/servicio.go`](https://github.com/jackfrt/minimarket/blob/main/internal/application/servicio.go) (Application service), [`internal/presentation/interfaz_http.go`](https://github.com/jackfrt/minimarket/blob/main/internal/presentation/interfaz_http.go) (HTTP API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["App shell<br/>[App.jsx]"]
  node_auth["Sign-in<br/>[AuthModal.jsx]"]
  node_client["API client<br/>[api.js]"]
  node_dashboard["Dashboard<br/>[DashboardView.jsx]"]
  node_sales["POS sales<br/>[PosSalesView.jsx]"]
  node_catalog["Catalog<br/>[CatalogView.jsx]"]
  node_inventory["Inventory<br/>[InventoryView.jsx]"]
  node_hr["Human resources<br/>[HrView.jsx]"]
  node_tenants["Tenant admin"]
end

subgraph group_backend["Go application"]
  node_http["HTTP API<br/>[interfaz_http.go]"]
  node_service["Application service<br/>[servicio.go]"]
  node_server["API startup<br/>[principal.go]"]
  node_webpage["Embedded page<br/>[pagina.go]"]
end

subgraph group_persistence["Persistence"]
  node_jsonrepo[("JSON repository")]
  node_memoryrepo[("Memory repository")]
  node_seed["Seed data<br/>[semilla.go]"]
end

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

node_operator(("Staff user"))

node_operator -->|"uses"| node_app
node_app -->|"renders"| node_auth
node_app -->|"renders"| node_dashboard
node_app -->|"renders"| node_sales
node_app -->|"renders"| node_catalog
node_app -->|"renders"| node_inventory
node_app -->|"renders"| node_hr
node_app -->|"renders"| node_tenants
node_app -->|"loads data"| node_client
node_auth -->|"requests login"| node_client
node_catalog -->|"requests updates"| node_client
node_sales -->|"submits sale"| node_client
node_inventory -->|"records movement"| node_client
node_hr -->|"requests HR"| node_client
node_tenants -->|"manages tenants"| node_client
node_client -.->|"sends HTTP"| node_http
node_server -.->|"starts handlers"| node_http
node_http -.->|"dispatches requests"| node_service
node_service -->|"uses domain types"| node_entities
node_service -.->|"uses repository"| node_jsonrepo
node_service -.->|"uses repository"| node_memoryrepo

click node_app "https://github.com/jackfrt/minimarket/blob/main/frontend/src/App.jsx"
click node_auth "https://github.com/jackfrt/minimarket/blob/main/frontend/src/components/AuthModal.jsx"
click node_client "https://github.com/jackfrt/minimarket/blob/main/frontend/src/api.js"
click node_dashboard "https://github.com/jackfrt/minimarket/blob/main/frontend/src/components/DashboardView.jsx"
click node_sales "https://github.com/jackfrt/minimarket/blob/main/frontend/src/components/PosSalesView.jsx"
click node_catalog "https://github.com/jackfrt/minimarket/blob/main/frontend/src/components/CatalogView.jsx"
click node_inventory "https://github.com/jackfrt/minimarket/blob/main/frontend/src/components/InventoryView.jsx"
click node_hr "https://github.com/jackfrt/minimarket/blob/main/frontend/src/components/HrView.jsx"
click node_tenants "https://github.com/jackfrt/minimarket/blob/main/frontend/src/components/ArchitectureSaasView.jsx"
click node_http "https://github.com/jackfrt/minimarket/blob/main/internal/presentation/interfaz_http.go"
click node_service "https://github.com/jackfrt/minimarket/blob/main/internal/application/servicio.go"
click node_server "https://github.com/jackfrt/minimarket/blob/main/cmd/api/principal.go"
click node_entities "https://github.com/jackfrt/minimarket/blob/main/internal/domain/entidades.go"
click node_jsonrepo "https://github.com/jackfrt/minimarket/blob/main/internal/infrastructure/repositorio_json.go"
click node_memoryrepo "https://github.com/jackfrt/minimarket/blob/main/internal/infrastructure/repositorio_memoria.go"
click node_seed "https://github.com/jackfrt/minimarket/blob/main/internal/infrastructure/semilla.go"
click node_webpage "https://github.com/jackfrt/minimarket/blob/main/internal/presentation/pagina.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_app,node_auth,node_client,node_dashboard,node_sales,node_catalog,node_inventory,node_hr,node_tenants,node_operator toneBlue
class node_http,node_service,node_server,node_webpage toneAmber
class node_jsonrepo,node_memoryrepo,node_seed toneMint
class node_entities toneRose
```

## Components

### Web application

- [App shell](https://github.com/jackfrt/minimarket/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Sign-in](https://github.com/jackfrt/minimarket/blob/main/frontend/src/components/AuthModal.jsx): `frontend/src/components/AuthModal.jsx`
- [API client](https://github.com/jackfrt/minimarket/blob/main/frontend/src/api.js): `frontend/src/api.js`
- [Dashboard](https://github.com/jackfrt/minimarket/blob/main/frontend/src/components/DashboardView.jsx): `frontend/src/components/DashboardView.jsx`
- [POS sales](https://github.com/jackfrt/minimarket/blob/main/frontend/src/components/PosSalesView.jsx): `frontend/src/components/PosSalesView.jsx`
- [Catalog](https://github.com/jackfrt/minimarket/blob/main/frontend/src/components/CatalogView.jsx): `frontend/src/components/CatalogView.jsx`
- [Inventory](https://github.com/jackfrt/minimarket/blob/main/frontend/src/components/InventoryView.jsx): `frontend/src/components/InventoryView.jsx`
- [Human resources](https://github.com/jackfrt/minimarket/blob/main/frontend/src/components/HrView.jsx): `frontend/src/components/HrView.jsx`
- [Tenant admin](https://github.com/jackfrt/minimarket/blob/main/frontend/src/components/ArchitectureSaasView.jsx): `frontend/src/components/ArchitectureSaasView.jsx`

### Go application

- [HTTP API](https://github.com/jackfrt/minimarket/blob/main/internal/presentation/interfaz_http.go): `internal/presentation/interfaz_http.go`
- [Application service](https://github.com/jackfrt/minimarket/blob/main/internal/application/servicio.go): `internal/application/servicio.go`
- [API startup](https://github.com/jackfrt/minimarket/blob/main/cmd/api/principal.go): `cmd/api/principal.go`
- [Embedded page](https://github.com/jackfrt/minimarket/blob/main/internal/presentation/pagina.go): `internal/presentation/pagina.go`

### Persistence

- [JSON repository](https://github.com/jackfrt/minimarket/blob/main/internal/infrastructure/repositorio_json.go): `internal/infrastructure/repositorio_json.go`
- [Memory repository](https://github.com/jackfrt/minimarket/blob/main/internal/infrastructure/repositorio_memoria.go): `internal/infrastructure/repositorio_memoria.go`
- [Seed data](https://github.com/jackfrt/minimarket/blob/main/internal/infrastructure/semilla.go): `internal/infrastructure/semilla.go`

### Business model

- [Domain entities](https://github.com/jackfrt/minimarket/blob/main/internal/domain/entidades.go): `internal/domain/entidades.go`

### Other components

- **Staff user**

## Connections

- Staff user → App shell: uses
- App shell → Sign-in: renders (evidence: `frontend/src/App.jsx`)
- App shell → Dashboard: renders (evidence: `frontend/src/App.jsx`)
- App shell → POS sales: renders (evidence: `frontend/src/App.jsx`)
- App shell → Catalog: renders (evidence: `frontend/src/App.jsx`)
- App shell → Inventory: renders (evidence: `frontend/src/App.jsx`)
- App shell → Human resources: renders (evidence: `frontend/src/App.jsx`)
- App shell → Tenant admin: renders (evidence: `frontend/src/App.jsx`)
- App shell → API client: loads data (evidence: `frontend/src/App.jsx`)
- Sign-in → API client: requests login (evidence: `frontend/src/components/AuthModal.jsx`)
- Catalog → API client: requests updates (evidence: `frontend/src/components/CatalogView.jsx`)
- POS sales → API client: submits sale (evidence: `frontend/src/components/PosSalesView.jsx`)
- Inventory → API client: records movement (evidence: `frontend/src/components/InventoryView.jsx`)
- Human resources → API client: requests HR (evidence: `frontend/src/components/HrView.jsx`)
- Tenant admin → API client: manages tenants (evidence: `frontend/src/components/ArchitectureSaasView.jsx`)
- API client → HTTP API: sends HTTP
- API startup → HTTP API: starts handlers
- HTTP API → Application service: dispatches requests
- Application service → Domain entities: uses domain types (evidence: `internal/application/servicio.go`)
- Application service → JSON repository: uses repository
- Application service → Memory repository: uses repository
