# j3ffreyjr/goatilicious-first-step architecture

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

- Interactive diagram: https://gitdiagram.com/j3ffreyjr/goatilicious-first-step
- Repository: https://github.com/j3ffreyjr/goatilicious-first-step

## Overview

Goatilicious combines a customer-facing 3D storefront with staff operations for customers, orders, production/stock, dashboards, and invoicing. The principal operational flow is customer registration and order submission, followed by staff order review, invoice finalization, and optional PDF/email delivery. The graph preserves the separately documented 3D landing experience and admin capabilities. Several backend services and frontend-to-API links are unsampled; those links are marked dashed where the README establishes integration, and otherwise omitted.

Main entry points: [`backend/src/main/java/com/goatilicious/repositories`](https://github.com/j3ffreyjr/goatilicious-first-step/tree/master/backend/src/main/java/com/goatilicious/repositories) (JPA repositories), [`backend/src/main/java/com/goatilicious/controllers/FacturaController.java`](https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/backend/src/main/java/com/goatilicious/controllers/FacturaController.java) (Invoice API), [`backend/src/main/java/com/goatilicious/services/EnvioFacturaService.java`](https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/backend/src/main/java/com/goatilicious/services/EnvioFacturaService.java) (Email delivery), [`frontend/src/main.js`](https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/frontend/src/main.js) (3D landing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Customer storefront"]
  node_landing["3D landing<br/>[main.js]"]
  node_scene["Scene and flavors<br/>[scene.js]"]
  node_bubbles["Bubble effects<br/>[bubbles.js]"]
  node_scene_config["Scene config<br/>[scene.js]"]
  node_scene_state["UI state<br/>[state.js]"]
  node_client_forms["Registration and orders<br/>[cadastro.js]"]
  node_client_auth["Client authentication<br/>[auth.js]"]
end

subgraph group_staff["Staff operations"]
  node_admin_ui["Staff dashboard<br/>[dashboard.js]"]
  node_admin_orders["Order management<br/>[gerir-pedidos.js]"]
  node_admin_invoices["Invoice management<br/>[facturas.js]"]
  node_dashboard_service["Dashboard metrics"]
end

subgraph group_backend["Backend API"]
  node_customer_api["Customer API"]
  node_order_api["Order API"]
  node_invoice_api["Invoice API"]
  node_order_service["Order processing<br/>[PedidoService.java]"]
end

subgraph group_billing["Invoice delivery"]
  node_invoice_service["Invoice lifecycle"]
  node_pdf_service["PDF generation"]
  node_delivery_service["Email delivery"]
  node_email_sender["SMTP sender"]
end

subgraph group_persistence["Persistence and identity"]
  node_repositories[("JPA repositories")]
  node_auth_service["User authentication"]
  node_auth_config["Access rules"]
end

node_customer(("Customer"))
node_staff_user(("Staff user"))

node_landing -->|"initializes"| node_scene
node_landing -->|"initializes"| node_bubbles
node_landing -->|"loads config"| node_scene_config
node_bubbles -->|"reads settings"| node_scene_config
node_bubbles -->|"checks motion"| node_scene_state
node_customer -.->|"registers or orders"| node_client_forms
node_client_forms -->|"uses session"| node_client_auth
node_client_forms -.->|"submits registration"| node_customer_api
node_client_auth -.->|"validates session"| node_customer_api
node_staff_user -.->|"views metrics"| node_admin_ui
node_staff_user -.->|"manages orders"| node_admin_orders
node_staff_user -.->|"manages invoices"| node_admin_invoices
node_admin_orders -.->|"calls API"| node_order_api
node_admin_invoices -.->|"calls API"| node_invoice_api
node_admin_ui -.->|"requests metrics"| node_dashboard_service
node_customer_api -.->|"accesses data"| node_repositories
node_order_api -->|"delegates"| node_order_service
node_order_service -.->|"accesses data"| node_repositories
node_invoice_api -->|"delegates"| node_invoice_service
node_invoice_api -->|"generates PDF"| node_pdf_service
node_invoice_api -->|"requests delivery"| node_delivery_service
node_invoice_service -->|"reads and saves"| node_repositories
node_delivery_service -->|"creates attachment"| node_pdf_service
node_delivery_service -->|"sends message"| node_email_sender
node_delivery_service -->|"records attempts"| node_repositories
node_dashboard_service -->|"reads orders and invoices"| node_repositories
node_auth_service -->|"loads user"| node_repositories
node_auth_config -.->|"configures identity"| node_auth_service

click node_landing "https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/frontend/src/main.js"
click node_scene "https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/frontend/src/modules/scene.js"
click node_bubbles "https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/frontend/src/modules/bubbles.js"
click node_scene_config "https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/frontend/src/config/scene.js"
click node_scene_state "https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/frontend/src/state.js"
click node_client_forms "https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/frontend/cliente/cadastro.js"
click node_client_auth "https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/frontend/shared/auth.js"
click node_admin_ui "https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/frontend/admin/dashboard.js"
click node_admin_orders "https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/frontend/admin/gerir-pedidos.js"
click node_admin_invoices "https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/frontend/admin/facturas.js"
click node_customer_api "https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/backend/src/main/java/com/goatilicious/controllers/ClienteController.java"
click node_order_api "https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/backend/src/main/java/com/goatilicious/controllers/PedidoController.java"
click node_invoice_api "https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/backend/src/main/java/com/goatilicious/controllers/FacturaController.java"
click node_order_service "https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/backend/src/main/java/com/goatilicious/services/PedidoService.java"
click node_invoice_service "https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/backend/src/main/java/com/goatilicious/services/FacturaService.java"
click node_dashboard_service "https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/backend/src/main/java/com/goatilicious/services/DashboardService.java"
click node_pdf_service "https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/backend/src/main/java/com/goatilicious/services/FacturaPdfService.java"
click node_delivery_service "https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/backend/src/main/java/com/goatilicious/services/EnvioFacturaService.java"
click node_email_sender "https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/backend/src/main/java/com/goatilicious/mail/SmtpEmailSender.java"
click node_repositories "https://github.com/j3ffreyjr/goatilicious-first-step/tree/master/backend/src/main/java/com/goatilicious/repositories"
click node_auth_service "https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/backend/src/main/java/com/goatilicious/security/UtilizadorUserDetailsService.java"
click node_auth_config "https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/backend/src/main/java/com/goatilicious/config/SecurityConfig.java"

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_landing,node_scene,node_bubbles,node_scene_config,node_scene_state,node_client_forms,node_client_auth,node_staff_user toneBlue
class node_admin_ui,node_admin_orders,node_admin_invoices,node_dashboard_service toneAmber
class node_customer_api,node_order_api,node_invoice_api,node_order_service toneMint
class node_invoice_service,node_pdf_service,node_delivery_service,node_email_sender toneRose
class node_repositories,node_auth_service,node_auth_config,node_customer toneIndigo
```

## Components

### Customer storefront

- [3D landing](https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/frontend/src/main.js): `frontend/src/main.js`
- [Scene and flavors](https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/frontend/src/modules/scene.js): `frontend/src/modules/scene.js`
- [Bubble effects](https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/frontend/src/modules/bubbles.js): `frontend/src/modules/bubbles.js`
- [Scene config](https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/frontend/src/config/scene.js): `frontend/src/config/scene.js`
- [UI state](https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/frontend/src/state.js): `frontend/src/state.js`
- [Registration and orders](https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/frontend/cliente/cadastro.js): `frontend/cliente/cadastro.js`
- [Client authentication](https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/frontend/shared/auth.js): `frontend/shared/auth.js`

### Staff operations

- [Staff dashboard](https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/frontend/admin/dashboard.js): `frontend/admin/dashboard.js`
- [Order management](https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/frontend/admin/gerir-pedidos.js): `frontend/admin/gerir-pedidos.js`
- [Invoice management](https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/frontend/admin/facturas.js): `frontend/admin/facturas.js`
- [Dashboard metrics](https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/backend/src/main/java/com/goatilicious/services/DashboardService.java): `backend/src/main/java/com/goatilicious/services/DashboardService.java`

### Backend API

- [Customer API](https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/backend/src/main/java/com/goatilicious/controllers/ClienteController.java): `backend/src/main/java/com/goatilicious/controllers/ClienteController.java`
- [Order API](https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/backend/src/main/java/com/goatilicious/controllers/PedidoController.java): `backend/src/main/java/com/goatilicious/controllers/PedidoController.java`
- [Invoice API](https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/backend/src/main/java/com/goatilicious/controllers/FacturaController.java): `backend/src/main/java/com/goatilicious/controllers/FacturaController.java`
- [Order processing](https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/backend/src/main/java/com/goatilicious/services/PedidoService.java): `backend/src/main/java/com/goatilicious/services/PedidoService.java`

### Invoice delivery

- [Invoice lifecycle](https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/backend/src/main/java/com/goatilicious/services/FacturaService.java): `backend/src/main/java/com/goatilicious/services/FacturaService.java`
- [PDF generation](https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/backend/src/main/java/com/goatilicious/services/FacturaPdfService.java): `backend/src/main/java/com/goatilicious/services/FacturaPdfService.java`
- [Email delivery](https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/backend/src/main/java/com/goatilicious/services/EnvioFacturaService.java): `backend/src/main/java/com/goatilicious/services/EnvioFacturaService.java`
- [SMTP sender](https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/backend/src/main/java/com/goatilicious/mail/SmtpEmailSender.java): `backend/src/main/java/com/goatilicious/mail/SmtpEmailSender.java`

### Persistence and identity

- [JPA repositories](https://github.com/j3ffreyjr/goatilicious-first-step/tree/master/backend/src/main/java/com/goatilicious/repositories): `backend/src/main/java/com/goatilicious/repositories`
- [User authentication](https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/backend/src/main/java/com/goatilicious/security/UtilizadorUserDetailsService.java): `backend/src/main/java/com/goatilicious/security/UtilizadorUserDetailsService.java`
- [Access rules](https://github.com/j3ffreyjr/goatilicious-first-step/blob/master/backend/src/main/java/com/goatilicious/config/SecurityConfig.java): `backend/src/main/java/com/goatilicious/config/SecurityConfig.java`

### Other components

- **Customer**
- **Staff user**

## Connections

- 3D landing → Scene and flavors: initializes (evidence: `frontend/src/main.js`)
- 3D landing → Bubble effects: initializes (evidence: `frontend/src/main.js`)
- 3D landing → Scene config: loads config (evidence: `frontend/src/main.js`)
- Bubble effects → Scene config: reads settings (evidence: `frontend/src/modules/bubbles.js`)
- Bubble effects → UI state: checks motion (evidence: `frontend/src/modules/bubbles.js`)
- Customer → Registration and orders: registers or orders
- Registration and orders → Client authentication: uses session (evidence: `frontend/cliente/cadastro.js`)
- Registration and orders → Customer API: submits registration
- Client authentication → Customer API: validates session
- Staff user → Staff dashboard: views metrics
- Staff user → Order management: manages orders
- Staff user → Invoice management: manages invoices
- Order management → Order API: calls API
- Invoice management → Invoice API: calls API
- Staff dashboard → Dashboard metrics: requests metrics
- Customer API → JPA repositories: accesses data
- Order API → Order processing: delegates (evidence: `backend/src/main/java/com/goatilicious/controllers/PedidoController.java`)
- Order processing → JPA repositories: accesses data
- Invoice API → Invoice lifecycle: delegates (evidence: `backend/src/main/java/com/goatilicious/controllers/FacturaController.java`)
- Invoice API → PDF generation: generates PDF (evidence: `backend/src/main/java/com/goatilicious/controllers/FacturaController.java`)
- Invoice API → Email delivery: requests delivery (evidence: `backend/src/main/java/com/goatilicious/controllers/FacturaController.java`)
- Invoice lifecycle → JPA repositories: reads and saves (evidence: `backend/src/main/java/com/goatilicious/services/FacturaService.java`)
- Email delivery → PDF generation: creates attachment (evidence: `backend/src/main/java/com/goatilicious/services/EnvioFacturaService.java`)
- Email delivery → SMTP sender: sends message (evidence: `backend/src/main/java/com/goatilicious/services/EnvioFacturaService.java`)
- Email delivery → JPA repositories: records attempts (evidence: `backend/src/main/java/com/goatilicious/services/EnvioFacturaService.java`)
- Dashboard metrics → JPA repositories: reads orders and invoices (evidence: `backend/src/main/java/com/goatilicious/services/DashboardService.java`)
- User authentication → JPA repositories: loads user (evidence: `backend/src/main/java/com/goatilicious/security/UtilizadorUserDetailsService.java`)
- Access rules → User authentication: configures identity
