# barthez-kenwou/backend-barthez-portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/barthez-kenwou/backend-barthez-portfolio
- Repository: https://github.com/barthez-kenwou/backend-barthez-portfolio

## Overview

This is an Express/TypeScript modular-monolith backend for a public portfolio site and its admin CMS. The main workflow is a visitor or administrator calling the versioned API: app routing dispatches to domain endpoints, which expose public reads or authenticated content-management actions and return API responses. Separate capabilities handle accounts and access control, uploads, newsletter campaigns, OAuth, and backups. The README documents MongoDB/Prisma, Redis, and object storage; sampled code confirms storage-provider selection and selected controller-to-use-case calls. Other module wiring is represented only where documented, not inferred from unsampled implementation.

Main entry points: [`src/app/routes/index.ts`](https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/app/routes/index.ts) (Route registry), [`src/modules/projects/presentation/routes/project.routes.ts`](https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/modules/projects/presentation/routes/project.routes.ts) (Portfolio endpoints), [`src/modules/auth/presentation/routes/auth.routes.ts`](https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/modules/auth/presentation/routes/auth.routes.ts) (Auth endpoints), [`src/app/app.ts`](https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/app/app.ts) (Express application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["API entry"]
  node_app["Express application<br/>[app.ts]"]
  node_routes["Route registry<br/>[index.ts]"]
end

subgraph group_portfolio["Portfolio content"]
  node_portfolio_routes["Portfolio endpoints<br/>[project.routes.ts]"]
  node_portfolio_content["CMS content workflows"]
  node_cv["CV aggregate<br/>[get-cv.query.ts]"]
  node_contact["Contact inbox"]
  node_content_store["Content repositories"]
end

subgraph group_identity["Identity and access"]
  node_auth_routes["Auth endpoints<br/>[auth.routes.ts]"]
  node_auth_logic["Auth workflows<br/>[login.command.ts]"]
  node_rbac["Role permissions<br/>[index.ts]"]
  node_oauth["OAuth integrations"]
end

subgraph group_capabilities["Platform capabilities"]
  node_files["Upload workflows"]
  node_object_storage["Object storage facade<br/>[storage.service.ts]"]
  node_newsletter["Newsletter workflows"]
  node_backup["Mongo backup"]
end

node_site_users(("Site and CMS users"))
node_database[("MongoDB via Prisma")]
node_storage_provider[("MinIO or S3")]
node_oauth_providers(("OAuth providers"))

node_site_users -->|"sends requests"| node_app
node_app -->|"dispatches"| node_routes
node_routes -->|"registers endpoints"| node_auth_routes
node_routes -->|"registers endpoints"| node_portfolio_routes
node_auth_routes -->|"invokes workflows"| node_auth_logic
node_auth_logic -->|"reads and writes"| node_database
node_portfolio_routes -->|"invokes workflows"| node_portfolio_content
node_portfolio_content -->|"uses repository"| node_content_store
node_content_store -->|"reads and writes"| node_database
node_portfolio_routes -.->|"serves CV"| node_cv
node_portfolio_routes -.->|"serves contact"| node_contact
node_auth_routes -.->|"checks permissions"| node_rbac
node_portfolio_routes -.->|"checks permissions"| node_rbac
node_routes -.->|"registers uploads"| node_files
node_files -.->|"stores objects"| node_object_storage
node_object_storage -->|"uploads objects"| node_storage_provider
node_routes -.->|"registers endpoints"| node_newsletter
node_routes -.->|"registers endpoints"| node_oauth
node_oauth -->|"exchanges credentials"| node_oauth_providers
node_routes -.->|"registers operations"| node_backup
node_backup -.->|"stores backup"| node_storage_provider

click node_app "https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/app/app.ts"
click node_routes "https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/app/routes/index.ts"
click node_auth_routes "https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/modules/auth/presentation/routes/auth.routes.ts"
click node_auth_logic "https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/modules/auth/application/commands/login.command.ts"
click node_rbac "https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/modules/rbac/index.ts"
click node_portfolio_routes "https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/modules/projects/presentation/routes/project.routes.ts"
click node_portfolio_content "https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/modules/projects/application/commands/create-project.command.ts"
click node_cv "https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/modules/cv/application/queries/get-cv.query.ts"
click node_contact "https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/modules/contact-responses/presentation/routes/contact-response.routes.ts"
click node_content_store "https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/modules/projects/infrastructure/repositories/prisma-project.repository.ts"
click node_files "https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/modules/files/application/commands/upload-file.command.ts"
click node_object_storage "https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/shared/infrastructure/storage/storage.service.ts"
click node_newsletter "https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/modules/newsletter/application/commands/subscribe-newsletter.command.ts"
click node_oauth "https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/modules/oauth/infrastructure/manager/oauth-manager.service.ts"
click node_backup "https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/modules/backup/application/commands/run-mongo-backup.command.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_site_users toneBlue
class node_portfolio_routes,node_portfolio_content,node_cv,node_contact,node_content_store,node_database,node_storage_provider toneAmber
class node_auth_routes,node_auth_logic,node_rbac,node_oauth toneMint
class node_files,node_object_storage,node_newsletter,node_backup toneRose
class node_oauth_providers toneIndigo
```

## Components

### API entry

- [Express application](https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/app/app.ts): `src/app/app.ts`
- [Route registry](https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/app/routes/index.ts): `src/app/routes/index.ts`

### Portfolio content

- [Portfolio endpoints](https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/modules/projects/presentation/routes/project.routes.ts): `src/modules/projects/presentation/routes/project.routes.ts`
- [CMS content workflows](https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/modules/projects/application/commands/create-project.command.ts): `src/modules/projects/application/commands/create-project.command.ts`
- [CV aggregate](https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/modules/cv/application/queries/get-cv.query.ts): `src/modules/cv/application/queries/get-cv.query.ts`
- [Contact inbox](https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/modules/contact-responses/presentation/routes/contact-response.routes.ts): `src/modules/contact-responses/presentation/routes/contact-response.routes.ts`
- [Content repositories](https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/modules/projects/infrastructure/repositories/prisma-project.repository.ts): `src/modules/projects/infrastructure/repositories/prisma-project.repository.ts`

### Identity and access

- [Auth endpoints](https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/modules/auth/presentation/routes/auth.routes.ts): `src/modules/auth/presentation/routes/auth.routes.ts`
- [Auth workflows](https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/modules/auth/application/commands/login.command.ts): `src/modules/auth/application/commands/login.command.ts`
- [Role permissions](https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/modules/rbac/index.ts): `src/modules/rbac/index.ts`
- [OAuth integrations](https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/modules/oauth/infrastructure/manager/oauth-manager.service.ts): `src/modules/oauth/infrastructure/manager/oauth-manager.service.ts`

### Platform capabilities

- [Upload workflows](https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/modules/files/application/commands/upload-file.command.ts): `src/modules/files/application/commands/upload-file.command.ts`
- [Object storage facade](https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/shared/infrastructure/storage/storage.service.ts): `src/shared/infrastructure/storage/storage.service.ts`
- [Newsletter workflows](https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/modules/newsletter/application/commands/subscribe-newsletter.command.ts): `src/modules/newsletter/application/commands/subscribe-newsletter.command.ts`
- [Mongo backup](https://github.com/barthez-kenwou/backend-barthez-portfolio/blob/main/src/modules/backup/application/commands/run-mongo-backup.command.ts): `src/modules/backup/application/commands/run-mongo-backup.command.ts`

### Other components

- **Site and CMS users**
- **MongoDB via Prisma**
- **MinIO or S3**
- **OAuth providers**

## Connections

- Site and CMS users → Express application: sends requests
- Express application → Route registry: dispatches
- Route registry → Auth endpoints: registers endpoints
- Route registry → Portfolio endpoints: registers endpoints
- Auth endpoints → Auth workflows: invokes workflows
- Auth workflows → MongoDB via Prisma: reads and writes
- Portfolio endpoints → CMS content workflows: invokes workflows
- CMS content workflows → Content repositories: uses repository
- Content repositories → MongoDB via Prisma: reads and writes
- Portfolio endpoints → CV aggregate: serves CV
- Portfolio endpoints → Contact inbox: serves contact
- Auth endpoints → Role permissions: checks permissions
- Portfolio endpoints → Role permissions: checks permissions
- Route registry → Upload workflows: registers uploads
- Upload workflows → Object storage facade: stores objects
- Object storage facade → MinIO or S3: uploads objects
- Route registry → Newsletter workflows: registers endpoints
- Route registry → OAuth integrations: registers endpoints
- OAuth integrations → OAuth providers: exchanges credentials
- Route registry → Mongo backup: registers operations
- Mongo backup → MinIO or S3: stores backup
