# namsrkt/refonte-afo architecture

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

- Interactive diagram: https://gitdiagram.com/namsrkt/refonte-afo
- Repository: https://github.com/namsrkt/refonte-afo

## Overview

This is a small Next.js landing page with French/English localization. The primary user-facing path is a locale-specific home page rendered with a shared navigation bar and hero section; users can switch locales while retaining the current path. Localization is implemented through shared routing configuration, navigation helpers, middleware, and request-time message loading. The excerpts show these direct relationships, but do not establish a runtime call from the request configuration to the app layout, so that link is omitted.

Main entry points: [`src/i18n/routing.ts`](https://github.com/namsrkt/refonte-afo/blob/main/src/i18n/routing.ts) (Locale routing), [`src/components/common/navbar.tsx`](https://github.com/namsrkt/refonte-afo/blob/main/src/components/common/navbar.tsx) (Navigation bar), [`src/components/common/locale-switcher.tsx`](https://github.com/namsrkt/refonte-afo/blob/main/src/components/common/locale-switcher.tsx) (Locale switcher), [`src/i18n/navigation.ts`](https://github.com/namsrkt/refonte-afo/blob/main/src/i18n/navigation.ts) (Localized navigation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Landing page"]
  node_layout["Locale layout<br/>[layout.tsx]"]
  node_home["Home page<br/>[page.tsx]"]
  node_hero["Hero section<br/>[hero-section.tsx]"]
end

subgraph group_shell["Shared shell"]
  node_navbar["Navigation bar<br/>[navbar.tsx]"]
  node_switcher["Locale switcher"]
end

subgraph group_i18n["Localization"]
  node_middleware["Locale middleware<br/>[proxy.ts]"]
  node_navigation["Localized navigation<br/>[navigation.ts]"]
  node_routing["Locale routing<br/>[routing.ts]"]
  node_request["Message loading<br/>[request.ts]"]
  node_messages["Translation catalogs"]
end

node_visitor(("Site visitor"))

node_layout -->|"renders"| node_navbar
node_layout -->|"validates locale"| node_routing
node_home -->|"renders"| node_hero
node_navbar -->|"renders"| node_switcher
node_navbar -->|"links through"| node_navigation
node_switcher -->|"changes path"| node_navigation
node_switcher -->|"lists locales"| node_routing
node_navigation -->|"configures"| node_routing
node_middleware -->|"uses configuration"| node_routing
node_request -->|"validates locale"| node_routing
node_request -->|"loads messages"| node_messages

click node_middleware "https://github.com/namsrkt/refonte-afo/blob/main/src/proxy.ts"
click node_layout "https://github.com/namsrkt/refonte-afo/blob/main/src/app/%5Blocale%5D/layout.tsx"
click node_home "https://github.com/namsrkt/refonte-afo/blob/main/src/app/%5Blocale%5D/page.tsx"
click node_hero "https://github.com/namsrkt/refonte-afo/blob/main/src/features/home/heroSection/hero-section.tsx"
click node_navbar "https://github.com/namsrkt/refonte-afo/blob/main/src/components/common/navbar.tsx"
click node_switcher "https://github.com/namsrkt/refonte-afo/blob/main/src/components/common/locale-switcher.tsx"
click node_navigation "https://github.com/namsrkt/refonte-afo/blob/main/src/i18n/navigation.ts"
click node_routing "https://github.com/namsrkt/refonte-afo/blob/main/src/i18n/routing.ts"
click node_request "https://github.com/namsrkt/refonte-afo/blob/main/src/i18n/request.ts"
click node_messages "https://github.com/namsrkt/refonte-afo/tree/main/messages"

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_layout,node_home,node_hero toneBlue
class node_navbar,node_switcher toneAmber
class node_middleware,node_navigation,node_routing,node_request,node_messages toneMint
class node_visitor toneIndigo
```

## Components

### Landing page

- [Locale layout](https://github.com/namsrkt/refonte-afo/blob/main/src/app/%5Blocale%5D/layout.tsx): `src/app/[locale]/layout.tsx`
- [Home page](https://github.com/namsrkt/refonte-afo/blob/main/src/app/%5Blocale%5D/page.tsx): `src/app/[locale]/page.tsx`
- [Hero section](https://github.com/namsrkt/refonte-afo/blob/main/src/features/home/heroSection/hero-section.tsx): `src/features/home/heroSection/hero-section.tsx`

### Shared shell

- [Navigation bar](https://github.com/namsrkt/refonte-afo/blob/main/src/components/common/navbar.tsx): `src/components/common/navbar.tsx`
- [Locale switcher](https://github.com/namsrkt/refonte-afo/blob/main/src/components/common/locale-switcher.tsx): `src/components/common/locale-switcher.tsx`

### Localization

- [Locale middleware](https://github.com/namsrkt/refonte-afo/blob/main/src/proxy.ts): `src/proxy.ts`
- [Localized navigation](https://github.com/namsrkt/refonte-afo/blob/main/src/i18n/navigation.ts): `src/i18n/navigation.ts`
- [Locale routing](https://github.com/namsrkt/refonte-afo/blob/main/src/i18n/routing.ts): `src/i18n/routing.ts`
- [Message loading](https://github.com/namsrkt/refonte-afo/blob/main/src/i18n/request.ts): `src/i18n/request.ts`
- [Translation catalogs](https://github.com/namsrkt/refonte-afo/tree/main/messages): `messages`

### Other components

- **Site visitor**

## Connections

- Locale layout → Navigation bar: renders (evidence: `src/app/[locale]/layout.tsx`)
- Locale layout → Locale routing: validates locale (evidence: `src/app/[locale]/layout.tsx`)
- Home page → Hero section: renders (evidence: `src/app/[locale]/page.tsx`)
- Navigation bar → Locale switcher: renders (evidence: `src/components/common/navbar.tsx`)
- Navigation bar → Localized navigation: links through (evidence: `src/components/common/navbar.tsx`)
- Locale switcher → Localized navigation: changes path (evidence: `src/components/common/locale-switcher.tsx`)
- Locale switcher → Locale routing: lists locales (evidence: `src/components/common/locale-switcher.tsx`)
- Localized navigation → Locale routing: configures (evidence: `src/i18n/navigation.ts`)
- Locale middleware → Locale routing: uses configuration (evidence: `src/proxy.ts`)
- Message loading → Locale routing: validates locale (evidence: `src/i18n/request.ts`)
- Message loading → Translation catalogs: loads messages (evidence: `src/i18n/request.ts`)
