# andersonaires-cc/projetolanches architecture

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

- Interactive diagram: https://gitdiagram.com/andersonaires-cc/projetolanches
- Repository: https://github.com/andersonaires-cc/projetolanches

## Overview

ProjetoLanches is an ASP.NET Core MVC shop for browsing and buying lanches, with customer accounts and an admin area. The main flow is catalog browsing, adding items to a session-identified cart, authenticated checkout, and persistence of an order with detail rows. Admin capabilities listed in the tree include catalog and image management, order administration, sales reports, and charts. The graph preserves these distinct stages; unsampled admin links are documented only by their controller/service modules, so their internal call paths are not asserted.

Main entry points: [`LanchesMac/Context/AppDbContext.cs`](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Context/AppDbContext.cs) (Application database), [`LanchesMac/Models/CarrinhoCompra.cs`](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Models/CarrinhoCompra.cs) (Session cart), [`LanchesMac/Controllers/PedidoController.cs`](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Controllers/PedidoController.cs) (Checkout), [`LanchesMac/Areas/Admin/Servicos/RelatorioVendasService.cs`](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Areas/Admin/Servicos/RelatorioVendasService.cs) (Sales report service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Customer storefront"]
  node_account["Accounts"]
  node_home["Home catalog<br/>[HomeController.cs]"]
  node_catalog["Lanche catalog"]
  node_category_menu["Category menu<br/>[CategoriaMenu.cs]"]
  node_contact["Contact"]
end

subgraph group_commerce["Cart and checkout"]
  node_cart_controller["Cart actions"]
  node_cart["Session cart<br/>[CarrinhoCompra.cs]"]
  node_cart_summary["Cart summary"]
  node_checkout["Checkout"]
  node_order_repo["Order creation"]
end

subgraph group_admin["Admin operations"]
  node_admin_categories["Category admin"]
  node_admin_lanches["Lanche admin"]
  node_admin_images["Image management"]
  node_admin_orders["Order admin"]
  node_admin_reports["Lanche reports"]
  node_sales_report["Sales reports"]
  node_sales_service["Sales report service"]
  node_sales_chart["Sales charts"]
  node_chart_service["Chart service"]
  node_fast_report["Report helper"]
end

subgraph group_persistence["Persistence and domain"]
  node_repositories["Catalog repositories"]
  node_categories_repo["Category repository"]
  node_db[("Application database<br/>[AppDbContext.cs]")]
  node_catalog_models["Catalog entities<br/>[Lanche.cs]"]
  node_category_model["Category entity<br/>[Categoria.cs]"]
  node_cart_item["Cart item"]
  node_order_model["Order entity<br/>[Pedido.cs]"]
  node_order_detail["Order detail<br/>[PedidoDetalhe.cs]"]
  node_chart_model["Chart data<br/>[LancheGrafico.cs]"]
  node_file_model["Image file model"]
  node_image_config["Image settings"]
end

node_customer(("Shopper"))
node_sqlserver[("SQL Server")]
node_identity["ASP.NET Identity"]

node_customer -->|"signs in"| node_account
node_customer -.->|"browses"| node_home
node_customer -.->|"selects items"| node_catalog
node_customer -.->|"updates cart"| node_cart_controller
node_customer -->|"checks out"| node_checkout
node_home -->|"queries lanches"| node_repositories
node_catalog -->|"queries lanches"| node_repositories
node_category_menu -.->|"loads categories"| node_categories_repo
node_account -->|"authenticates"| node_identity
node_cart_controller -->|"changes cart"| node_cart
node_cart_summary -->|"reads cart"| node_cart
node_checkout -->|"loads items"| node_cart
node_checkout -->|"creates order"| node_order_repo
node_order_repo -->|"writes orders"| node_db
node_cart -->|"persists cart"| node_db
node_repositories -->|"queries catalog"| node_db
node_categories_repo -->|"queries categories"| node_db
node_db -.->|"stores data"| node_sqlserver
node_admin_categories -->|"manages categories"| node_db
node_admin_lanches -->|"manages lanches"| node_db
node_admin_images -->|"uses file model"| node_file_model
node_admin_images -->|"reads settings"| node_image_config
node_admin_orders -->|"manages orders"| node_db
node_sales_report -.->|"uses report service"| node_sales_service
node_sales_service -->|"queries sales"| node_db
node_sales_chart -.->|"uses chart service"| node_chart_service
node_chart_service -->|"queries chart data"| node_db
node_admin_reports -.->|"uses report helper"| node_fast_report
node_db -->|"maps entities"| node_catalog_models
node_db -->|"maps entities"| node_category_model
node_db -->|"maps entities"| node_cart_item
node_db -->|"maps entities"| node_order_model
node_db -->|"maps entities"| node_order_detail
node_sales_service -->|"reads order data"| node_order_model
node_chart_service -->|"builds chart data"| node_chart_model

click node_account "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Controllers/AccountController.cs"
click node_home "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Controllers/HomeController.cs"
click node_catalog "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Controllers/LancheController.cs"
click node_category_menu "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Components/CategoriaMenu.cs"
click node_contact "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Controllers/ContatoController.cs"
click node_cart_controller "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Controllers/CarrinhoCompraController.cs"
click node_cart "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Models/CarrinhoCompra.cs"
click node_cart_summary "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Components/CarrinhoCompraResumo.cs"
click node_checkout "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Controllers/PedidoController.cs"
click node_order_repo "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Repositories/PedidoRepository.cs"
click node_admin_categories "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Areas/Admin/Controllers/AdminCategoriasController.cs"
click node_admin_lanches "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Areas/Admin/Controllers/AdminLanchesController.cs"
click node_admin_images "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Areas/Admin/Controllers/AdminImagensController.cs"
click node_admin_orders "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Areas/Admin/Controllers/AdminPedidosController.cs"
click node_admin_reports "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Areas/Admin/Controllers/AdminLanchesReportController.cs"
click node_sales_report "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Areas/Admin/Controllers/AdminRelatorioVendasController.cs"
click node_sales_service "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Areas/Admin/Servicos/RelatorioVendasService.cs"
click node_sales_chart "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Areas/Admin/Controllers/AdminGraficoController.cs"
click node_chart_service "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Areas/Admin/Servicos/GraficoVendasService.cs"
click node_fast_report "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Areas/Admin/FastReportUtils/HelperFastReport.cs"
click node_repositories "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Repositories/LancheRepository.cs"
click node_categories_repo "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Repositories/CategoriaRepository.cs"
click node_db "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Context/AppDbContext.cs"
click node_catalog_models "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Models/Lanche.cs"
click node_category_model "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Models/Categoria.cs"
click node_cart_item "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Models/CarrinhoCompraItem.cs"
click node_order_model "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Models/Pedido.cs"
click node_order_detail "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Models/PedidoDetalhe.cs"
click node_chart_model "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Models/LancheGrafico.cs"
click node_file_model "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Models/FileManagerModel.cs"
click node_image_config "https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Models/ConfigurationImagens.cs"

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_account,node_home,node_catalog,node_category_menu,node_contact toneBlue
class node_cart_controller,node_cart,node_cart_summary,node_checkout,node_order_repo,node_sqlserver toneAmber
class node_admin_categories,node_admin_lanches,node_admin_images,node_admin_orders,node_admin_reports,node_sales_report,node_sales_service,node_sales_chart,node_chart_service,node_fast_report toneMint
class node_repositories,node_categories_repo,node_db,node_catalog_models,node_category_model,node_cart_item,node_order_model,node_order_detail,node_chart_model,node_file_model,node_image_config toneRose
class node_customer,node_identity toneIndigo
```

## Components

### Customer storefront

- [Accounts](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Controllers/AccountController.cs): `LanchesMac/Controllers/AccountController.cs`
- [Home catalog](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Controllers/HomeController.cs): `LanchesMac/Controllers/HomeController.cs`
- [Lanche catalog](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Controllers/LancheController.cs): `LanchesMac/Controllers/LancheController.cs`
- [Category menu](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Components/CategoriaMenu.cs): `LanchesMac/Components/CategoriaMenu.cs`
- [Contact](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Controllers/ContatoController.cs): `LanchesMac/Controllers/ContatoController.cs`

### Cart and checkout

- [Cart actions](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Controllers/CarrinhoCompraController.cs): `LanchesMac/Controllers/CarrinhoCompraController.cs`
- [Session cart](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Models/CarrinhoCompra.cs): `LanchesMac/Models/CarrinhoCompra.cs`
- [Cart summary](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Components/CarrinhoCompraResumo.cs): `LanchesMac/Components/CarrinhoCompraResumo.cs`
- [Checkout](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Controllers/PedidoController.cs): `LanchesMac/Controllers/PedidoController.cs`
- [Order creation](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Repositories/PedidoRepository.cs): `LanchesMac/Repositories/PedidoRepository.cs`

### Admin operations

- [Category admin](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Areas/Admin/Controllers/AdminCategoriasController.cs): `LanchesMac/Areas/Admin/Controllers/AdminCategoriasController.cs`
- [Lanche admin](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Areas/Admin/Controllers/AdminLanchesController.cs): `LanchesMac/Areas/Admin/Controllers/AdminLanchesController.cs`
- [Image management](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Areas/Admin/Controllers/AdminImagensController.cs): `LanchesMac/Areas/Admin/Controllers/AdminImagensController.cs`
- [Order admin](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Areas/Admin/Controllers/AdminPedidosController.cs): `LanchesMac/Areas/Admin/Controllers/AdminPedidosController.cs`
- [Lanche reports](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Areas/Admin/Controllers/AdminLanchesReportController.cs): `LanchesMac/Areas/Admin/Controllers/AdminLanchesReportController.cs`
- [Sales reports](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Areas/Admin/Controllers/AdminRelatorioVendasController.cs): `LanchesMac/Areas/Admin/Controllers/AdminRelatorioVendasController.cs`
- [Sales report service](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Areas/Admin/Servicos/RelatorioVendasService.cs): `LanchesMac/Areas/Admin/Servicos/RelatorioVendasService.cs`
- [Sales charts](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Areas/Admin/Controllers/AdminGraficoController.cs): `LanchesMac/Areas/Admin/Controllers/AdminGraficoController.cs`
- [Chart service](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Areas/Admin/Servicos/GraficoVendasService.cs): `LanchesMac/Areas/Admin/Servicos/GraficoVendasService.cs`
- [Report helper](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Areas/Admin/FastReportUtils/HelperFastReport.cs): `LanchesMac/Areas/Admin/FastReportUtils/HelperFastReport.cs`

### Persistence and domain

- [Catalog repositories](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Repositories/LancheRepository.cs): `LanchesMac/Repositories/LancheRepository.cs`
- [Category repository](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Repositories/CategoriaRepository.cs): `LanchesMac/Repositories/CategoriaRepository.cs`
- [Application database](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Context/AppDbContext.cs): `LanchesMac/Context/AppDbContext.cs`
- [Catalog entities](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Models/Lanche.cs): `LanchesMac/Models/Lanche.cs`
- [Category entity](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Models/Categoria.cs): `LanchesMac/Models/Categoria.cs`
- [Cart item](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Models/CarrinhoCompraItem.cs): `LanchesMac/Models/CarrinhoCompraItem.cs`
- [Order entity](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Models/Pedido.cs): `LanchesMac/Models/Pedido.cs`
- [Order detail](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Models/PedidoDetalhe.cs): `LanchesMac/Models/PedidoDetalhe.cs`
- [Chart data](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Models/LancheGrafico.cs): `LanchesMac/Models/LancheGrafico.cs`
- [Image file model](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Models/FileManagerModel.cs): `LanchesMac/Models/FileManagerModel.cs`
- [Image settings](https://github.com/andersonaires-cc/projetolanches/blob/master/LanchesMac/Models/ConfigurationImagens.cs): `LanchesMac/Models/ConfigurationImagens.cs`

### Other components

- **Shopper**
- **SQL Server**
- **ASP.NET Identity**

## Connections

- Shopper → Accounts: signs in (evidence: `LanchesMac/Controllers/AccountController.cs`)
- Shopper → Home catalog: browses
- Shopper → Lanche catalog: selects items
- Shopper → Cart actions: updates cart (evidence: `LanchesMac/Controllers/CarrinhoCompraController.cs`)
- Shopper → Checkout: checks out (evidence: `LanchesMac/Controllers/PedidoController.cs`)
- Home catalog → Catalog repositories: queries lanches (evidence: `LanchesMac/Controllers/HomeController.cs`)
- Lanche catalog → Catalog repositories: queries lanches (evidence: `LanchesMac/Controllers/LancheController.cs`)
- Category menu → Category repository: loads categories
- Accounts → ASP.NET Identity: authenticates (evidence: `LanchesMac/Controllers/AccountController.cs`)
- Cart actions → Session cart: changes cart (evidence: `LanchesMac/Controllers/CarrinhoCompraController.cs`)
- Cart summary → Session cart: reads cart (evidence: `LanchesMac/Components/CarrinhoCompraResumo.cs`)
- Checkout → Session cart: loads items (evidence: `LanchesMac/Controllers/PedidoController.cs`)
- Checkout → Order creation: creates order (evidence: `LanchesMac/Controllers/PedidoController.cs`)
- Order creation → Application database: writes orders (evidence: `LanchesMac/Repositories/PedidoRepository.cs`)
- Session cart → Application database: persists cart (evidence: `LanchesMac/Models/CarrinhoCompra.cs`)
- Catalog repositories → Application database: queries catalog (evidence: `LanchesMac/Repositories/LancheRepository.cs`)
- Category repository → Application database: queries categories (evidence: `LanchesMac/Repositories/CategoriaRepository.cs`)
- Application database → SQL Server: stores data
- Category admin → Application database: manages categories (evidence: `LanchesMac/Areas/Admin/Controllers/AdminCategoriasController.cs`)
- Lanche admin → Application database: manages lanches (evidence: `LanchesMac/Areas/Admin/Controllers/AdminLanchesController.cs`)
- Image management → Image file model: uses file model (evidence: `LanchesMac/Areas/Admin/Controllers/AdminImagensController.cs`)
- Image management → Image settings: reads settings (evidence: `LanchesMac/Areas/Admin/Controllers/AdminImagensController.cs`)
- Order admin → Application database: manages orders (evidence: `LanchesMac/Areas/Admin/Controllers/AdminPedidosController.cs`)
- Sales reports → Sales report service: uses report service
- Sales report service → Application database: queries sales (evidence: `LanchesMac/Areas/Admin/Servicos/RelatorioVendasService.cs`)
- Sales charts → Chart service: uses chart service
- Chart service → Application database: queries chart data (evidence: `LanchesMac/Areas/Admin/Servicos/GraficoVendasService.cs`)
- Lanche reports → Report helper: uses report helper
- Application database → Catalog entities: maps entities (evidence: `LanchesMac/Context/AppDbContext.cs`)
- Application database → Category entity: maps entities (evidence: `LanchesMac/Context/AppDbContext.cs`)
- Application database → Cart item: maps entities (evidence: `LanchesMac/Context/AppDbContext.cs`)
- Application database → Order entity: maps entities (evidence: `LanchesMac/Context/AppDbContext.cs`)
- Application database → Order detail: maps entities (evidence: `LanchesMac/Context/AppDbContext.cs`)
- Sales report service → Order entity: reads order data (evidence: `LanchesMac/Areas/Admin/Servicos/RelatorioVendasService.cs`)
- Chart service → Chart data: builds chart data (evidence: `LanchesMac/Areas/Admin/Servicos/GraficoVendasService.cs`)
