# fabio-tiago/depaco architecture

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

- Interactive diagram: https://gitdiagram.com/fabio-tiago/depaco
- Repository: https://github.com/fabio-tiago/depaco

## Overview

DEPACO is a Next.js site for discovering and printing children’s coloring pages and educational activities, with a premium-pack sales funnel. Visitors browse or search drawings, open a drawing page, and can download/print or follow a pack offer to checkout. The map also includes the blog, activity generators, contact flow, and purchase tracking. Edges reflect shown imports/calls or README statements; some integrations and unsampled flows are therefore not connected.

Main entry points: [`lib/algolia.ts`](https://github.com/fabio-tiago/depaco/blob/main/lib/algolia.ts) (Search access), [`app/page.tsx`](https://github.com/fabio-tiago/depaco/blob/main/app/page.tsx) (Home), [`app/desenhos/[id]/page.tsx`](https://github.com/fabio-tiago/depaco/blob/main/app/desenhos/%5Bid%5D/page.tsx) (Drawing page), [`components/DesenhoCard.tsx`](https://github.com/fabio-tiago/depaco/blob/main/components/DesenhoCard.tsx) (Drawing cards)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Discovery &amp; browsing"]
  node_home["Home<br/>[page.tsx]"]
  node_search["Drawing search<br/>[page.tsx]"]
  node_search_ui["Autocomplete"]
  node_drawing_detail["Drawing page<br/>[page.tsx]"]
  node_drawing_card["Drawing cards<br/>[DesenhoCard.tsx]"]
  node_category_pages["Category listings<br/>[page.tsx]"]
  node_character_pages["Character listings<br/>[page.tsx]"]
  node_friendly_pages["Curated pages<br/>[page.tsx]"]
  node_categories["Category definitions<br/>[categorias.ts]"]
  node_friendly_data["Curated page data<br/>[paginasFofas.ts]"]
  node_social_sharing["Share drawing"]
end

subgraph group_activities["Educational activities"]
  node_activities_index["Activity directory<br/>[page.tsx]"]
  node_activity_category["Activity categories<br/>[page.tsx]"]
  node_activity_detail["Activity page<br/>[page.tsx]"]
  node_activity_data["Activity catalog<br/>[atividades-data.ts]"]
  node_word_search["Word search game"]
  node_maze["Maze generator"]
end

subgraph group_content["Blog &amp; contact"]
  node_blog_list["Blog listing<br/>[page.tsx]"]
  node_blog_post["Blog article<br/>[page.tsx]"]
  node_blog_data["Markdown posts<br/>[blog.ts]"]
  node_contact_page["Contact page<br/>[page.tsx]"]
  node_contact_form["Contact form"]
  node_contact_api["Contact endpoint<br/>[route.ts]"]
end

subgraph group_commerce["Packs &amp; conversion"]
  node_offer_config["Pack catalog<br/>[oferta.ts]"]
  node_offer_card["Offer card<br/>[OfertaCard.tsx]"]
  node_pack_page["Pack page<br/>[page.tsx]"]
  node_checkout_button["Checkout button<br/>[BotaoCheckout.tsx]"]
  node_checkout_embed["Embedded checkout"]
  node_payment_provider["Payment provider"]
  node_thank_you["Purchase confirmation<br/>[page.tsx]"]
  node_purchase_tracker["Purchase tracking"]
end

subgraph group_shared["Shared services"]
  node_algolia_client["Search access<br/>[algolia.ts]"]
  node_algolia_service[("Algolia index")]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_home
node_visitor -->|"searches"| node_search
node_visitor -->|"opens"| node_drawing_detail
node_visitor -->|"browses"| node_activities_index
node_visitor -->|"reads"| node_blog_list
node_visitor -->|"contacts"| node_contact_page
node_visitor -->|"views offer"| node_pack_page
node_home -->|"loads highlights"| node_algolia_client
node_home -->|"loads posts"| node_blog_data
node_home -->|"renders offer"| node_offer_card
node_home -->|"renders search"| node_search_ui
node_search -->|"searches index"| node_algolia_client
node_search -->|"renders hits"| node_drawing_card
node_search -->|"renders offer"| node_offer_card
node_search_ui -->|"queries"| node_algolia_client
node_algolia_client -->|"searches"| node_algolia_service
node_drawing_detail -->|"loads drawing"| node_algolia_client
node_drawing_detail -->|"renders related"| node_drawing_card
node_drawing_detail -->|"renders offer"| node_offer_card
node_drawing_detail -->|"offers sharing"| node_social_sharing
node_category_pages -->|"loads drawings"| node_algolia_client
node_category_pages -->|"uses category data"| node_categories
node_category_pages -->|"renders results"| node_drawing_card
node_character_pages -->|"loads drawings"| node_algolia_client
node_character_pages -->|"renders results"| node_drawing_card
node_friendly_pages -->|"loads page data"| node_friendly_data
node_friendly_pages -->|"loads drawings"| node_algolia_client
node_friendly_pages -->|"renders results"| node_drawing_card
node_activities_index -->|"lists activities"| node_activity_data
node_activity_category -->|"filters activities"| node_activity_data
node_activity_category -->|"renders game"| node_word_search
node_activity_detail -->|"loads activity"| node_activity_data
node_activity_detail -->|"renders game"| node_word_search
node_activity_detail -->|"renders generator"| node_maze
node_blog_list -->|"loads posts"| node_blog_data
node_blog_post -->|"loads article"| node_blog_data
node_contact_page -->|"renders form"| node_contact_form
node_contact_form -.->|"submits contact"| node_contact_api
node_pack_page -->|"loads pack"| node_offer_config
node_pack_page -->|"renders checkout"| node_checkout_button
node_pack_page -->|"renders checkout"| node_checkout_embed
node_checkout_button -.->|"starts payment"| node_payment_provider
node_checkout_embed -.->|"hosts checkout"| node_payment_provider
node_offer_card -->|"uses pack details"| node_offer_config
node_visitor -.->|"returns after purchase"| node_thank_you
node_thank_you -->|"renders tracker"| node_purchase_tracker

click node_home "https://github.com/fabio-tiago/depaco/blob/main/app/page.tsx"
click node_search "https://github.com/fabio-tiago/depaco/blob/main/app/buscar/page.tsx"
click node_search_ui "https://github.com/fabio-tiago/depaco/blob/main/components/SearchAutocomplete.tsx"
click node_drawing_detail "https://github.com/fabio-tiago/depaco/blob/main/app/desenhos/%5Bid%5D/page.tsx"
click node_drawing_card "https://github.com/fabio-tiago/depaco/blob/main/components/DesenhoCard.tsx"
click node_category_pages "https://github.com/fabio-tiago/depaco/blob/main/app/categorias/%5Bcategoria%5D/page.tsx"
click node_character_pages "https://github.com/fabio-tiago/depaco/blob/main/app/personagem/%5Bslug%5D/page.tsx"
click node_friendly_pages "https://github.com/fabio-tiago/depaco/blob/main/app/%5Bslug%5D/page.tsx"
click node_categories "https://github.com/fabio-tiago/depaco/blob/main/lib/categorias.ts"
click node_friendly_data "https://github.com/fabio-tiago/depaco/blob/main/lib/paginasFofas.ts"
click node_algolia_client "https://github.com/fabio-tiago/depaco/blob/main/lib/algolia.ts"
click node_activities_index "https://github.com/fabio-tiago/depaco/blob/main/app/atividades-educativas/page.tsx"
click node_activity_category "https://github.com/fabio-tiago/depaco/blob/main/app/atividades-educativas/categoria/%5Btipo%5D/page.tsx"
click node_activity_detail "https://github.com/fabio-tiago/depaco/blob/main/app/atividades-educativas/%5Bid%5D/page.tsx"
click node_activity_data "https://github.com/fabio-tiago/depaco/blob/main/lib/atividades-data.ts"
click node_word_search "https://github.com/fabio-tiago/depaco/blob/main/components/GeradorCacaPalavras.tsx"
click node_maze "https://github.com/fabio-tiago/depaco/blob/main/components/GeradorLabirinto.tsx"
click node_blog_list "https://github.com/fabio-tiago/depaco/blob/main/app/blog/page.tsx"
click node_blog_post "https://github.com/fabio-tiago/depaco/blob/main/app/blog/%5Bslug%5D/page.tsx"
click node_blog_data "https://github.com/fabio-tiago/depaco/blob/main/lib/blog.ts"
click node_contact_page "https://github.com/fabio-tiago/depaco/blob/main/app/contato/page.tsx"
click node_contact_form "https://github.com/fabio-tiago/depaco/blob/main/components/FormularioContato.tsx"
click node_contact_api "https://github.com/fabio-tiago/depaco/blob/main/app/api/contato/route.ts"
click node_offer_config "https://github.com/fabio-tiago/depaco/blob/main/lib/oferta.ts"
click node_offer_card "https://github.com/fabio-tiago/depaco/blob/main/components/OfertaCard.tsx"
click node_pack_page "https://github.com/fabio-tiago/depaco/blob/main/app/pack/%5Bid%5D/page.tsx"
click node_checkout_button "https://github.com/fabio-tiago/depaco/blob/main/components/BotaoCheckout.tsx"
click node_checkout_embed "https://github.com/fabio-tiago/depaco/blob/main/components/CheckoutElements.tsx"
click node_thank_you "https://github.com/fabio-tiago/depaco/blob/main/app/obrigado/page.tsx"
click node_purchase_tracker "https://github.com/fabio-tiago/depaco/blob/main/components/PurchaseTracker.tsx"
click node_social_sharing "https://github.com/fabio-tiago/depaco/blob/main/components/BotaoCompartilhar.tsx"

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_home,node_search,node_search_ui,node_drawing_detail,node_drawing_card,node_category_pages,node_character_pages,node_friendly_pages,node_categories,node_friendly_data,node_social_sharing toneBlue
class node_activities_index,node_activity_category,node_activity_detail,node_activity_data,node_word_search,node_maze toneAmber
class node_blog_list,node_blog_post,node_blog_data,node_contact_page,node_contact_form,node_contact_api toneMint
class node_offer_config,node_offer_card,node_pack_page,node_checkout_button,node_checkout_embed,node_payment_provider,node_thank_you,node_purchase_tracker toneRose
class node_algolia_client,node_algolia_service,node_visitor toneIndigo
```

## Components

### Discovery & browsing

- [Home](https://github.com/fabio-tiago/depaco/blob/main/app/page.tsx): `app/page.tsx`
- [Drawing search](https://github.com/fabio-tiago/depaco/blob/main/app/buscar/page.tsx): `app/buscar/page.tsx`
- [Autocomplete](https://github.com/fabio-tiago/depaco/blob/main/components/SearchAutocomplete.tsx): `components/SearchAutocomplete.tsx`
- [Drawing page](https://github.com/fabio-tiago/depaco/blob/main/app/desenhos/%5Bid%5D/page.tsx): `app/desenhos/[id]/page.tsx`
- [Drawing cards](https://github.com/fabio-tiago/depaco/blob/main/components/DesenhoCard.tsx): `components/DesenhoCard.tsx`
- [Category listings](https://github.com/fabio-tiago/depaco/blob/main/app/categorias/%5Bcategoria%5D/page.tsx): `app/categorias/[categoria]/page.tsx`
- [Character listings](https://github.com/fabio-tiago/depaco/blob/main/app/personagem/%5Bslug%5D/page.tsx): `app/personagem/[slug]/page.tsx`
- [Curated pages](https://github.com/fabio-tiago/depaco/blob/main/app/%5Bslug%5D/page.tsx): `app/[slug]/page.tsx`
- [Category definitions](https://github.com/fabio-tiago/depaco/blob/main/lib/categorias.ts): `lib/categorias.ts`
- [Curated page data](https://github.com/fabio-tiago/depaco/blob/main/lib/paginasFofas.ts): `lib/paginasFofas.ts`
- [Share drawing](https://github.com/fabio-tiago/depaco/blob/main/components/BotaoCompartilhar.tsx): `components/BotaoCompartilhar.tsx`

### Educational activities

- [Activity directory](https://github.com/fabio-tiago/depaco/blob/main/app/atividades-educativas/page.tsx): `app/atividades-educativas/page.tsx`
- [Activity categories](https://github.com/fabio-tiago/depaco/blob/main/app/atividades-educativas/categoria/%5Btipo%5D/page.tsx): `app/atividades-educativas/categoria/[tipo]/page.tsx`
- [Activity page](https://github.com/fabio-tiago/depaco/blob/main/app/atividades-educativas/%5Bid%5D/page.tsx): `app/atividades-educativas/[id]/page.tsx`
- [Activity catalog](https://github.com/fabio-tiago/depaco/blob/main/lib/atividades-data.ts): `lib/atividades-data.ts`
- [Word search game](https://github.com/fabio-tiago/depaco/blob/main/components/GeradorCacaPalavras.tsx): `components/GeradorCacaPalavras.tsx`
- [Maze generator](https://github.com/fabio-tiago/depaco/blob/main/components/GeradorLabirinto.tsx): `components/GeradorLabirinto.tsx`

### Blog & contact

- [Blog listing](https://github.com/fabio-tiago/depaco/blob/main/app/blog/page.tsx): `app/blog/page.tsx`
- [Blog article](https://github.com/fabio-tiago/depaco/blob/main/app/blog/%5Bslug%5D/page.tsx): `app/blog/[slug]/page.tsx`
- [Markdown posts](https://github.com/fabio-tiago/depaco/blob/main/lib/blog.ts): `lib/blog.ts`
- [Contact page](https://github.com/fabio-tiago/depaco/blob/main/app/contato/page.tsx): `app/contato/page.tsx`
- [Contact form](https://github.com/fabio-tiago/depaco/blob/main/components/FormularioContato.tsx): `components/FormularioContato.tsx`
- [Contact endpoint](https://github.com/fabio-tiago/depaco/blob/main/app/api/contato/route.ts): `app/api/contato/route.ts`

### Packs & conversion

- [Pack catalog](https://github.com/fabio-tiago/depaco/blob/main/lib/oferta.ts): `lib/oferta.ts`
- [Offer card](https://github.com/fabio-tiago/depaco/blob/main/components/OfertaCard.tsx): `components/OfertaCard.tsx`
- [Pack page](https://github.com/fabio-tiago/depaco/blob/main/app/pack/%5Bid%5D/page.tsx): `app/pack/[id]/page.tsx`
- [Checkout button](https://github.com/fabio-tiago/depaco/blob/main/components/BotaoCheckout.tsx): `components/BotaoCheckout.tsx`
- [Embedded checkout](https://github.com/fabio-tiago/depaco/blob/main/components/CheckoutElements.tsx): `components/CheckoutElements.tsx`
- **Payment provider**
- [Purchase confirmation](https://github.com/fabio-tiago/depaco/blob/main/app/obrigado/page.tsx): `app/obrigado/page.tsx`
- [Purchase tracking](https://github.com/fabio-tiago/depaco/blob/main/components/PurchaseTracker.tsx): `components/PurchaseTracker.tsx`

### Shared services

- [Search access](https://github.com/fabio-tiago/depaco/blob/main/lib/algolia.ts): `lib/algolia.ts`
- **Algolia index**

### Other components

- **Visitor**

## Connections

- Visitor → Home: opens (evidence: `app/page.tsx`)
- Visitor → Drawing search: searches (evidence: `app/buscar/page.tsx`)
- Visitor → Drawing page: opens (evidence: `app/desenhos/[id]/page.tsx`)
- Visitor → Activity directory: browses (evidence: `app/atividades-educativas/page.tsx`)
- Visitor → Blog listing: reads (evidence: `app/blog/page.tsx`)
- Visitor → Contact page: contacts (evidence: `app/contato/page.tsx`)
- Visitor → Pack page: views offer (evidence: `app/pack/[id]/page.tsx`)
- Home → Search access: loads highlights (evidence: `app/page.tsx`)
- Home → Markdown posts: loads posts (evidence: `app/page.tsx`)
- Home → Offer card: renders offer (evidence: `app/page.tsx`)
- Home → Autocomplete: renders search (evidence: `app/page.tsx`)
- Drawing search → Search access: searches index (evidence: `app/buscar/page.tsx`)
- Drawing search → Drawing cards: renders hits (evidence: `app/buscar/page.tsx`)
- Drawing search → Offer card: renders offer (evidence: `app/buscar/page.tsx`)
- Autocomplete → Search access: queries (evidence: `components/SearchAutocomplete.tsx`)
- Search access → Algolia index: searches (evidence: `lib/algolia.ts`)
- Drawing page → Search access: loads drawing (evidence: `app/desenhos/[id]/page.tsx`)
- Drawing page → Drawing cards: renders related (evidence: `app/desenhos/[id]/page.tsx`)
- Drawing page → Offer card: renders offer (evidence: `app/desenhos/[id]/page.tsx`)
- Drawing page → Share drawing: offers sharing (evidence: `app/desenhos/[id]/page.tsx`)
- Category listings → Search access: loads drawings (evidence: `app/categorias/[categoria]/page.tsx`)
- Category listings → Category definitions: uses category data (evidence: `app/categorias/[categoria]/page.tsx`)
- Category listings → Drawing cards: renders results (evidence: `app/categorias/[categoria]/page.tsx`)
- Character listings → Search access: loads drawings (evidence: `app/personagem/[slug]/page.tsx`)
- Character listings → Drawing cards: renders results (evidence: `app/personagem/[slug]/page.tsx`)
- Curated pages → Curated page data: loads page data (evidence: `app/[slug]/page.tsx`)
- Curated pages → Search access: loads drawings (evidence: `app/[slug]/page.tsx`)
- Curated pages → Drawing cards: renders results (evidence: `app/[slug]/page.tsx`)
- Activity directory → Activity catalog: lists activities (evidence: `app/atividades-educativas/page.tsx`)
- Activity categories → Activity catalog: filters activities (evidence: `app/atividades-educativas/categoria/[tipo]/page.tsx`)
- Activity categories → Word search game: renders game (evidence: `app/atividades-educativas/categoria/[tipo]/page.tsx`)
- Activity page → Activity catalog: loads activity (evidence: `app/atividades-educativas/[id]/page.tsx`)
- Activity page → Word search game: renders game (evidence: `app/atividades-educativas/[id]/page.tsx`)
- Activity page → Maze generator: renders generator (evidence: `app/atividades-educativas/[id]/page.tsx`)
- Blog listing → Markdown posts: loads posts (evidence: `app/blog/page.tsx`)
- Blog article → Markdown posts: loads article (evidence: `app/blog/[slug]/page.tsx`)
- Contact page → Contact form: renders form (evidence: `app/contato/page.tsx`)
- Contact form → Contact endpoint: submits contact
- Pack page → Pack catalog: loads pack (evidence: `app/pack/[id]/page.tsx`)
- Pack page → Checkout button: renders checkout (evidence: `app/pack/[id]/page.tsx`)
- Pack page → Embedded checkout: renders checkout (evidence: `app/pack/[id]/page.tsx`)
- Checkout button → Payment provider: starts payment
- Embedded checkout → Payment provider: hosts checkout
- Offer card → Pack catalog: uses pack details (evidence: `components/OfertaCard.tsx`)
- Visitor → Purchase confirmation: returns after purchase
- Purchase confirmation → Purchase tracking: renders tracker (evidence: `app/obrigado/page.tsx`)
