# azmov7h/c0c-fr architecture

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

- Interactive diagram: https://gitdiagram.com/azmov7h/c0c-fr
- Repository: https://github.com/azmov7h/c0c-fr

## Overview

c0c-fr is the Next.js frontend for an AI content engine: creators enter through the web app, manage projects, use generation and research tools, then organize publishing and account usage. Feature services use a same-origin browser API client; authentication is handled separately by BFF routes that relay to the sibling backend and manage HttpOnly cookies. The README documents additional product branches that are represented here, but their internal calls were not sampled. Edges are limited to README statements and shown source references/calls.

Main entry points: [`src/app/[locale]`](https://github.com/azmov7h/c0c-fr/tree/main/src/app/%5Blocale%5D) (Localized app routes), [`src/features/advertisements/components/video-pipeline.tsx`](https://github.com/azmov7h/c0c-fr/blob/main/src/features/advertisements/components/video-pipeline.tsx) (Video pipeline), [`src/app/api/auth/login/route.ts`](https://github.com/azmov7h/c0c-fr/blob/main/src/app/api/auth/login/route.ts) (Auth BFF routes), [`src/features/auth/services/auth.service.ts`](https://github.com/azmov7h/c0c-fr/blob/main/src/features/auth/services/auth.service.ts) (Auth client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_surface["Web experience"]
  node_web["Localized app routes"]
  node_authui["Sign-in experience<br/>[login-form.tsx]"]
end

subgraph group_creation["Creator workflows"]
  node_projects["Projects workspace"]
  node_dashboard["Creator dashboard<br/>[dashboard-view.tsx]"]
  node_generation["Content generation"]
  node_advertisement["Video pipeline<br/>[video-pipeline.tsx]"]
  node_research["Research tools<br/>[trends-content.tsx]"]
  node_planner["Publishing planner"]
  node_media["Media library<br/>[media-library.tsx]"]
  node_billing["Plans and billing<br/>[pricing.tsx]"]
end

subgraph group_boundary["API and identity"]
  node_authservice["Auth client<br/>[auth.service.ts]"]
  node_bff["Auth BFF routes<br/>[route.ts]"]
  node_guards["Request validation<br/>[route-guards.ts]"]
  node_cookies["Session cookies<br/>[auth-cookies.ts]"]
  node_relay["Backend auth relay<br/>[auth-relay.ts]"]
  node_serverapi["Server API base<br/>[server-api.ts]"]
  node_apiclient["Browser API client<br/>[api-client.ts]"]
  node_advertservice["Advertisement service"]
end

subgraph group_foundation["App foundations"]
  node_locale["Locale routing<br/>[routing.ts]"]
  node_format["Locale formatting<br/>[index.ts]"]
  node_session["Session initializer"]
end

node_creator(("Creator"))
node_backend["c0c-bake backend"]

node_creator -->|"opens routes"| node_web
node_web -->|"renders workspace"| node_projects
node_web -->|"renders dashboard"| node_dashboard
node_web -->|"offers generators"| node_generation
node_web -->|"offers video tools"| node_advertisement
node_web -->|"offers research"| node_research
node_web -->|"renders planner"| node_planner
node_web -->|"renders media"| node_media
node_web -->|"renders billing"| node_billing
node_web -->|"renders sign-in"| node_authui
node_authui -.->|"submits credentials"| node_authservice
node_authservice -->|"calls same-origin"| node_bff
node_bff -->|"validates requests"| node_guards
node_bff -->|"sets cookies"| node_cookies
node_bff -->|"relays auth"| node_relay
node_relay -->|"uses backend base"| node_serverapi
node_serverapi -->|"targets backend"| node_backend
node_apiclient -->|"requests via rewrite"| node_backend
node_advertservice -->|"sends API calls"| node_apiclient
node_advertisement -.->|"loads ad data"| node_advertservice
node_advertisement -->|"formats display values"| node_format
node_advertisement -->|"reads URL locale"| node_locale
node_session -->|"loads session"| node_authservice
node_session -->|"uses locale routing"| node_locale

click node_web "https://github.com/azmov7h/c0c-fr/tree/main/src/app/%5Blocale%5D"
click node_projects "https://github.com/azmov7h/c0c-fr/blob/main/src/features/projects/components/workspace/project-workspace.tsx"
click node_dashboard "https://github.com/azmov7h/c0c-fr/blob/main/src/features/dashboard/components/dashboard-view.tsx"
click node_generation "https://github.com/azmov7h/c0c-fr/blob/main/src/features/scripts/components/script-generator.tsx"
click node_advertisement "https://github.com/azmov7h/c0c-fr/blob/main/src/features/advertisements/components/video-pipeline.tsx"
click node_research "https://github.com/azmov7h/c0c-fr/blob/main/src/features/trends/components/trends-content.tsx"
click node_planner "https://github.com/azmov7h/c0c-fr/blob/main/src/features/planner/components/content-planner.tsx"
click node_media "https://github.com/azmov7h/c0c-fr/blob/main/src/features/media/components/media-library.tsx"
click node_billing "https://github.com/azmov7h/c0c-fr/blob/main/src/features/billing/components/pricing.tsx"
click node_authui "https://github.com/azmov7h/c0c-fr/blob/main/src/features/auth/components/login-form.tsx"
click node_authservice "https://github.com/azmov7h/c0c-fr/blob/main/src/features/auth/services/auth.service.ts"
click node_bff "https://github.com/azmov7h/c0c-fr/blob/main/src/app/api/auth/login/route.ts"
click node_guards "https://github.com/azmov7h/c0c-fr/blob/main/src/lib/route-guards.ts"
click node_cookies "https://github.com/azmov7h/c0c-fr/blob/main/src/lib/auth-cookies.ts"
click node_relay "https://github.com/azmov7h/c0c-fr/blob/main/src/lib/auth-relay.ts"
click node_serverapi "https://github.com/azmov7h/c0c-fr/blob/main/src/services/server-api.ts"
click node_apiclient "https://github.com/azmov7h/c0c-fr/blob/main/src/services/api-client.ts"
click node_advertservice "https://github.com/azmov7h/c0c-fr/blob/main/src/features/advertisements/services/advertisements.service.ts"
click node_locale "https://github.com/azmov7h/c0c-fr/blob/main/src/i18n/routing.ts"
click node_format "https://github.com/azmov7h/c0c-fr/blob/main/src/lib/format/index.ts"
click node_session "https://github.com/azmov7h/c0c-fr/blob/main/src/components/session-initializer.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_web,node_authui toneBlue
class node_projects,node_dashboard,node_generation,node_advertisement,node_research,node_planner,node_media,node_billing toneAmber
class node_authservice,node_bff,node_guards,node_cookies,node_relay,node_serverapi,node_apiclient,node_advertservice toneMint
class node_locale,node_format,node_session toneRose
class node_creator,node_backend toneIndigo
```

## Components

### Web experience

- [Localized app routes](https://github.com/azmov7h/c0c-fr/tree/main/src/app/%5Blocale%5D): `src/app/[locale]`
- [Sign-in experience](https://github.com/azmov7h/c0c-fr/blob/main/src/features/auth/components/login-form.tsx): `src/features/auth/components/login-form.tsx`

### Creator workflows

- [Projects workspace](https://github.com/azmov7h/c0c-fr/blob/main/src/features/projects/components/workspace/project-workspace.tsx): `src/features/projects/components/workspace/project-workspace.tsx`
- [Creator dashboard](https://github.com/azmov7h/c0c-fr/blob/main/src/features/dashboard/components/dashboard-view.tsx): `src/features/dashboard/components/dashboard-view.tsx`
- [Content generation](https://github.com/azmov7h/c0c-fr/blob/main/src/features/scripts/components/script-generator.tsx): `src/features/scripts/components/script-generator.tsx`
- [Video pipeline](https://github.com/azmov7h/c0c-fr/blob/main/src/features/advertisements/components/video-pipeline.tsx): `src/features/advertisements/components/video-pipeline.tsx`
- [Research tools](https://github.com/azmov7h/c0c-fr/blob/main/src/features/trends/components/trends-content.tsx): `src/features/trends/components/trends-content.tsx`
- [Publishing planner](https://github.com/azmov7h/c0c-fr/blob/main/src/features/planner/components/content-planner.tsx): `src/features/planner/components/content-planner.tsx`
- [Media library](https://github.com/azmov7h/c0c-fr/blob/main/src/features/media/components/media-library.tsx): `src/features/media/components/media-library.tsx`
- [Plans and billing](https://github.com/azmov7h/c0c-fr/blob/main/src/features/billing/components/pricing.tsx): `src/features/billing/components/pricing.tsx`

### API and identity

- [Auth client](https://github.com/azmov7h/c0c-fr/blob/main/src/features/auth/services/auth.service.ts): `src/features/auth/services/auth.service.ts`
- [Auth BFF routes](https://github.com/azmov7h/c0c-fr/blob/main/src/app/api/auth/login/route.ts): `src/app/api/auth/login/route.ts`
- [Request validation](https://github.com/azmov7h/c0c-fr/blob/main/src/lib/route-guards.ts): `src/lib/route-guards.ts`
- [Session cookies](https://github.com/azmov7h/c0c-fr/blob/main/src/lib/auth-cookies.ts): `src/lib/auth-cookies.ts`
- [Backend auth relay](https://github.com/azmov7h/c0c-fr/blob/main/src/lib/auth-relay.ts): `src/lib/auth-relay.ts`
- [Server API base](https://github.com/azmov7h/c0c-fr/blob/main/src/services/server-api.ts): `src/services/server-api.ts`
- [Browser API client](https://github.com/azmov7h/c0c-fr/blob/main/src/services/api-client.ts): `src/services/api-client.ts`
- [Advertisement service](https://github.com/azmov7h/c0c-fr/blob/main/src/features/advertisements/services/advertisements.service.ts): `src/features/advertisements/services/advertisements.service.ts`

### App foundations

- [Locale routing](https://github.com/azmov7h/c0c-fr/blob/main/src/i18n/routing.ts): `src/i18n/routing.ts`
- [Locale formatting](https://github.com/azmov7h/c0c-fr/blob/main/src/lib/format/index.ts): `src/lib/format/index.ts`
- [Session initializer](https://github.com/azmov7h/c0c-fr/blob/main/src/components/session-initializer.tsx): `src/components/session-initializer.tsx`

### Other components

- **Creator**
- **c0c-bake backend**

## Connections

- Creator → Localized app routes: opens routes
- Localized app routes → Projects workspace: renders workspace
- Localized app routes → Creator dashboard: renders dashboard
- Localized app routes → Content generation: offers generators
- Localized app routes → Video pipeline: offers video tools
- Localized app routes → Research tools: offers research
- Localized app routes → Publishing planner: renders planner
- Localized app routes → Media library: renders media
- Localized app routes → Plans and billing: renders billing
- Localized app routes → Sign-in experience: renders sign-in
- Sign-in experience → Auth client: submits credentials
- Auth client → Auth BFF routes: calls same-origin (evidence: `src/features/auth/services/auth.service.ts`)
- Auth BFF routes → Request validation: validates requests (evidence: `src/app/api/auth/login/route.ts`)
- Auth BFF routes → Session cookies: sets cookies (evidence: `src/app/api/auth/login/route.ts`)
- Auth BFF routes → Backend auth relay: relays auth (evidence: `src/app/api/auth/login/route.ts`)
- Backend auth relay → Server API base: uses backend base (evidence: `src/lib/auth-relay.ts`)
- Server API base → c0c-bake backend: targets backend
- Browser API client → c0c-bake backend: requests via rewrite
- Advertisement service → Browser API client: sends API calls (evidence: `src/features/advertisements/services/advertisements.service.ts`)
- Video pipeline → Advertisement service: loads ad data
- Video pipeline → Locale formatting: formats display values (evidence: `src/features/advertisements/components/video-pipeline.tsx`)
- Video pipeline → Locale routing: reads URL locale (evidence: `src/features/advertisements/components/video-pipeline.tsx`)
- Session initializer → Auth client: loads session (evidence: `src/components/session-initializer.tsx`)
- Session initializer → Locale routing: uses locale routing (evidence: `src/components/session-initializer.tsx`)
