# washingmachine55/kikomilano architecture

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

- Interactive diagram: https://gitdiagram.com/washingmachine55/kikomilano
- Repository: https://github.com/washingmachine55/kikomilano

## Overview

Kikomilano is an Express e-commerce API. Clients authenticate or register, browse products, manage profiles, addresses and favorites, create orders, then initiate Stripe payments; password recovery adds OTP email verification. The graph shows the documented major capabilities and sampled call paths. Some controller and route implementations were not sampled, so their internal wiring is omitted; the tree also lacks migration and category-service details beyond their listed paths.

Main entry points: [`src/app.js`](https://github.com/washingmachine55/kikomilano/blob/main/src/app.js) (Express app), [`src/controllers/payments.controller.js`](https://github.com/washingmachine55/kikomilano/blob/main/src/controllers/payments.controller.js) (Payment handlers), [`src/config/db.js`](https://github.com/washingmachine55/kikomilano/blob/main/src/config/db.js) (PostgreSQL), [`src/controllers/auth.controller.js`](https://github.com/washingmachine55/kikomilano/blob/main/src/controllers/auth.controller.js) (Auth handlers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API entry"]
  node_app["Express app<br/>[app.js]"]
  node_server["HTTP server<br/>[server.js]"]
  node_auth_routes["Auth routes<br/>[auth.routes.js]"]
  node_user_routes["User routes<br/>[users.routes.js]"]
  node_product_routes["Product routes<br/>[products.routes.js]"]
  node_order_routes["Order routes<br/>[orders.routes.js]"]
  node_payment_routes["Payment routes<br/>[payments.routes.js]"]
  node_webhook_routes["Stripe webhook<br/>[webhook.routes.js]"]
  node_input_validation["Input validation"]
end

subgraph group_identity["Identity"]
  node_auth_controller["Auth handlers<br/>[auth.controller.js]"]
  node_auth_service["Auth services"]
  node_token_middleware["Token verification"]
end

subgraph group_commerce["Catalog and users"]
  node_user_controller["User handlers"]
  node_user_services["User services"]
  node_product_controller["Product handlers"]
  node_product_services["Product services"]
  node_category_service["Category lookup"]
end

subgraph group_checkout["Orders and payments"]
  node_order_controller["Order handlers"]
  node_order_service["Order services<br/>[orders.service.js]"]
  node_payment_controller["Payment handlers"]
  node_payment_service["Payment records"]
end

subgraph group_infrastructure["Data and integrations"]
  node_postgres[("PostgreSQL<br/>[db.js]")]
  node_stripe["Stripe"]
  node_mailer["Email transport<br/>[mailTransporter.js]"]
end

node_client(("API client"))

node_client -->|"sends requests"| node_app
node_server -->|"serves"| node_app
node_app -->|"mounts"| node_auth_routes
node_app -->|"mounts"| node_user_routes
node_app -->|"mounts"| node_product_routes
node_app -->|"mounts"| node_order_routes
node_app -->|"mounts"| node_payment_routes
node_app -->|"mounts"| node_webhook_routes
node_app -->|"applies"| node_token_middleware
node_app -->|"applies"| node_input_validation
node_auth_routes -->|"dispatches"| node_auth_controller
node_user_routes -->|"dispatches"| node_user_controller
node_product_routes -->|"dispatches"| node_product_controller
node_auth_controller -->|"invokes"| node_auth_service
node_auth_controller -.->|"sends recovery email"| node_mailer
node_user_controller -->|"invokes"| node_user_services
node_product_controller -->|"invokes"| node_product_services
node_product_controller -->|"invokes"| node_category_service
node_order_routes -->|"dispatches"| node_order_controller
node_payment_routes -->|"dispatches"| node_payment_controller
node_order_controller -->|"invokes"| node_order_service
node_payment_controller -->|"loads order"| node_order_service
node_payment_controller -->|"creates intent"| node_stripe
node_payment_controller -->|"saves payment"| node_payment_service
node_webhook_routes -->|"dispatches events"| node_payment_controller
node_auth_service -->|"queries"| node_postgres
node_user_services -->|"reads and writes"| node_postgres
node_product_services -->|"queries"| node_postgres
node_order_service -->|"reads and writes"| node_postgres
node_payment_service -->|"persists records"| node_postgres

click node_app "https://github.com/washingmachine55/kikomilano/blob/main/src/app.js"
click node_server "https://github.com/washingmachine55/kikomilano/blob/main/src/server.js"
click node_auth_routes "https://github.com/washingmachine55/kikomilano/blob/main/src/routes/auth.routes.js"
click node_user_routes "https://github.com/washingmachine55/kikomilano/blob/main/src/routes/users.routes.js"
click node_product_routes "https://github.com/washingmachine55/kikomilano/blob/main/src/routes/products.routes.js"
click node_order_routes "https://github.com/washingmachine55/kikomilano/blob/main/src/routes/orders.routes.js"
click node_payment_routes "https://github.com/washingmachine55/kikomilano/blob/main/src/routes/payments.routes.js"
click node_webhook_routes "https://github.com/washingmachine55/kikomilano/blob/main/src/routes/webhook.routes.js"
click node_auth_controller "https://github.com/washingmachine55/kikomilano/blob/main/src/controllers/auth.controller.js"
click node_auth_service "https://github.com/washingmachine55/kikomilano/tree/main/src/services/auth"
click node_token_middleware "https://github.com/washingmachine55/kikomilano/blob/main/src/middlewares/verifyToken.auth.js"
click node_user_controller "https://github.com/washingmachine55/kikomilano/blob/main/src/controllers/users.controller.js"
click node_user_services "https://github.com/washingmachine55/kikomilano/tree/main/src/services/users"
click node_product_controller "https://github.com/washingmachine55/kikomilano/blob/main/src/controllers/products.controller.js"
click node_product_services "https://github.com/washingmachine55/kikomilano/tree/main/src/services/products"
click node_category_service "https://github.com/washingmachine55/kikomilano/blob/main/src/services/categories/getAll.categories.service.js"
click node_order_controller "https://github.com/washingmachine55/kikomilano/blob/main/src/controllers/orders.controller.js"
click node_order_service "https://github.com/washingmachine55/kikomilano/blob/main/src/services/orders/orders.service.js"
click node_payment_controller "https://github.com/washingmachine55/kikomilano/blob/main/src/controllers/payments.controller.js"
click node_payment_service "https://github.com/washingmachine55/kikomilano/blob/main/src/services/payments/payments.service.js"
click node_postgres "https://github.com/washingmachine55/kikomilano/blob/main/src/config/db.js"
click node_mailer "https://github.com/washingmachine55/kikomilano/blob/main/src/config/mailTransporter.js"
click node_input_validation "https://github.com/washingmachine55/kikomilano/blob/main/src/middlewares/globalInputVerification.js"

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_server,node_auth_routes,node_user_routes,node_product_routes,node_order_routes,node_payment_routes,node_webhook_routes,node_input_validation,node_client toneBlue
class node_auth_controller,node_auth_service,node_token_middleware toneAmber
class node_user_controller,node_user_services,node_product_controller,node_product_services,node_category_service toneMint
class node_order_controller,node_order_service,node_payment_controller,node_payment_service toneRose
class node_postgres,node_stripe,node_mailer toneIndigo
```

## Components

### API entry

- [Express app](https://github.com/washingmachine55/kikomilano/blob/main/src/app.js): `src/app.js`
- [HTTP server](https://github.com/washingmachine55/kikomilano/blob/main/src/server.js): `src/server.js`
- [Auth routes](https://github.com/washingmachine55/kikomilano/blob/main/src/routes/auth.routes.js): `src/routes/auth.routes.js`
- [User routes](https://github.com/washingmachine55/kikomilano/blob/main/src/routes/users.routes.js): `src/routes/users.routes.js`
- [Product routes](https://github.com/washingmachine55/kikomilano/blob/main/src/routes/products.routes.js): `src/routes/products.routes.js`
- [Order routes](https://github.com/washingmachine55/kikomilano/blob/main/src/routes/orders.routes.js): `src/routes/orders.routes.js`
- [Payment routes](https://github.com/washingmachine55/kikomilano/blob/main/src/routes/payments.routes.js): `src/routes/payments.routes.js`
- [Stripe webhook](https://github.com/washingmachine55/kikomilano/blob/main/src/routes/webhook.routes.js): `src/routes/webhook.routes.js`
- [Input validation](https://github.com/washingmachine55/kikomilano/blob/main/src/middlewares/globalInputVerification.js): `src/middlewares/globalInputVerification.js`

### Identity

- [Auth handlers](https://github.com/washingmachine55/kikomilano/blob/main/src/controllers/auth.controller.js): `src/controllers/auth.controller.js`
- [Auth services](https://github.com/washingmachine55/kikomilano/tree/main/src/services/auth): `src/services/auth`
- [Token verification](https://github.com/washingmachine55/kikomilano/blob/main/src/middlewares/verifyToken.auth.js): `src/middlewares/verifyToken.auth.js`

### Catalog and users

- [User handlers](https://github.com/washingmachine55/kikomilano/blob/main/src/controllers/users.controller.js): `src/controllers/users.controller.js`
- [User services](https://github.com/washingmachine55/kikomilano/tree/main/src/services/users): `src/services/users`
- [Product handlers](https://github.com/washingmachine55/kikomilano/blob/main/src/controllers/products.controller.js): `src/controllers/products.controller.js`
- [Product services](https://github.com/washingmachine55/kikomilano/tree/main/src/services/products): `src/services/products`
- [Category lookup](https://github.com/washingmachine55/kikomilano/blob/main/src/services/categories/getAll.categories.service.js): `src/services/categories/getAll.categories.service.js`

### Orders and payments

- [Order handlers](https://github.com/washingmachine55/kikomilano/blob/main/src/controllers/orders.controller.js): `src/controllers/orders.controller.js`
- [Order services](https://github.com/washingmachine55/kikomilano/blob/main/src/services/orders/orders.service.js): `src/services/orders/orders.service.js`
- [Payment handlers](https://github.com/washingmachine55/kikomilano/blob/main/src/controllers/payments.controller.js): `src/controllers/payments.controller.js`
- [Payment records](https://github.com/washingmachine55/kikomilano/blob/main/src/services/payments/payments.service.js): `src/services/payments/payments.service.js`

### Data and integrations

- [PostgreSQL](https://github.com/washingmachine55/kikomilano/blob/main/src/config/db.js): `src/config/db.js`
- **Stripe**
- [Email transport](https://github.com/washingmachine55/kikomilano/blob/main/src/config/mailTransporter.js): `src/config/mailTransporter.js`

### Other components

- **API client**

## Connections

- API client → Express app: sends requests
- HTTP server → Express app: serves
- Express app → Auth routes: mounts
- Express app → User routes: mounts
- Express app → Product routes: mounts
- Express app → Order routes: mounts
- Express app → Payment routes: mounts
- Express app → Stripe webhook: mounts
- Express app → Token verification: applies
- Express app → Input validation: applies
- Auth routes → Auth handlers: dispatches
- User routes → User handlers: dispatches
- Product routes → Product handlers: dispatches
- Auth handlers → Auth services: invokes
- Auth handlers → Email transport: sends recovery email
- User handlers → User services: invokes
- Product handlers → Product services: invokes
- Product handlers → Category lookup: invokes
- Order routes → Order handlers: dispatches
- Payment routes → Payment handlers: dispatches
- Order handlers → Order services: invokes
- Payment handlers → Order services: loads order
- Payment handlers → Stripe: creates intent
- Payment handlers → Payment records: saves payment
- Stripe webhook → Payment handlers: dispatches events
- Auth services → PostgreSQL: queries
- User services → PostgreSQL: reads and writes
- Product services → PostgreSQL: queries
- Order services → PostgreSQL: reads and writes
- Payment records → PostgreSQL: persists records
