# wildcodeschool-2025-09/p3-0526-remote-impulsion architecture

> Architecture diagram of the GitHub repository wildcodeschool-2025-09/p3-0526-remote-impulsion, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wildcodeschool-2025-09/p3-0526-remote-impulsion
- Repository: https://github.com/wildcodeschool-2025-09/p3-0526-remote-impulsion

## Overview

This repository is a React–Express–MySQL teaching scaffold, not a fully implemented item storefront. Its demonstrated item workflow is an HTTP request routed to an item action, which reads or creates item data through a repository and database pool; the React app currently renders a static welcome screen. The README describes the intended client-to-server flow and browse/read/add API, but no client fetcher is implemented in the sampled files. Migration, seeding, and development tooling are omitted from this runtime map.

Main entry points: [`server/src/app.ts`](https://github.com/wildcodeschool-2025-09/p3-0526-remote-impulsion/blob/main/server/src/app.ts) (Express app), [`client/src/main.tsx`](https://github.com/wildcodeschool-2025-09/p3-0526-remote-impulsion/blob/main/client/src/main.tsx) (Client router), [`server/src/router.ts`](https://github.com/wildcodeschool-2025-09/p3-0526-remote-impulsion/blob/main/server/src/router.ts) (API routes), [`server/src/main.ts`](https://github.com/wildcodeschool-2025-09/p3-0526-remote-impulsion/blob/main/server/src/main.ts) (Server startup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app_ui["Welcome UI<br/>[App.tsx]"]
  node_client_router["Client router<br/>[main.tsx]"]
end

subgraph group_server["HTTP server"]
  node_server_start["Server startup<br/>[main.ts]"]
  node_db_check["Connection check<br/>[checkConnection.ts]"]
  node_express_app["Express app<br/>[app.ts]"]
  node_api_router["API routes<br/>[router.ts]"]
end

subgraph group_data["Item data"]
  node_item_actions["Item actions<br/>[itemActions.ts]"]
  node_item_repository["Item repository<br/>[itemRepository.ts]"]
  node_db_pool["MySQL pool<br/>[client.ts]"]
  node_mysql[("MySQL database<br/>[schema.sql]")]
end

node_visitor(("Visitor"))
node_http_caller(("HTTP client"))

node_visitor -->|"opens app"| node_client_router
node_client_router -->|"renders"| node_app_ui
node_http_caller -.->|"sends HTTP"| node_api_router
node_server_start -->|"starts"| node_express_app
node_server_start -->|"checks connection"| node_db_check
node_express_app -->|"mounts"| node_api_router
node_api_router -->|"routes requests"| node_item_actions
node_item_actions -->|"calls"| node_item_repository
node_item_repository -->|"queries"| node_db_pool
node_db_pool -.->|"reads and writes"| node_mysql
node_express_app -->|"serves built client"| node_client_router

click node_app_ui "https://github.com/wildcodeschool-2025-09/p3-0526-remote-impulsion/blob/main/client/src/App.tsx"
click node_client_router "https://github.com/wildcodeschool-2025-09/p3-0526-remote-impulsion/blob/main/client/src/main.tsx"
click node_server_start "https://github.com/wildcodeschool-2025-09/p3-0526-remote-impulsion/blob/main/server/src/main.ts"
click node_db_check "https://github.com/wildcodeschool-2025-09/p3-0526-remote-impulsion/blob/main/server/database/checkConnection.ts"
click node_express_app "https://github.com/wildcodeschool-2025-09/p3-0526-remote-impulsion/blob/main/server/src/app.ts"
click node_api_router "https://github.com/wildcodeschool-2025-09/p3-0526-remote-impulsion/blob/main/server/src/router.ts"
click node_item_actions "https://github.com/wildcodeschool-2025-09/p3-0526-remote-impulsion/blob/main/server/src/modules/item/itemActions.ts"
click node_item_repository "https://github.com/wildcodeschool-2025-09/p3-0526-remote-impulsion/blob/main/server/src/modules/item/itemRepository.ts"
click node_db_pool "https://github.com/wildcodeschool-2025-09/p3-0526-remote-impulsion/blob/main/server/database/client.ts"
click node_mysql "https://github.com/wildcodeschool-2025-09/p3-0526-remote-impulsion/blob/main/server/database/schema.sql"

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_ui,node_client_router,node_http_caller toneBlue
class node_server_start,node_db_check,node_express_app,node_api_router toneAmber
class node_item_actions,node_item_repository,node_db_pool,node_mysql toneMint
class node_visitor toneIndigo
```

## Components

### Web client

- [Welcome UI](https://github.com/wildcodeschool-2025-09/p3-0526-remote-impulsion/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [Client router](https://github.com/wildcodeschool-2025-09/p3-0526-remote-impulsion/blob/main/client/src/main.tsx): `client/src/main.tsx`

### HTTP server

- [Server startup](https://github.com/wildcodeschool-2025-09/p3-0526-remote-impulsion/blob/main/server/src/main.ts): `server/src/main.ts`
- [Connection check](https://github.com/wildcodeschool-2025-09/p3-0526-remote-impulsion/blob/main/server/database/checkConnection.ts): `server/database/checkConnection.ts`
- [Express app](https://github.com/wildcodeschool-2025-09/p3-0526-remote-impulsion/blob/main/server/src/app.ts): `server/src/app.ts`
- [API routes](https://github.com/wildcodeschool-2025-09/p3-0526-remote-impulsion/blob/main/server/src/router.ts): `server/src/router.ts`

### Item data

- [Item actions](https://github.com/wildcodeschool-2025-09/p3-0526-remote-impulsion/blob/main/server/src/modules/item/itemActions.ts): `server/src/modules/item/itemActions.ts`
- [Item repository](https://github.com/wildcodeschool-2025-09/p3-0526-remote-impulsion/blob/main/server/src/modules/item/itemRepository.ts): `server/src/modules/item/itemRepository.ts`
- [MySQL pool](https://github.com/wildcodeschool-2025-09/p3-0526-remote-impulsion/blob/main/server/database/client.ts): `server/database/client.ts`
- [MySQL database](https://github.com/wildcodeschool-2025-09/p3-0526-remote-impulsion/blob/main/server/database/schema.sql): `server/database/schema.sql`

### Other components

- **Visitor**
- **HTTP client**

## Connections

- Visitor → Client router: opens app (evidence: `client/src/main.tsx`)
- Client router → Welcome UI: renders (evidence: `client/src/main.tsx`)
- HTTP client → API routes: sends HTTP (evidence: `README.md`)
- Server startup → Express app: starts (evidence: `server/src/main.ts`)
- Server startup → Connection check: checks connection (evidence: `server/src/main.ts`)
- Express app → API routes: mounts (evidence: `server/src/app.ts`)
- API routes → Item actions: routes requests (evidence: `server/src/router.ts`)
- Item actions → Item repository: calls (evidence: `server/src/modules/item/itemActions.ts`)
- Item repository → MySQL pool: queries (evidence: `server/src/modules/item/itemRepository.ts`)
- MySQL pool → MySQL database: reads and writes (evidence: `README.md`)
- Express app → Client router: serves built client (evidence: `server/src/app.ts`)
