# odziem/express-project architecture

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

- Interactive diagram: https://gitdiagram.com/odziem/express-project
- Repository: https://github.com/odziem/express-project

## Overview

This is a small Express friends-and-messages web app. Requests enter at the server, which serves the home page and static assets or dispatches to friends and messages routes. Friend handlers read and mutate an in-memory list; message handlers render a view or log a placeholder update. View files and static assets are identified from the tree, but their contents were not sampled, so their internal behavior is not described.

Main entry points: [`server.js`](https://github.com/odziem/express-project/blob/master/server.js) (Express server), [`routes/friends.router.js`](https://github.com/odziem/express-project/blob/master/routes/friends.router.js) (Friends routes), [`controllers/friends.controller.js`](https://github.com/odziem/express-project/blob/master/controllers/friends.controller.js) (Friends handlers), [`routes/messages.router.js`](https://github.com/odziem/express-project/blob/master/routes/messages.router.js) (Messages routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Web runtime"]
  node_server["Express server<br/>[server.js]"]
  node_public["Static assets"]
  node_home["Home view<br/>[index.hbs]"]
end

subgraph group_friends["Friends API"]
  node_friends_routes["Friends routes<br/>[friends.router.js]"]
  node_friends_controller["Friends handlers"]
  node_friends_model[("In-memory friends<br/>[friends.model.js]")]
end

subgraph group_messages["Messages UI"]
  node_messages_routes["Messages routes<br/>[messages.router.js]"]
  node_messages_controller["Messages handlers"]
  node_messages_view["Messages view<br/>[messages.hbs]"]
end

node_visitor(("Browser visitor"))

node_visitor -.->|"sends requests"| node_server
node_server -->|"renders"| node_home
node_server -->|"serves assets"| node_public
node_server -->|"mounts at /friends"| node_friends_routes
node_friends_routes -->|"dispatches requests"| node_friends_controller
node_friends_controller -->|"reads and updates"| node_friends_model
node_server -->|"mounts at /messages"| node_messages_routes
node_messages_routes -->|"dispatches requests"| node_messages_controller
node_messages_controller -->|"renders"| node_messages_view

click node_server "https://github.com/odziem/express-project/blob/master/server.js"
click node_public "https://github.com/odziem/express-project/tree/master/public"
click node_home "https://github.com/odziem/express-project/blob/master/views/index.hbs"
click node_friends_routes "https://github.com/odziem/express-project/blob/master/routes/friends.router.js"
click node_friends_controller "https://github.com/odziem/express-project/blob/master/controllers/friends.controller.js"
click node_friends_model "https://github.com/odziem/express-project/blob/master/models/friends.model.js"
click node_messages_routes "https://github.com/odziem/express-project/blob/master/routes/messages.router.js"
click node_messages_controller "https://github.com/odziem/express-project/blob/master/controllers/messages.controller.js"
click node_messages_view "https://github.com/odziem/express-project/blob/master/views/messages.hbs"

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_public,node_home,node_visitor toneBlue
class node_friends_routes,node_friends_controller,node_friends_model toneAmber
class node_messages_routes,node_messages_controller,node_messages_view toneMint
```

## Components

### Web runtime

- [Express server](https://github.com/odziem/express-project/blob/master/server.js): `server.js`
- [Static assets](https://github.com/odziem/express-project/tree/master/public): `public`
- [Home view](https://github.com/odziem/express-project/blob/master/views/index.hbs): `views/index.hbs`

### Friends API

- [Friends routes](https://github.com/odziem/express-project/blob/master/routes/friends.router.js): `routes/friends.router.js`
- [Friends handlers](https://github.com/odziem/express-project/blob/master/controllers/friends.controller.js): `controllers/friends.controller.js`
- [In-memory friends](https://github.com/odziem/express-project/blob/master/models/friends.model.js): `models/friends.model.js`

### Messages UI

- [Messages routes](https://github.com/odziem/express-project/blob/master/routes/messages.router.js): `routes/messages.router.js`
- [Messages handlers](https://github.com/odziem/express-project/blob/master/controllers/messages.controller.js): `controllers/messages.controller.js`
- [Messages view](https://github.com/odziem/express-project/blob/master/views/messages.hbs): `views/messages.hbs`

### Other components

- **Browser visitor**

## Connections

- Browser visitor → Express server: sends requests
- Express server → Home view: renders (evidence: `server.js`)
- Express server → Static assets: serves assets (evidence: `server.js`)
- Express server → Friends routes: mounts at /friends (evidence: `server.js`)
- Friends routes → Friends handlers: dispatches requests (evidence: `routes/friends.router.js`)
- Friends handlers → In-memory friends: reads and updates (evidence: `controllers/friends.controller.js`)
- Express server → Messages routes: mounts at /messages (evidence: `server.js`)
- Messages routes → Messages handlers: dispatches requests (evidence: `routes/messages.router.js`)
- Messages handlers → Messages view: renders (evidence: `controllers/messages.controller.js`)
