# janakiramm/todo-app architecture

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

- Interactive diagram: https://gitdiagram.com/janakiramm/todo-app
- Repository: https://github.com/janakiramm/todo-app

## Overview

This is a small Dockerized Node.js/MongoDB todo app. A user’s requests enter the Express server, which dispatches todo routes; those handlers read or mutate Todo records and render the list or edit views. The app connects Mongoose to MongoDB and serves static assets. The source excerpts show the route, persistence, and rendering calls; Docker/Kubernetes deployment details are present in the tree but not expanded into runtime components here.

Main entry points: [`app/app.js`](https://github.com/janakiramm/todo-app/blob/master/app/app.js) (Express server), [`app/routes/index.js`](https://github.com/janakiramm/todo-app/blob/master/app/routes/index.js) (Todo routes), [`app/db.js`](https://github.com/janakiramm/todo-app/blob/master/app/db.js) (Todo model), [`app/public/javascripts/ga.js`](https://github.com/janakiramm/todo-app/blob/master/app/public/javascripts/ga.js) (Analytics script)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_server["Express server<br/>[app.js]"]
  node_routes["Todo routes<br/>[index.js]"]
  node_views["Todo views"]
  node_utils["Utility helpers<br/>[utils.js]"]
end

subgraph group_data["Todo persistence"]
  node_model["Todo model<br/>[db.js]"]
  node_mongo[("MongoDB")]
end

subgraph group_client["Client assets"]
  node_static["Static assets"]
  node_analytics["Analytics script<br/>[ga.js]"]
end

node_user(("Todo user"))
node_analytics_service["Google Analytics"]

node_user -->|"sends requests"| node_server
node_server -->|"loads model"| node_model
node_server -->|"dispatches routes"| node_routes
node_server -->|"serves assets"| node_static
node_routes -->|"queries and saves"| node_model
node_routes -->|"renders views"| node_views
node_routes -->|"imports"| node_utils
node_model -->|"connects"| node_mongo
node_analytics -->|"loads script"| node_analytics_service

click node_server "https://github.com/janakiramm/todo-app/blob/master/app/app.js"
click node_routes "https://github.com/janakiramm/todo-app/blob/master/app/routes/index.js"
click node_views "https://github.com/janakiramm/todo-app/tree/master/app/views"
click node_utils "https://github.com/janakiramm/todo-app/blob/master/app/utils.js"
click node_model "https://github.com/janakiramm/todo-app/blob/master/app/db.js"
click node_static "https://github.com/janakiramm/todo-app/tree/master/app/public"
click node_analytics "https://github.com/janakiramm/todo-app/blob/master/app/public/javascripts/ga.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_routes,node_views,node_utils,node_user toneBlue
class node_model,node_mongo toneAmber
class node_static,node_analytics toneMint
class node_analytics_service toneIndigo
```

## Components

### Web application

- [Express server](https://github.com/janakiramm/todo-app/blob/master/app/app.js): `app/app.js`
- [Todo routes](https://github.com/janakiramm/todo-app/blob/master/app/routes/index.js): `app/routes/index.js`
- [Todo views](https://github.com/janakiramm/todo-app/tree/master/app/views): `app/views`
- [Utility helpers](https://github.com/janakiramm/todo-app/blob/master/app/utils.js): `app/utils.js`

### Todo persistence

- [Todo model](https://github.com/janakiramm/todo-app/blob/master/app/db.js): `app/db.js`
- **MongoDB**

### Client assets

- [Static assets](https://github.com/janakiramm/todo-app/tree/master/app/public): `app/public`
- [Analytics script](https://github.com/janakiramm/todo-app/blob/master/app/public/javascripts/ga.js): `app/public/javascripts/ga.js`

### Other components

- **Todo user**
- **Google Analytics**

## Connections

- Todo user → Express server: sends requests (evidence: `app/app.js`)
- Express server → Todo model: loads model (evidence: `app/app.js`)
- Express server → Todo routes: dispatches routes (evidence: `app/app.js`)
- Express server → Static assets: serves assets (evidence: `app/app.js`)
- Todo routes → Todo model: queries and saves (evidence: `app/routes/index.js`)
- Todo routes → Todo views: renders views (evidence: `app/routes/index.js`)
- Todo routes → Utility helpers: imports (evidence: `app/routes/index.js`)
- Todo model → MongoDB: connects (evidence: `app/db.js`)
- Analytics script → Google Analytics: loads script (evidence: `app/public/javascripts/ga.js`)
