# organicportal/organicportalfrontend architecture

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

- Interactive diagram: https://gitdiagram.com/organicportal/organicportalfrontend
- Repository: https://github.com/organicportal/organicportalfrontend

## Overview

OrganicPortal is an Angular portal with public organic-information and certified-product pages, QR information, authentication, and an authenticated management interface. Users enter through routed pages; protected interface routes are checked against user groups, while the app shell initializes authentication and browser-storage state. Management includes seed, company, and profile areas. The graph captures documented route dispatch and sampled storage/interceptor behavior; several page capabilities are clear from the tree, but their internal calls were not sampled, so those links are omitted.

Main entry points: [`src/app/main/main.module.ts`](https://github.com/organicportal/organicportalfrontend/blob/master/src/app/main/main.module.ts) (Main routes), [`src/app/app.routes.ts`](https://github.com/organicportal/organicportalfrontend/blob/master/src/app/app.routes.ts) (Root routes), [`src/app/store/effects/localstorage.effects.ts`](https://github.com/organicportal/organicportalfrontend/blob/master/src/app/store/effects/localstorage.effects.ts) (Storage effects), [`src/addons/services/http-interceptor.service.ts`](https://github.com/organicportal/organicportalfrontend/blob/master/src/addons/services/http-interceptor.service.ts) (HTTP interceptor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["Routing and shell"]
  node_app["Application shell<br/>[app.component.ts]"]
  node_routes["Root routes<br/>[app.routes.ts]"]
  node_main["Main routes<br/>[main.module.ts]"]
end

subgraph group_public["Public portal"]
  node_organic["Organic information"]
  node_map["Organic map"]
  node_products["Certified products"]
  node_qr["QR information"]
end

subgraph group_identity["Identity and access"]
  node_auth["Authentication<br/>[auth.service.ts]"]
  node_login["Login"]
  node_access["Group access guard"]
end

subgraph group_management["Account management"]
  node_interface["Management interface"]
  node_seeds["Seed management"]
  node_companies["Company management"]
  node_profile["User profile"]
end

subgraph group_platform["Shared platform"]
  node_config["App configuration<br/>[app.config.ts]"]
  node_http["HTTP interceptor"]
  node_authstate["Authentication state<br/>[auth.actions.ts]"]
  node_storageactions["Storage actions"]
  node_storageeffects["Storage effects"]
  node_storage[("Browser local storage")]
  node_storageforms["Storage state model<br/>[models.ts]"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens pages"| node_routes
node_routes -->|"loads default"| node_main
node_routes -->|"routes to"| node_auth
node_routes -->|"routes to"| node_qr
node_main -->|"loads route"| node_organic
node_main -->|"loads route"| node_products
node_main -->|"loads route"| node_map
node_main -->|"loads route"| node_interface
node_main -->|"guards route"| node_access
node_auth -->|"includes login"| node_login
node_config -->|"registers"| node_http
node_config -->|"registers"| node_storageeffects
node_app -->|"dispatches init"| node_storageactions
node_app -->|"dispatches init"| node_authstate
node_storageeffects -->|"handles actions"| node_storageactions
node_storageeffects -->|"reads and writes"| node_storage
node_storageeffects -->|"uses model"| node_storageforms
node_http -->|"dispatches removal"| node_storageactions
node_http -->|"resets auditor"| node_authstate

click node_app "https://github.com/organicportal/organicportalfrontend/blob/master/src/app/app.component.ts"
click node_routes "https://github.com/organicportal/organicportalfrontend/blob/master/src/app/app.routes.ts"
click node_main "https://github.com/organicportal/organicportalfrontend/blob/master/src/app/main/main.module.ts"
click node_organic "https://github.com/organicportal/organicportalfrontend/tree/master/src/app/main/pages/organic-info"
click node_map "https://github.com/organicportal/organicportalfrontend/tree/master/src/app/main/pages/organic-map"
click node_products "https://github.com/organicportal/organicportalfrontend/blob/master/src/app/main/pages/certificated-products/certificated-products.service.ts"
click node_qr "https://github.com/organicportal/organicportalfrontend/tree/master/src/app/main/pages/qr-info"
click node_auth "https://github.com/organicportal/organicportalfrontend/blob/master/src/app/main/pages/auth/auth.service.ts"
click node_login "https://github.com/organicportal/organicportalfrontend/tree/master/src/app/main/pages/auth/login"
click node_access "https://github.com/organicportal/organicportalfrontend/blob/master/src/addons/guards/user-groups.guard.service.ts"
click node_interface "https://github.com/organicportal/organicportalfrontend/tree/master/src/app/main/pages/interface"
click node_seeds "https://github.com/organicportal/organicportalfrontend/blob/master/src/app/main/pages/interface/seed-management/seed-management.service.ts"
click node_companies "https://github.com/organicportal/organicportalfrontend/tree/master/src/app/main/pages/interface/my-companies"
click node_profile "https://github.com/organicportal/organicportalfrontend/tree/master/src/app/main/pages/interface/my-profile"
click node_config "https://github.com/organicportal/organicportalfrontend/blob/master/src/app/app.config.ts"
click node_http "https://github.com/organicportal/organicportalfrontend/blob/master/src/addons/services/http-interceptor.service.ts"
click node_authstate "https://github.com/organicportal/organicportalfrontend/blob/master/src/app/store/actions/auth.actions.ts"
click node_storageactions "https://github.com/organicportal/organicportalfrontend/blob/master/src/app/store/actions/localstorage.actions.ts"
click node_storageeffects "https://github.com/organicportal/organicportalfrontend/blob/master/src/app/store/effects/localstorage.effects.ts"
click node_storageforms "https://github.com/organicportal/organicportalfrontend/blob/master/src/app/store/models/localstorage/models.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_app,node_routes,node_main toneBlue
class node_organic,node_map,node_products,node_qr toneAmber
class node_auth,node_login,node_access toneMint
class node_interface,node_seeds,node_companies,node_profile toneRose
class node_config,node_http,node_authstate,node_storageactions,node_storageeffects,node_storage,node_storageforms,node_visitor toneIndigo
```

## Components

### Routing and shell

- [Application shell](https://github.com/organicportal/organicportalfrontend/blob/master/src/app/app.component.ts): `src/app/app.component.ts`
- [Root routes](https://github.com/organicportal/organicportalfrontend/blob/master/src/app/app.routes.ts): `src/app/app.routes.ts`
- [Main routes](https://github.com/organicportal/organicportalfrontend/blob/master/src/app/main/main.module.ts): `src/app/main/main.module.ts`

### Public portal

- [Organic information](https://github.com/organicportal/organicportalfrontend/tree/master/src/app/main/pages/organic-info): `src/app/main/pages/organic-info`
- [Organic map](https://github.com/organicportal/organicportalfrontend/tree/master/src/app/main/pages/organic-map): `src/app/main/pages/organic-map`
- [Certified products](https://github.com/organicportal/organicportalfrontend/blob/master/src/app/main/pages/certificated-products/certificated-products.service.ts): `src/app/main/pages/certificated-products/certificated-products.service.ts`
- [QR information](https://github.com/organicportal/organicportalfrontend/tree/master/src/app/main/pages/qr-info): `src/app/main/pages/qr-info`

### Identity and access

- [Authentication](https://github.com/organicportal/organicportalfrontend/blob/master/src/app/main/pages/auth/auth.service.ts): `src/app/main/pages/auth/auth.service.ts`
- [Login](https://github.com/organicportal/organicportalfrontend/tree/master/src/app/main/pages/auth/login): `src/app/main/pages/auth/login`
- [Group access guard](https://github.com/organicportal/organicportalfrontend/blob/master/src/addons/guards/user-groups.guard.service.ts): `src/addons/guards/user-groups.guard.service.ts`

### Account management

- [Management interface](https://github.com/organicportal/organicportalfrontend/tree/master/src/app/main/pages/interface): `src/app/main/pages/interface`
- [Seed management](https://github.com/organicportal/organicportalfrontend/blob/master/src/app/main/pages/interface/seed-management/seed-management.service.ts): `src/app/main/pages/interface/seed-management/seed-management.service.ts`
- [Company management](https://github.com/organicportal/organicportalfrontend/tree/master/src/app/main/pages/interface/my-companies): `src/app/main/pages/interface/my-companies`
- [User profile](https://github.com/organicportal/organicportalfrontend/tree/master/src/app/main/pages/interface/my-profile): `src/app/main/pages/interface/my-profile`

### Shared platform

- [App configuration](https://github.com/organicportal/organicportalfrontend/blob/master/src/app/app.config.ts): `src/app/app.config.ts`
- [HTTP interceptor](https://github.com/organicportal/organicportalfrontend/blob/master/src/addons/services/http-interceptor.service.ts): `src/addons/services/http-interceptor.service.ts`
- [Authentication state](https://github.com/organicportal/organicportalfrontend/blob/master/src/app/store/actions/auth.actions.ts): `src/app/store/actions/auth.actions.ts`
- [Storage actions](https://github.com/organicportal/organicportalfrontend/blob/master/src/app/store/actions/localstorage.actions.ts): `src/app/store/actions/localstorage.actions.ts`
- [Storage effects](https://github.com/organicportal/organicportalfrontend/blob/master/src/app/store/effects/localstorage.effects.ts): `src/app/store/effects/localstorage.effects.ts`
- **Browser local storage**
- [Storage state model](https://github.com/organicportal/organicportalfrontend/blob/master/src/app/store/models/localstorage/models.ts): `src/app/store/models/localstorage/models.ts`

### Other components

- **Visitor**

## Connections

- Visitor → Root routes: opens pages (evidence: `src/app/app.routes.ts`)
- Root routes → Main routes: loads default (evidence: `src/app/app.routes.ts`)
- Root routes → Authentication: routes to (evidence: `src/app/app.routes.ts`)
- Root routes → QR information: routes to (evidence: `src/app/app.routes.ts`)
- Main routes → Organic information: loads route (evidence: `src/app/main/main.module.ts`)
- Main routes → Certified products: loads route (evidence: `src/app/main/main.module.ts`)
- Main routes → Organic map: loads route (evidence: `src/app/main/main.module.ts`)
- Main routes → Management interface: loads route (evidence: `src/app/main/main.module.ts`)
- Main routes → Group access guard: guards route (evidence: `src/app/main/main.module.ts`)
- Authentication → Login: includes login (evidence: `src/app/main/pages/auth/auth.module.ts`)
- App configuration → HTTP interceptor: registers (evidence: `src/app/app.config.ts`)
- App configuration → Storage effects: registers (evidence: `src/app/app.config.ts`)
- Application shell → Storage actions: dispatches init (evidence: `src/app/app.component.ts`)
- Application shell → Authentication state: dispatches init (evidence: `src/app/app.component.ts`)
- Storage effects → Storage actions: handles actions (evidence: `src/app/store/effects/localstorage.effects.ts`)
- Storage effects → Browser local storage: reads and writes (evidence: `src/app/store/effects/localstorage.effects.ts`)
- Storage effects → Storage state model: uses model (evidence: `src/app/store/effects/localstorage.effects.ts`)
- HTTP interceptor → Storage actions: dispatches removal (evidence: `src/addons/services/http-interceptor.service.ts`)
- HTTP interceptor → Authentication state: resets auditor (evidence: `src/addons/services/http-interceptor.service.ts`)
