# gabrielbandoch/archiflow architecture

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

- Interactive diagram: https://gitdiagram.com/gabrielbandoch/archiflow
- Repository: https://github.com/gabrielbandoch/archiflow

## Overview

ArchiFlow is an Angular frontend for architecture-project management. Staff enter through the guarded application routes to manage projects, leads, clients, and project templates; the documented commercial workflow includes converting leads into clients. Clients use a separate guarded portal to follow project stages, view documents, and reach support. Domain screens call HTTP services that communicate with the backend; sampled client-editing code also consults ViaCEP. The tree and excerpts establish these modules, but do not show all screen-to-service wiring, so uncertain links are omitted.

Main entry points: [`src/app/app.routes.ts`](https://github.com/gabrielbandoch/archiflow/blob/main/src/app/app.routes.ts) (Route access), [`src/app/components/portal/portal-cliente/portal-cliente.component.ts`](https://github.com/gabrielbandoch/archiflow/blob/main/src/app/components/portal/portal-cliente/portal-cliente.component.ts) (Client portal), [`src/app/components/clientes/detalhes-cliente/detalhes-cliente.component.ts`](https://github.com/gabrielbandoch/archiflow/blob/main/src/app/components/clientes/detalhes-cliente/detalhes-cliente.component.ts) (Client details), [`src/app/core/api/clientes/cliente.service.ts`](https://github.com/gabrielbandoch/archiflow/blob/main/src/app/core/api/clientes/cliente.service.ts) (Client API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["Application shell"]
  node_app["App root<br/>[app.component.ts]"]
  node_routes["Route access<br/>[app.routes.ts]"]
  node_login["Login screen<br/>[login.component.ts]"]
  node_mainlayout["Staff layout"]
  node_portallayout["Portal layout"]
end

subgraph group_crm["Commercial management"]
  node_leads["Lead pipeline<br/>[leads.component.ts]"]
  node_leadorigins["Lead sources"]
  node_leadconversion["Lead conversion"]
  node_clients["Client list"]
  node_clientdetail["Client details"]
  node_clientedit["Edit client"]
end

subgraph group_delivery["Projects and portal"]
  node_projects["Project list"]
  node_projectdetail["Project details"]
  node_templates["Project templates"]
  node_portal["Client portal"]
  node_timeline["Project timeline"]
  node_documents["Project documents"]
  node_support["Client support"]
end

subgraph group_platform["Services and APIs"]
  node_authservice["Authentication<br/>[auth.service.ts]"]
  node_authapi["Authentication API"]
  node_clientapi["Client API<br/>[cliente.service.ts]"]
  node_leadapi["Lead API<br/>[lead.service.ts]"]
  node_projectapi["Project API<br/>[projeto.service.ts]"]
  node_fileapi["File API<br/>[arquivo.service.ts]"]
  node_viacep["Address lookup<br/>[via-cep.service.ts]"]
end

node_staff(("Staff user"))
node_client(("Client user"))
node_backend{{"Backend API"}}
node_cepservice{{"ViaCEP service"}}

node_app -->|"hosts routes"| node_routes
node_staff -->|"opens staff routes"| node_routes
node_client -->|"opens portal routes"| node_routes
node_routes -->|"loads login"| node_login
node_routes -->|"loads staff shell"| node_mainlayout
node_routes -->|"loads portal shell"| node_portallayout
node_routes -->|"loads projects"| node_projects
node_routes -->|"loads project"| node_projectdetail
node_routes -->|"loads leads"| node_leads
node_routes -->|"loads sources"| node_leadorigins
node_routes -->|"loads clients"| node_clients
node_routes -->|"loads client"| node_clientdetail
node_routes -->|"loads templates"| node_templates
node_routes -->|"loads portal"| node_portal
node_authservice -->|"calls login"| node_authapi
node_authapi -->|"sends requests"| node_backend
node_clients -->|"loads and updates"| node_clientapi
node_clientdetail -->|"reads and updates"| node_clientapi
node_clientdetail -->|"loads lead history"| node_leadapi
node_clientdetail -->|"loads projects"| node_projectapi
node_clientdetail -->|"opens editor"| node_clientedit
node_clientedit -->|"updates client"| node_clientapi
node_clientedit -->|"looks up address"| node_viacep
node_viacep -.->|"queries address"| node_cepservice
node_clientapi -->|"sends requests"| node_backend
node_leadapi -->|"sends requests"| node_backend
node_projectapi -->|"sends requests"| node_backend
node_portal -->|"loads project"| node_projectapi
node_portal -->|"loads documents"| node_fileapi
node_portal -->|"loads client name"| node_clientapi
node_portal -->|"renders stages"| node_timeline
node_portal -->|"renders files"| node_documents
node_portal -->|"renders support"| node_support
node_fileapi -->|"sends requests"| node_backend

click node_app "https://github.com/gabrielbandoch/archiflow/blob/main/src/app/app.component.ts"
click node_routes "https://github.com/gabrielbandoch/archiflow/blob/main/src/app/app.routes.ts"
click node_login "https://github.com/gabrielbandoch/archiflow/blob/main/src/app/components/autenticacao/login/login.component.ts"
click node_mainlayout "https://github.com/gabrielbandoch/archiflow/blob/main/src/app/layout/main-layout/main-layout.component.ts"
click node_portallayout "https://github.com/gabrielbandoch/archiflow/blob/main/src/app/layout/portal-layout/portal-layout.component.ts"
click node_leads "https://github.com/gabrielbandoch/archiflow/blob/main/src/app/components/leads/leads.component.ts"
click node_leadorigins "https://github.com/gabrielbandoch/archiflow/blob/main/src/app/components/leads/origens-lead/origens-lead.component.ts"
click node_leadconversion "https://github.com/gabrielbandoch/archiflow/blob/main/src/app/dialogs/leads/conversao-lead-modal/conversao-lead-modal.component.ts"
click node_clients "https://github.com/gabrielbandoch/archiflow/blob/main/src/app/components/clientes/lista-clientes/lista-clientes.component.ts"
click node_clientdetail "https://github.com/gabrielbandoch/archiflow/blob/main/src/app/components/clientes/detalhes-cliente/detalhes-cliente.component.ts"
click node_clientedit "https://github.com/gabrielbandoch/archiflow/blob/main/src/app/dialogs/clientes/editar-cliente-modal/editar-cliente-modal.component.ts"
click node_projects "https://github.com/gabrielbandoch/archiflow/blob/main/src/app/components/projetos/lista-projetos/lista-projetos.component.ts"
click node_projectdetail "https://github.com/gabrielbandoch/archiflow/blob/main/src/app/components/projetos/detalhes-projeto/detalhes-projeto.component.ts"
click node_templates "https://github.com/gabrielbandoch/archiflow/blob/main/src/app/components/configuracoes/templates-projeto/templates-projeto.component.ts"
click node_portal "https://github.com/gabrielbandoch/archiflow/blob/main/src/app/components/portal/portal-cliente/portal-cliente.component.ts"
click node_timeline "https://github.com/gabrielbandoch/archiflow/blob/main/src/app/components/portal/portal-timeline/portal-timeline.component.ts"
click node_documents "https://github.com/gabrielbandoch/archiflow/blob/main/src/app/components/portal/portal-documentos/portal-documentos.component.ts"
click node_support "https://github.com/gabrielbandoch/archiflow/blob/main/src/app/components/portal/portal-suporte/portal-suporte.component.ts"
click node_authservice "https://github.com/gabrielbandoch/archiflow/blob/main/src/app/core/services/auth.service.ts"
click node_authapi "https://github.com/gabrielbandoch/archiflow/blob/main/src/app/core/api/auth/autenticacao.service.ts"
click node_clientapi "https://github.com/gabrielbandoch/archiflow/blob/main/src/app/core/api/clientes/cliente.service.ts"
click node_leadapi "https://github.com/gabrielbandoch/archiflow/blob/main/src/app/core/api/leads/lead.service.ts"
click node_projectapi "https://github.com/gabrielbandoch/archiflow/blob/main/src/app/core/api/projetos/projeto.service.ts"
click node_fileapi "https://github.com/gabrielbandoch/archiflow/blob/main/src/app/core/api/projetos/arquivo.service.ts"
click node_viacep "https://github.com/gabrielbandoch/archiflow/blob/main/src/app/core/services/via-cep.service.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_login,node_mainlayout,node_portallayout,node_staff,node_client toneBlue
class node_leads,node_leadorigins,node_leadconversion,node_clients,node_clientdetail,node_clientedit toneAmber
class node_projects,node_projectdetail,node_templates,node_portal,node_timeline,node_documents,node_support,node_backend toneMint
class node_authservice,node_authapi,node_clientapi,node_leadapi,node_projectapi,node_fileapi,node_viacep toneRose
class node_cepservice toneIndigo
```

## Components

### Application shell

- [App root](https://github.com/gabrielbandoch/archiflow/blob/main/src/app/app.component.ts): `src/app/app.component.ts`
- [Route access](https://github.com/gabrielbandoch/archiflow/blob/main/src/app/app.routes.ts): `src/app/app.routes.ts`
- [Login screen](https://github.com/gabrielbandoch/archiflow/blob/main/src/app/components/autenticacao/login/login.component.ts): `src/app/components/autenticacao/login/login.component.ts`
- [Staff layout](https://github.com/gabrielbandoch/archiflow/blob/main/src/app/layout/main-layout/main-layout.component.ts): `src/app/layout/main-layout/main-layout.component.ts`
- [Portal layout](https://github.com/gabrielbandoch/archiflow/blob/main/src/app/layout/portal-layout/portal-layout.component.ts): `src/app/layout/portal-layout/portal-layout.component.ts`

### Commercial management

- [Lead pipeline](https://github.com/gabrielbandoch/archiflow/blob/main/src/app/components/leads/leads.component.ts): `src/app/components/leads/leads.component.ts`
- [Lead sources](https://github.com/gabrielbandoch/archiflow/blob/main/src/app/components/leads/origens-lead/origens-lead.component.ts): `src/app/components/leads/origens-lead/origens-lead.component.ts`
- [Lead conversion](https://github.com/gabrielbandoch/archiflow/blob/main/src/app/dialogs/leads/conversao-lead-modal/conversao-lead-modal.component.ts): `src/app/dialogs/leads/conversao-lead-modal/conversao-lead-modal.component.ts`
- [Client list](https://github.com/gabrielbandoch/archiflow/blob/main/src/app/components/clientes/lista-clientes/lista-clientes.component.ts): `src/app/components/clientes/lista-clientes/lista-clientes.component.ts`
- [Client details](https://github.com/gabrielbandoch/archiflow/blob/main/src/app/components/clientes/detalhes-cliente/detalhes-cliente.component.ts): `src/app/components/clientes/detalhes-cliente/detalhes-cliente.component.ts`
- [Edit client](https://github.com/gabrielbandoch/archiflow/blob/main/src/app/dialogs/clientes/editar-cliente-modal/editar-cliente-modal.component.ts): `src/app/dialogs/clientes/editar-cliente-modal/editar-cliente-modal.component.ts`

### Projects and portal

- [Project list](https://github.com/gabrielbandoch/archiflow/blob/main/src/app/components/projetos/lista-projetos/lista-projetos.component.ts): `src/app/components/projetos/lista-projetos/lista-projetos.component.ts`
- [Project details](https://github.com/gabrielbandoch/archiflow/blob/main/src/app/components/projetos/detalhes-projeto/detalhes-projeto.component.ts): `src/app/components/projetos/detalhes-projeto/detalhes-projeto.component.ts`
- [Project templates](https://github.com/gabrielbandoch/archiflow/blob/main/src/app/components/configuracoes/templates-projeto/templates-projeto.component.ts): `src/app/components/configuracoes/templates-projeto/templates-projeto.component.ts`
- [Client portal](https://github.com/gabrielbandoch/archiflow/blob/main/src/app/components/portal/portal-cliente/portal-cliente.component.ts): `src/app/components/portal/portal-cliente/portal-cliente.component.ts`
- [Project timeline](https://github.com/gabrielbandoch/archiflow/blob/main/src/app/components/portal/portal-timeline/portal-timeline.component.ts): `src/app/components/portal/portal-timeline/portal-timeline.component.ts`
- [Project documents](https://github.com/gabrielbandoch/archiflow/blob/main/src/app/components/portal/portal-documentos/portal-documentos.component.ts): `src/app/components/portal/portal-documentos/portal-documentos.component.ts`
- [Client support](https://github.com/gabrielbandoch/archiflow/blob/main/src/app/components/portal/portal-suporte/portal-suporte.component.ts): `src/app/components/portal/portal-suporte/portal-suporte.component.ts`

### Services and APIs

- [Authentication](https://github.com/gabrielbandoch/archiflow/blob/main/src/app/core/services/auth.service.ts): `src/app/core/services/auth.service.ts`
- [Authentication API](https://github.com/gabrielbandoch/archiflow/blob/main/src/app/core/api/auth/autenticacao.service.ts): `src/app/core/api/auth/autenticacao.service.ts`
- [Client API](https://github.com/gabrielbandoch/archiflow/blob/main/src/app/core/api/clientes/cliente.service.ts): `src/app/core/api/clientes/cliente.service.ts`
- [Lead API](https://github.com/gabrielbandoch/archiflow/blob/main/src/app/core/api/leads/lead.service.ts): `src/app/core/api/leads/lead.service.ts`
- [Project API](https://github.com/gabrielbandoch/archiflow/blob/main/src/app/core/api/projetos/projeto.service.ts): `src/app/core/api/projetos/projeto.service.ts`
- [File API](https://github.com/gabrielbandoch/archiflow/blob/main/src/app/core/api/projetos/arquivo.service.ts): `src/app/core/api/projetos/arquivo.service.ts`
- [Address lookup](https://github.com/gabrielbandoch/archiflow/blob/main/src/app/core/services/via-cep.service.ts): `src/app/core/services/via-cep.service.ts`

### Other components

- **Staff user**
- **Client user**
- **Backend API**
- **ViaCEP service**

## Connections

- App root → Route access: hosts routes
- Staff user → Route access: opens staff routes
- Client user → Route access: opens portal routes
- Route access → Login screen: loads login
- Route access → Staff layout: loads staff shell
- Route access → Portal layout: loads portal shell
- Route access → Project list: loads projects
- Route access → Project details: loads project
- Route access → Lead pipeline: loads leads
- Route access → Lead sources: loads sources
- Route access → Client list: loads clients
- Route access → Client details: loads client
- Route access → Project templates: loads templates
- Route access → Client portal: loads portal
- Authentication → Authentication API: calls login
- Authentication API → Backend API: sends requests
- Client list → Client API: loads and updates
- Client details → Client API: reads and updates
- Client details → Lead API: loads lead history
- Client details → Project API: loads projects
- Client details → Edit client: opens editor
- Edit client → Client API: updates client
- Edit client → Address lookup: looks up address
- Address lookup → ViaCEP service: queries address
- Client API → Backend API: sends requests
- Lead API → Backend API: sends requests
- Project API → Backend API: sends requests
- Client portal → Project API: loads project
- Client portal → File API: loads documents
- Client portal → Client API: loads client name
- Client portal → Project timeline: renders stages
- Client portal → Project documents: renders files
- Client portal → Client support: renders support
- File API → Backend API: sends requests
