# kes-africa/kes-certificat architecture

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

- Interactive diagram: https://gitdiagram.com/kes-africa/kes-certificat
- Repository: https://github.com/kes-africa/kes-certificat

## Overview

This is a French-language web app for generating training certificates and handling spreadsheet/photo uploads. The main workflow is to choose a certificate mode, upload files, review spreadsheet data when applicable, request generation, and download the result. Separate pages provide entity upload, spreadsheet photo upload, and ZIP-based photo upload; an image-cropping page is also present. The graph reflects explicit routes and sampled call relationships; several page-specific internals are unsampled, so their downstream links are omitted.

Main entry points: [`src/pages/CertificateGeneratorPage.tsx`](https://github.com/kes-africa/kes-certificat/blob/main/src/pages/CertificateGeneratorPage.tsx) (Certificate Generator), [`src/App.tsx`](https://github.com/kes-africa/kes-certificat/blob/main/src/App.tsx) (App Router), [`src/api/apiClient.ts`](https://github.com/kes-africa/kes-certificat/blob/main/src/api/apiClient.ts) (API Client), [`src/components/certificates/MultiFileUploader.tsx`](https://github.com/kes-africa/kes-certificat/blob/main/src/components/certificates/MultiFileUploader.tsx) (Multi Upload)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application Shell"]
  node_app["App Router<br/>[App.tsx]"]
  node_layout["App Layout<br/>[AppLayout.tsx]"]
end

subgraph group_cert["Certificate Workflows"]
  node_generator["Certificate Generator"]
  node_mode["Mode Selector"]
  node_single["Single Upload"]
  node_preview["Data Preview"]
  node_multi["Multi Upload"]
  node_height["Height-Work Upload"]
  node_certdata["Certificate Types<br/>[certificate.ts]"]
end

subgraph group_files["File Handling"]
  node_uploadhook["Upload State Hook<br/>[useFileUpload.ts]"]
  node_fileutils["File Utilities<br/>[file.ts]"]
  node_entityupload["Entity Upload"]
end

subgraph group_media["Photo Tools"]
  node_excel["Spreadsheet Photo Upload"]
  node_photozip["Photo ZIP Upload"]
  node_cropper["Image Cropper"]
end

subgraph group_infra["Shared Services"]
  node_service["Certificate API Service"]
  node_client["API Client<br/>[apiClient.ts]"]
  node_config["App Configuration<br/>[appConfig.ts]"]
end

node_user(("User"))
node_backend["API Backend"]

node_user -->|"uses"| node_app
node_app -->|"renders"| node_layout
node_app -->|"routes to"| node_generator
node_app -->|"routes to"| node_entityupload
node_app -->|"routes to"| node_excel
node_app -->|"routes to"| node_photozip
node_generator -->|"renders"| node_mode
node_generator -->|"renders"| node_single
node_generator -->|"renders"| node_preview
node_generator -->|"renders"| node_multi
node_generator -->|"renders"| node_height
node_generator -->|"requests generation"| node_service
node_multi -->|"uses"| node_uploadhook
node_multi -->|"requests processing"| node_service
node_uploadhook -->|"reads spreadsheets"| node_fileutils
node_preview -->|"uses types"| node_certdata
node_service -->|"sends requests"| node_client
node_client -->|"reads API URL"| node_config
node_client -->|"calls"| node_backend
node_photozip -.->|"uses"| node_client
node_cropper -.->|"offers editing"| node_user

click node_app "https://github.com/kes-africa/kes-certificat/blob/main/src/App.tsx"
click node_layout "https://github.com/kes-africa/kes-certificat/blob/main/src/components/layout/AppLayout.tsx"
click node_generator "https://github.com/kes-africa/kes-certificat/blob/main/src/pages/CertificateGeneratorPage.tsx"
click node_mode "https://github.com/kes-africa/kes-certificat/blob/main/src/components/certificates/CertificateMode.tsx"
click node_single "https://github.com/kes-africa/kes-certificat/blob/main/src/components/certificates/SingleFileUploader.tsx"
click node_preview "https://github.com/kes-africa/kes-certificat/blob/main/src/components/certificates/CertificateDataPreview.tsx"
click node_multi "https://github.com/kes-africa/kes-certificat/blob/main/src/components/certificates/MultiFileUploader.tsx"
click node_height "https://github.com/kes-africa/kes-certificat/blob/main/src/components/certificates/HeightWorkFileUploader.tsx"
click node_certdata "https://github.com/kes-africa/kes-certificat/blob/main/src/types/certificate.ts"
click node_uploadhook "https://github.com/kes-africa/kes-certificat/blob/main/src/hooks/useFileUpload.ts"
click node_fileutils "https://github.com/kes-africa/kes-certificat/blob/main/src/utils/file.ts"
click node_excel "https://github.com/kes-africa/kes-certificat/blob/main/src/pages/ExcelPhotoUploader.tsx"
click node_photozip "https://github.com/kes-africa/kes-certificat/blob/main/src/pages/PhotoZipUploader.tsx"
click node_cropper "https://github.com/kes-africa/kes-certificat/blob/main/src/pages/ImageCropperApp.tsx"
click node_entityupload "https://github.com/kes-africa/kes-certificat/blob/main/src/pages/UploadComponent.tsx"
click node_service "https://github.com/kes-africa/kes-certificat/blob/main/src/api/services/certificateService.ts"
click node_client "https://github.com/kes-africa/kes-certificat/blob/main/src/api/apiClient.ts"
click node_config "https://github.com/kes-africa/kes-certificat/blob/main/src/constants/appConfig.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_layout,node_user toneBlue
class node_generator,node_mode,node_single,node_preview,node_multi,node_height,node_certdata toneAmber
class node_uploadhook,node_fileutils,node_entityupload,node_backend toneMint
class node_excel,node_photozip,node_cropper toneRose
class node_service,node_client,node_config toneIndigo
```

## Components

### Application Shell

- [App Router](https://github.com/kes-africa/kes-certificat/blob/main/src/App.tsx): `src/App.tsx`
- [App Layout](https://github.com/kes-africa/kes-certificat/blob/main/src/components/layout/AppLayout.tsx): `src/components/layout/AppLayout.tsx`

### Certificate Workflows

- [Certificate Generator](https://github.com/kes-africa/kes-certificat/blob/main/src/pages/CertificateGeneratorPage.tsx): `src/pages/CertificateGeneratorPage.tsx`
- [Mode Selector](https://github.com/kes-africa/kes-certificat/blob/main/src/components/certificates/CertificateMode.tsx): `src/components/certificates/CertificateMode.tsx`
- [Single Upload](https://github.com/kes-africa/kes-certificat/blob/main/src/components/certificates/SingleFileUploader.tsx): `src/components/certificates/SingleFileUploader.tsx`
- [Data Preview](https://github.com/kes-africa/kes-certificat/blob/main/src/components/certificates/CertificateDataPreview.tsx): `src/components/certificates/CertificateDataPreview.tsx`
- [Multi Upload](https://github.com/kes-africa/kes-certificat/blob/main/src/components/certificates/MultiFileUploader.tsx): `src/components/certificates/MultiFileUploader.tsx`
- [Height-Work Upload](https://github.com/kes-africa/kes-certificat/blob/main/src/components/certificates/HeightWorkFileUploader.tsx): `src/components/certificates/HeightWorkFileUploader.tsx`
- [Certificate Types](https://github.com/kes-africa/kes-certificat/blob/main/src/types/certificate.ts): `src/types/certificate.ts`

### File Handling

- [Upload State Hook](https://github.com/kes-africa/kes-certificat/blob/main/src/hooks/useFileUpload.ts): `src/hooks/useFileUpload.ts`
- [File Utilities](https://github.com/kes-africa/kes-certificat/blob/main/src/utils/file.ts): `src/utils/file.ts`
- [Entity Upload](https://github.com/kes-africa/kes-certificat/blob/main/src/pages/UploadComponent.tsx): `src/pages/UploadComponent.tsx`

### Photo Tools

- [Spreadsheet Photo Upload](https://github.com/kes-africa/kes-certificat/blob/main/src/pages/ExcelPhotoUploader.tsx): `src/pages/ExcelPhotoUploader.tsx`
- [Photo ZIP Upload](https://github.com/kes-africa/kes-certificat/blob/main/src/pages/PhotoZipUploader.tsx): `src/pages/PhotoZipUploader.tsx`
- [Image Cropper](https://github.com/kes-africa/kes-certificat/blob/main/src/pages/ImageCropperApp.tsx): `src/pages/ImageCropperApp.tsx`

### Shared Services

- [Certificate API Service](https://github.com/kes-africa/kes-certificat/blob/main/src/api/services/certificateService.ts): `src/api/services/certificateService.ts`
- [API Client](https://github.com/kes-africa/kes-certificat/blob/main/src/api/apiClient.ts): `src/api/apiClient.ts`
- [App Configuration](https://github.com/kes-africa/kes-certificat/blob/main/src/constants/appConfig.ts): `src/constants/appConfig.ts`

### Other components

- **User**
- **API Backend**

## Connections

- User → App Router: uses (evidence: `src/App.tsx`)
- App Router → App Layout: renders (evidence: `src/App.tsx`)
- App Router → Certificate Generator: routes to (evidence: `src/App.tsx`)
- App Router → Entity Upload: routes to (evidence: `src/App.tsx`)
- App Router → Spreadsheet Photo Upload: routes to (evidence: `src/App.tsx`)
- App Router → Photo ZIP Upload: routes to (evidence: `src/App.tsx`)
- Certificate Generator → Mode Selector: renders (evidence: `src/pages/CertificateGeneratorPage.tsx`)
- Certificate Generator → Single Upload: renders (evidence: `src/pages/CertificateGeneratorPage.tsx`)
- Certificate Generator → Data Preview: renders (evidence: `src/pages/CertificateGeneratorPage.tsx`)
- Certificate Generator → Multi Upload: renders (evidence: `src/pages/CertificateGeneratorPage.tsx`)
- Certificate Generator → Height-Work Upload: renders (evidence: `src/pages/CertificateGeneratorPage.tsx`)
- Certificate Generator → Certificate API Service: requests generation (evidence: `src/pages/CertificateGeneratorPage.tsx`)
- Multi Upload → Upload State Hook: uses (evidence: `src/components/certificates/MultiFileUploader.tsx`)
- Multi Upload → Certificate API Service: requests processing (evidence: `src/components/certificates/MultiFileUploader.tsx`)
- Upload State Hook → File Utilities: reads spreadsheets (evidence: `src/hooks/useFileUpload.ts`)
- Data Preview → Certificate Types: uses types (evidence: `src/components/certificates/CertificateDataPreview.tsx`)
- Certificate API Service → API Client: sends requests (evidence: `src/api/services/certificateService.ts`)
- API Client → App Configuration: reads API URL (evidence: `src/api/apiClient.ts`)
- API Client → API Backend: calls (evidence: `src/api/apiClient.ts`)
- Photo ZIP Upload → API Client: uses (evidence: `src/pages/PhotoZipUploader.tsx`)
- Image Cropper → User: offers editing
