# rizwan-ghouri/backend-practices architecture

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

- Interactive diagram: https://gitdiagram.com/rizwan-ghouri/backend-practices
- Repository: https://github.com/rizwan-ghouri/backend-practices

## Overview

This is a small Express API with a single HTTP entry point, three route groups, and a static in-memory comments dataset. A request reaches the server and is dispatched to a mounted route; the products collection route returns the comments dataset. The excerpts show route behavior and mounting, but no persistence or broader product workflow. (The README is empty.)

Main entry points: [`index.js`](https://github.com/rizwan-ghouri/backend-practices/blob/main/index.js) (Express Server), [`routes/productsRoute.js`](https://github.com/rizwan-ghouri/backend-practices/blob/main/routes/productsRoute.js) (Products Routes), [`routes/usersRoute.js`](https://github.com/rizwan-ghouri/backend-practices/blob/main/routes/usersRoute.js) (Users Routes), [`routes/authRoute.js`](https://github.com/rizwan-ghouri/backend-practices/blob/main/routes/authRoute.js) (Auth Routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["HTTP Runtime"]
  node_server["Express Server<br/>[index.js]"]
end

subgraph group_api["API Routes and Data"]
  node_products["Products Routes<br/>[productsRoute.js]"]
  node_users["Users Routes<br/>[usersRoute.js]"]
  node_auth["Auth Routes<br/>[authRoute.js]"]
  node_comments["Comments Dataset<br/>[comment.js]"]
end

node_client(("HTTP Client"))

node_client -->|"sends requests"| node_server
node_server -->|"mounts at /products"| node_products
node_server -->|"mounts at /users"| node_users
node_server -->|"mounts at /auth"| node_auth
node_products -->|"returns dataset"| node_comments

click node_server "https://github.com/rizwan-ghouri/backend-practices/blob/main/index.js"
click node_products "https://github.com/rizwan-ghouri/backend-practices/blob/main/routes/productsRoute.js"
click node_users "https://github.com/rizwan-ghouri/backend-practices/blob/main/routes/usersRoute.js"
click node_auth "https://github.com/rizwan-ghouri/backend-practices/blob/main/routes/authRoute.js"
click node_comments "https://github.com/rizwan-ghouri/backend-practices/blob/main/comment.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_server,node_client toneBlue
class node_products,node_users,node_auth,node_comments toneAmber
```

## Components

### HTTP Runtime

- [Express Server](https://github.com/rizwan-ghouri/backend-practices/blob/main/index.js): `index.js`

### API Routes and Data

- [Products Routes](https://github.com/rizwan-ghouri/backend-practices/blob/main/routes/productsRoute.js): `routes/productsRoute.js`
- [Users Routes](https://github.com/rizwan-ghouri/backend-practices/blob/main/routes/usersRoute.js): `routes/usersRoute.js`
- [Auth Routes](https://github.com/rizwan-ghouri/backend-practices/blob/main/routes/authRoute.js): `routes/authRoute.js`
- [Comments Dataset](https://github.com/rizwan-ghouri/backend-practices/blob/main/comment.js): `comment.js`

### Other components

- **HTTP Client**

## Connections

- HTTP Client → Express Server: sends requests
- Express Server → Products Routes: mounts at /products (evidence: `index.js`)
- Express Server → Users Routes: mounts at /users (evidence: `index.js`)
- Express Server → Auth Routes: mounts at /auth (evidence: `index.js`)
- Products Routes → Comments Dataset: returns dataset (evidence: `routes/productsRoute.js`)
