# 0xmattthemii/aryes-app-template architecture

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

- Interactive diagram: https://gitdiagram.com/0xmattthemii/aryes-app-template
- Repository: https://github.com/0xmattthemii/aryes-app-template

## Overview

This is a bilingual (English/French) corporate website with a Payload CMS for editable site content and a Better Auth integration. The main visitor flow is locale selection or redirection, then viewing the home or advisory page; CMS-managed content covers services, navigation, team, and site settings. The tree and excerpts establish the routes and content models, but do not show the page implementations or Payload configuration wiring, so those links are left out.

Main entry points: [`src/proxy.ts`](https://github.com/0xmattthemii/aryes-app-template/blob/main/src/proxy.ts) (Locale proxy), [`payload.config.ts`](https://github.com/0xmattthemii/aryes-app-template/blob/main/payload.config.ts) (Payload configuration), [`src/app/(payload)/api/[...slug]/route.ts`](https://github.com/0xmattthemii/aryes-app-template/blob/main/src/app/(payload)/api/%5B...slug%5D/route.ts) (Payload REST API), [`src/app/(payload)/api/graphql/route.ts`](https://github.com/0xmattthemii/aryes-app-template/blob/main/src/app/(payload)/api/graphql/route.ts) (GraphQL API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Visitor website"]
  node_proxy["Locale proxy<br/>[proxy.ts]"]
  node_home["Home page<br/>[page.tsx]"]
  node_advisory["Advisory page<br/>[page.tsx]"]
  node_layout["Locale layout<br/>[layout.tsx]"]
  node_header["Site header<br/>[Header.tsx]"]
  node_footer["Site footer<br/>[Footer.tsx]"]
end

subgraph group_content["CMS content"]
  node_homecontent["Home content<br/>[HomePage.ts]"]
  node_advisorycontent["Advisory content<br/>[AdvisoryPage.ts]"]
  node_navigation["Navigation<br/>[Navigation.ts]"]
  node_footercontent["Footer content<br/>[Footer.ts]"]
  node_settings["Site settings<br/>[SiteSettings.ts]"]
  node_services["Services<br/>[Services.ts]"]
  node_categories["Service categories"]
  node_industries["Industries<br/>[Industries.ts]"]
  node_team["Team members<br/>[TeamMembers.ts]"]
  node_media["Media library<br/>[Media.ts]"]
end

subgraph group_cms["CMS runtime"]
  node_payloadconfig["Payload configuration<br/>[payload.config.ts]"]
  node_payloadapi["Payload REST API<br/>[route.ts]"]
  node_graphql["GraphQL API<br/>[route.ts]"]
  node_admin["CMS admin<br/>[page.tsx]"]
end

subgraph group_auth["Authentication"]
  node_authroute["Auth API route<br/>[route.ts]"]
  node_authlib["Auth server<br/>[auth.ts]"]
  node_authclient["Auth client<br/>[auth-client.ts]"]
end

node_visitor(("Website visitor"))
node_authservice{{"Better Auth"}}

node_visitor -->|"requests page"| node_proxy
node_proxy -->|"routes locale"| node_home
node_proxy -->|"routes locale"| node_advisory
node_visitor -->|"CMS requests"| node_payloadapi
node_payloadapi -->|"loads config"| node_payloadconfig
node_visitor -->|"GraphQL requests"| node_graphql
node_graphql -->|"loads config"| node_payloadconfig
node_visitor -->|"opens admin"| node_admin
node_admin -->|"uses config"| node_payloadconfig
node_visitor -->|"authenticates"| node_authroute
node_authroute -->|"dispatches"| node_authlib
node_authlib -->|"uses"| node_authservice
node_authclient -->|"creates client"| node_authservice
node_proxy -->|"checks session cookie"| node_authservice

click node_proxy "https://github.com/0xmattthemii/aryes-app-template/blob/main/src/proxy.ts"
click node_home "https://github.com/0xmattthemii/aryes-app-template/blob/main/src/app/(app)/%5Blocale%5D/page.tsx"
click node_advisory "https://github.com/0xmattthemii/aryes-app-template/blob/main/src/app/(app)/%5Blocale%5D/advisory/page.tsx"
click node_layout "https://github.com/0xmattthemii/aryes-app-template/blob/main/src/app/(app)/%5Blocale%5D/layout.tsx"
click node_header "https://github.com/0xmattthemii/aryes-app-template/blob/main/src/components/layout/Header.tsx"
click node_footer "https://github.com/0xmattthemii/aryes-app-template/blob/main/src/components/layout/Footer.tsx"
click node_homecontent "https://github.com/0xmattthemii/aryes-app-template/blob/main/src/payload/globals/HomePage.ts"
click node_advisorycontent "https://github.com/0xmattthemii/aryes-app-template/blob/main/src/payload/globals/AdvisoryPage.ts"
click node_navigation "https://github.com/0xmattthemii/aryes-app-template/blob/main/src/payload/globals/Navigation.ts"
click node_footercontent "https://github.com/0xmattthemii/aryes-app-template/blob/main/src/payload/globals/Footer.ts"
click node_settings "https://github.com/0xmattthemii/aryes-app-template/blob/main/src/payload/globals/SiteSettings.ts"
click node_services "https://github.com/0xmattthemii/aryes-app-template/blob/main/src/payload/collections/Services.ts"
click node_categories "https://github.com/0xmattthemii/aryes-app-template/blob/main/src/payload/collections/ServiceCategories.ts"
click node_industries "https://github.com/0xmattthemii/aryes-app-template/blob/main/src/payload/collections/Industries.ts"
click node_team "https://github.com/0xmattthemii/aryes-app-template/blob/main/src/payload/collections/TeamMembers.ts"
click node_media "https://github.com/0xmattthemii/aryes-app-template/blob/main/src/payload/collections/Media.ts"
click node_payloadconfig "https://github.com/0xmattthemii/aryes-app-template/blob/main/payload.config.ts"
click node_payloadapi "https://github.com/0xmattthemii/aryes-app-template/blob/main/src/app/(payload)/api/%5B...slug%5D/route.ts"
click node_graphql "https://github.com/0xmattthemii/aryes-app-template/blob/main/src/app/(payload)/api/graphql/route.ts"
click node_admin "https://github.com/0xmattthemii/aryes-app-template/blob/main/src/app/(payload)/admin/%5B%5B...segments%5D%5D/page.tsx"
click node_authroute "https://github.com/0xmattthemii/aryes-app-template/blob/main/src/app/api/auth/%5B...all%5D/route.ts"
click node_authlib "https://github.com/0xmattthemii/aryes-app-template/blob/main/src/lib/auth.ts"
click node_authclient "https://github.com/0xmattthemii/aryes-app-template/blob/main/src/lib/auth-client.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_proxy,node_home,node_advisory,node_layout,node_header,node_footer toneBlue
class node_homecontent,node_advisorycontent,node_navigation,node_footercontent,node_settings,node_services,node_categories,node_industries,node_team,node_media toneAmber
class node_payloadconfig,node_payloadapi,node_graphql,node_admin toneMint
class node_authroute,node_authlib,node_authclient toneRose
class node_visitor,node_authservice toneIndigo
```

## Components

### Visitor website

- [Locale proxy](https://github.com/0xmattthemii/aryes-app-template/blob/main/src/proxy.ts): `src/proxy.ts`
- [Home page](https://github.com/0xmattthemii/aryes-app-template/blob/main/src/app/(app)/%5Blocale%5D/page.tsx): `src/app/(app)/[locale]/page.tsx`
- [Advisory page](https://github.com/0xmattthemii/aryes-app-template/blob/main/src/app/(app)/%5Blocale%5D/advisory/page.tsx): `src/app/(app)/[locale]/advisory/page.tsx`
- [Locale layout](https://github.com/0xmattthemii/aryes-app-template/blob/main/src/app/(app)/%5Blocale%5D/layout.tsx): `src/app/(app)/[locale]/layout.tsx`
- [Site header](https://github.com/0xmattthemii/aryes-app-template/blob/main/src/components/layout/Header.tsx): `src/components/layout/Header.tsx`
- [Site footer](https://github.com/0xmattthemii/aryes-app-template/blob/main/src/components/layout/Footer.tsx): `src/components/layout/Footer.tsx`

### CMS content

- [Home content](https://github.com/0xmattthemii/aryes-app-template/blob/main/src/payload/globals/HomePage.ts): `src/payload/globals/HomePage.ts`
- [Advisory content](https://github.com/0xmattthemii/aryes-app-template/blob/main/src/payload/globals/AdvisoryPage.ts): `src/payload/globals/AdvisoryPage.ts`
- [Navigation](https://github.com/0xmattthemii/aryes-app-template/blob/main/src/payload/globals/Navigation.ts): `src/payload/globals/Navigation.ts`
- [Footer content](https://github.com/0xmattthemii/aryes-app-template/blob/main/src/payload/globals/Footer.ts): `src/payload/globals/Footer.ts`
- [Site settings](https://github.com/0xmattthemii/aryes-app-template/blob/main/src/payload/globals/SiteSettings.ts): `src/payload/globals/SiteSettings.ts`
- [Services](https://github.com/0xmattthemii/aryes-app-template/blob/main/src/payload/collections/Services.ts): `src/payload/collections/Services.ts`
- [Service categories](https://github.com/0xmattthemii/aryes-app-template/blob/main/src/payload/collections/ServiceCategories.ts): `src/payload/collections/ServiceCategories.ts`
- [Industries](https://github.com/0xmattthemii/aryes-app-template/blob/main/src/payload/collections/Industries.ts): `src/payload/collections/Industries.ts`
- [Team members](https://github.com/0xmattthemii/aryes-app-template/blob/main/src/payload/collections/TeamMembers.ts): `src/payload/collections/TeamMembers.ts`
- [Media library](https://github.com/0xmattthemii/aryes-app-template/blob/main/src/payload/collections/Media.ts): `src/payload/collections/Media.ts`

### CMS runtime

- [Payload configuration](https://github.com/0xmattthemii/aryes-app-template/blob/main/payload.config.ts): `payload.config.ts`
- [Payload REST API](https://github.com/0xmattthemii/aryes-app-template/blob/main/src/app/(payload)/api/%5B...slug%5D/route.ts): `src/app/(payload)/api/[...slug]/route.ts`
- [GraphQL API](https://github.com/0xmattthemii/aryes-app-template/blob/main/src/app/(payload)/api/graphql/route.ts): `src/app/(payload)/api/graphql/route.ts`
- [CMS admin](https://github.com/0xmattthemii/aryes-app-template/blob/main/src/app/(payload)/admin/%5B%5B...segments%5D%5D/page.tsx): `src/app/(payload)/admin/[[...segments]]/page.tsx`

### Authentication

- [Auth API route](https://github.com/0xmattthemii/aryes-app-template/blob/main/src/app/api/auth/%5B...all%5D/route.ts): `src/app/api/auth/[...all]/route.ts`
- [Auth server](https://github.com/0xmattthemii/aryes-app-template/blob/main/src/lib/auth.ts): `src/lib/auth.ts`
- [Auth client](https://github.com/0xmattthemii/aryes-app-template/blob/main/src/lib/auth-client.ts): `src/lib/auth-client.ts`

### Other components

- **Website visitor**
- **Better Auth**

## Connections

- Website visitor → Locale proxy: requests page
- Locale proxy → Home page: routes locale
- Locale proxy → Advisory page: routes locale
- Website visitor → Payload REST API: CMS requests
- Payload REST API → Payload configuration: loads config
- Website visitor → GraphQL API: GraphQL requests
- GraphQL API → Payload configuration: loads config
- Website visitor → CMS admin: opens admin
- CMS admin → Payload configuration: uses config
- Website visitor → Auth API route: authenticates
- Auth API route → Auth server: dispatches
- Auth server → Better Auth: uses
- Auth client → Better Auth: creates client
- Locale proxy → Better Auth: checks session cookie
