# rahulyadav7418/mini-whatsapp-crud architecture

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

- Interactive diagram: https://gitdiagram.com/rahulyadav7418/mini-whatsapp-crud
- Repository: https://github.com/rahulyadav7418/mini-whatsapp-crud

## Overview

A small Express/Mongoose chat CRUD app: users browse chats, create messages, edit or delete them, while the server renders EJS pages and persists chat records in MongoDB. The route and model behavior is supported by sampled source; the delete-confirmation feature is documented in the README, but its exact implementation was not sampled.

Main entry points: [`index.js`](https://github.com/rahulyadav7418/mini-whatsapp-crud/blob/main/index.js) (Express routes), [`views`](https://github.com/rahulyadav7418/mini-whatsapp-crud/tree/main/views) (EJS templates), [`models/chat.js`](https://github.com/rahulyadav7418/mini-whatsapp-crud/blob/main/models/chat.js) (Chat model), [`views/index.ejs`](https://github.com/rahulyadav7418/mini-whatsapp-crud/blob/main/views/index.ejs) (Chat list)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_server["Express routes<br/>[index.js]"]
end

subgraph group_views["Rendered interface"]
  node_templates["EJS templates"]
  node_chatlist["Chat list<br/>[index.ejs]"]
  node_newform["New chat form<br/>[new.ejs]"]
  node_editform["Edit form<br/>[edit.ejs]"]
  node_style["Page styling<br/>[style.css]"]
end

subgraph group_data["Chat persistence"]
  node_model["Chat model<br/>[chat.js]"]
  node_mongo[("WhatsApp database")]
end

node_user(("Chat user"))

node_user -->|"requests chats"| node_server
node_server -->|"renders pages"| node_templates
node_templates -->|"selects list"| node_chatlist
node_templates -->|"selects form"| node_newform
node_templates -->|"selects form"| node_editform
node_server -->|"queries and mutates"| node_model
node_model -->|"reads and writes"| node_mongo
node_server -->|"returns pages"| node_user
node_server -->|"serves asset"| node_style

click node_server "https://github.com/rahulyadav7418/mini-whatsapp-crud/blob/main/index.js"
click node_templates "https://github.com/rahulyadav7418/mini-whatsapp-crud/tree/main/views"
click node_chatlist "https://github.com/rahulyadav7418/mini-whatsapp-crud/blob/main/views/index.ejs"
click node_newform "https://github.com/rahulyadav7418/mini-whatsapp-crud/blob/main/views/new.ejs"
click node_editform "https://github.com/rahulyadav7418/mini-whatsapp-crud/blob/main/views/edit.ejs"
click node_style "https://github.com/rahulyadav7418/mini-whatsapp-crud/blob/main/public/style.css"
click node_model "https://github.com/rahulyadav7418/mini-whatsapp-crud/blob/main/models/chat.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_user toneBlue
class node_templates,node_chatlist,node_newform,node_editform,node_style toneAmber
class node_model,node_mongo toneMint
```

## Components

### Web application

- [Express routes](https://github.com/rahulyadav7418/mini-whatsapp-crud/blob/main/index.js): `index.js`

### Rendered interface

- [EJS templates](https://github.com/rahulyadav7418/mini-whatsapp-crud/tree/main/views): `views`
- [Chat list](https://github.com/rahulyadav7418/mini-whatsapp-crud/blob/main/views/index.ejs): `views/index.ejs`
- [New chat form](https://github.com/rahulyadav7418/mini-whatsapp-crud/blob/main/views/new.ejs): `views/new.ejs`
- [Edit form](https://github.com/rahulyadav7418/mini-whatsapp-crud/blob/main/views/edit.ejs): `views/edit.ejs`
- [Page styling](https://github.com/rahulyadav7418/mini-whatsapp-crud/blob/main/public/style.css): `public/style.css`

### Chat persistence

- [Chat model](https://github.com/rahulyadav7418/mini-whatsapp-crud/blob/main/models/chat.js): `models/chat.js`
- **WhatsApp database**

### Other components

- **Chat user**

## Connections

- Chat user → Express routes: requests chats
- Express routes → EJS templates: renders pages
- EJS templates → Chat list: selects list
- EJS templates → New chat form: selects form
- EJS templates → Edit form: selects form
- Express routes → Chat model: queries and mutates
- Chat model → WhatsApp database: reads and writes
- Express routes → Chat user: returns pages
- Express routes → Page styling: serves asset
