# gabriel-minano/frontend-minimarket architecture

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

- Interactive diagram: https://gitdiagram.com/gabriel-minano/frontend-minimarket
- Repository: https://github.com/gabriel-minano/frontend-minimarket

## Overview

This Angular minimarket frontend supports a login-to-dashboard workflow: users submit credentials, the app requests a session from its API, stores and validates that session, then allows guarded dashboard access and logout. Its other meaningful runtime layers are application routing, shared HTTP authentication handling, API configuration, and response/authentication contracts. The README is empty; the map is based on the supplied source excerpts and index, so dashboard capabilities beyond the sampled component are not inferred.

Main entry points: [`src/app/core/auth/auth.service.ts`](https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/app/core/auth/auth.service.ts) (Session service), [`src/app/app.routes.ts`](https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/app/app.routes.ts) (Route table), [`src/app/features/auth/login/login.ts`](https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/app/features/auth/login/login.ts) (Login form), [`src/app/app.config.ts`](https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/app/app.config.ts) (App providers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_bootstrap["Application bootstrap<br/>[main.ts]"]
  node_appconfig["App providers<br/>[app.config.ts]"]
  node_shell["Root shell<br/>[app.ts]"]
  node_routes["Route table<br/>[app.routes.ts]"]
end

subgraph group_flows["User workflows"]
  node_login["Login form<br/>[login.ts]"]
  node_dashboard["Dashboard<br/>[dashboard.ts]"]
end

subgraph group_auth["Authentication"]
  node_authservice["Session service<br/>[auth.service.ts]"]
  node_guard["Auth guard<br/>[auth.guard.ts]"]
  node_interceptor["HTTP interceptor"]
end

subgraph group_contracts["API contracts"]
  node_apiconfig["API configuration<br/>[api.config.ts]"]
  node_environment["API environment<br/>[environment.ts]"]
  node_authmodels["Auth data models"]
  node_responsemodel["API response model"]
end

node_user(("User"))
node_browser[("Browser session storage")]
node_backend["Minimarket API"]

node_bootstrap -->|"bootstraps with"| node_appconfig
node_bootstrap -->|"bootstraps"| node_shell
node_appconfig -->|"provides routes"| node_routes
node_appconfig -->|"registers"| node_interceptor
node_user -->|"submits credentials"| node_login
node_routes -->|"loads"| node_login
node_routes -->|"loads"| node_dashboard
node_routes -->|"guards route"| node_guard
node_login -->|"requests login"| node_authservice
node_authservice -->|"posts credentials"| node_backend
node_authservice -->|"reads and writes"| node_browser
node_guard -->|"checks session"| node_authservice
node_dashboard -->|"logs out"| node_authservice
node_interceptor -->|"gets token"| node_authservice
node_interceptor -->|"checks API URLs"| node_apiconfig
node_authservice -->|"uses login URL"| node_apiconfig
node_apiconfig -->|"reads API URL"| node_environment
node_authservice -->|"validates session"| node_authmodels
node_authservice -->|"types API result"| node_responsemodel
node_login -->|"checks error response"| node_responsemodel

click node_bootstrap "https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/main.ts"
click node_appconfig "https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/app/app.config.ts"
click node_shell "https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/app/app.ts"
click node_routes "https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/app/app.routes.ts"
click node_login "https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/app/features/auth/login/login.ts"
click node_dashboard "https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/app/features/dashboard/dashboard/dashboard.ts"
click node_authservice "https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/app/core/auth/auth.service.ts"
click node_guard "https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/app/core/guards/auth.guard.ts"
click node_interceptor "https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/app/core/interceptors/auth.interceptor.ts"
click node_apiconfig "https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/app/core/config/api.config.ts"
click node_environment "https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/environments/environment.ts"
click node_authmodels "https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/app/core/auth/models/auth-response.model.ts"
click node_responsemodel "https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/app/shared/models/api-response.model.ts"

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_bootstrap,node_appconfig,node_shell,node_routes,node_user toneBlue
class node_login,node_dashboard,node_browser toneAmber
class node_authservice,node_guard,node_interceptor,node_backend toneMint
class node_apiconfig,node_environment,node_authmodels,node_responsemodel toneRose
```

## Components

### Application shell

- [Application bootstrap](https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/main.ts): `src/main.ts`
- [App providers](https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/app/app.config.ts): `src/app/app.config.ts`
- [Root shell](https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/app/app.ts): `src/app/app.ts`
- [Route table](https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/app/app.routes.ts): `src/app/app.routes.ts`

### User workflows

- [Login form](https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/app/features/auth/login/login.ts): `src/app/features/auth/login/login.ts`
- [Dashboard](https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/app/features/dashboard/dashboard/dashboard.ts): `src/app/features/dashboard/dashboard/dashboard.ts`

### Authentication

- [Session service](https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/app/core/auth/auth.service.ts): `src/app/core/auth/auth.service.ts`
- [Auth guard](https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/app/core/guards/auth.guard.ts): `src/app/core/guards/auth.guard.ts`
- [HTTP interceptor](https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/app/core/interceptors/auth.interceptor.ts): `src/app/core/interceptors/auth.interceptor.ts`

### API contracts

- [API configuration](https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/app/core/config/api.config.ts): `src/app/core/config/api.config.ts`
- [API environment](https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/environments/environment.ts): `src/environments/environment.ts`
- [Auth data models](https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/app/core/auth/models/auth-response.model.ts): `src/app/core/auth/models/auth-response.model.ts`
- [API response model](https://github.com/gabriel-minano/frontend-minimarket/blob/main/src/app/shared/models/api-response.model.ts): `src/app/shared/models/api-response.model.ts`

### Other components

- **User**
- **Browser session storage**
- **Minimarket API**

## Connections

- Application bootstrap → App providers: bootstraps with (evidence: `src/main.ts`)
- Application bootstrap → Root shell: bootstraps (evidence: `src/main.ts`)
- App providers → Route table: provides routes (evidence: `src/app/app.config.ts`)
- App providers → HTTP interceptor: registers (evidence: `src/app/app.config.ts`)
- User → Login form: submits credentials (evidence: `src/app/features/auth/login/login.ts`)
- Route table → Login form: loads (evidence: `src/app/app.routes.ts`)
- Route table → Dashboard: loads (evidence: `src/app/app.routes.ts`)
- Route table → Auth guard: guards route (evidence: `src/app/app.routes.ts`)
- Login form → Session service: requests login (evidence: `src/app/features/auth/login/login.ts`)
- Session service → Minimarket API: posts credentials (evidence: `src/app/core/auth/auth.service.ts`)
- Session service → Browser session storage: reads and writes (evidence: `src/app/core/auth/auth.service.ts`)
- Auth guard → Session service: checks session (evidence: `src/app/core/guards/auth.guard.ts`)
- Dashboard → Session service: logs out (evidence: `src/app/features/dashboard/dashboard/dashboard.ts`)
- HTTP interceptor → Session service: gets token (evidence: `src/app/core/interceptors/auth.interceptor.ts`)
- HTTP interceptor → API configuration: checks API URLs (evidence: `src/app/core/interceptors/auth.interceptor.ts`)
- Session service → API configuration: uses login URL (evidence: `src/app/core/auth/auth.service.ts`)
- API configuration → API environment: reads API URL (evidence: `src/app/core/config/api.config.ts`)
- Session service → Auth data models: validates session (evidence: `src/app/core/auth/auth.service.ts`)
- Session service → API response model: types API result (evidence: `src/app/core/auth/auth.service.ts`)
- Login form → API response model: checks error response (evidence: `src/app/features/auth/login/login.ts`)
