# praveen02102004/daily-notes architecture

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

- Interactive diagram: https://gitdiagram.com/praveen02102004/daily-notes
- Repository: https://github.com/praveen02102004/daily-notes

## Overview

Daily-notes is a web app for registering or logging in, organizing personal topics, and writing notes within a selected topic. Its principal workflow moves from an authenticated user to the topic list, then to a topic’s note editor, where changes are saved. The routes, session handling, database queries, and authentication logic are implemented together in index.js; EJS templates provide the rendered pages. The repository does not show a separate notes-storage layer or schema, so database relationships are limited to queries visible in the route handlers.

Main entry points: [`index.js`](https://github.com/praveen02102004/daily-notes/blob/main/index.js) (Registration and login), [`views/topic.ejs`](https://github.com/praveen02102004/daily-notes/blob/main/views/topic.ejs) (Topic page), [`views/content.ejs`](https://github.com/praveen02102004/daily-notes/blob/main/views/content.ejs) (Note editor), [`views/index.ejs`](https://github.com/praveen02102004/daily-notes/blob/main/views/index.ejs) (Landing page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and sessions"]
  node_auth["Registration and login<br/>[index.js]"]
  node_session["Session handling<br/>[index.js]"]
  node_password["Password hashing<br/>[index.js]"]
end

subgraph group_topics["Topic organization"]
  node_topic_routes["Topic routes<br/>[index.js]"]
  node_topic_list["Topic lookup<br/>[index.js]"]
end

subgraph group_notes["Note editing"]
  node_content_routes["Note routes<br/>[index.js]"]
end

subgraph group_presentation["Page rendering"]
  node_topic_page["Topic page<br/>[topic.ejs]"]
  node_content_page["Note editor<br/>[content.ejs]"]
  node_landing_page["Landing page<br/>[index.ejs]"]
  node_login_page["Login page<br/>[login.ejs]"]
  node_register_page["Registration page<br/>[register.ejs]"]
end

node_user(("User"))
node_database[("PostgreSQL")]

node_user -->|"submits credentials"| node_auth
node_auth -->|"queries users"| node_database
node_auth -->|"hashes or checks"| node_password
node_auth -->|"sets user session"| node_session
node_user -->|"requests topics"| node_topic_routes
node_topic_routes -->|"loads topics"| node_topic_list
node_topic_list -->|"queries topics"| node_database
node_topic_routes -->|"adds or deletes"| node_database
node_topic_routes -->|"renders"| node_topic_page
node_user -->|"opens or saves note"| node_content_routes
node_content_routes -->|"reads or writes notes"| node_database
node_content_routes -->|"looks up topic"| node_database
node_content_routes -->|"renders"| node_content_page
node_user -->|"visits home"| node_landing_page
node_user -->|"opens login"| node_login_page
node_user -->|"opens registration"| node_register_page
node_session -->|"reloads user"| node_database

click node_auth "https://github.com/praveen02102004/daily-notes/blob/main/index.js"
click node_session "https://github.com/praveen02102004/daily-notes/blob/main/index.js"
click node_password "https://github.com/praveen02102004/daily-notes/blob/main/index.js"
click node_topic_routes "https://github.com/praveen02102004/daily-notes/blob/main/index.js"
click node_topic_list "https://github.com/praveen02102004/daily-notes/blob/main/index.js"
click node_topic_page "https://github.com/praveen02102004/daily-notes/blob/main/views/topic.ejs"
click node_content_routes "https://github.com/praveen02102004/daily-notes/blob/main/index.js"
click node_content_page "https://github.com/praveen02102004/daily-notes/blob/main/views/content.ejs"
click node_landing_page "https://github.com/praveen02102004/daily-notes/blob/main/views/index.ejs"
click node_login_page "https://github.com/praveen02102004/daily-notes/blob/main/views/login.ejs"
click node_register_page "https://github.com/praveen02102004/daily-notes/blob/main/views/register.ejs"

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_auth,node_session,node_password,node_user toneBlue
class node_topic_routes,node_topic_list,node_database toneAmber
class node_content_routes toneMint
class node_topic_page,node_content_page,node_landing_page,node_login_page,node_register_page toneRose
```

## Components

### Identity and sessions

- [Registration and login](https://github.com/praveen02102004/daily-notes/blob/main/index.js): `index.js`
- [Session handling](https://github.com/praveen02102004/daily-notes/blob/main/index.js): `index.js`
- [Password hashing](https://github.com/praveen02102004/daily-notes/blob/main/index.js): `index.js`

### Topic organization

- [Topic routes](https://github.com/praveen02102004/daily-notes/blob/main/index.js): `index.js`
- [Topic lookup](https://github.com/praveen02102004/daily-notes/blob/main/index.js): `index.js`

### Note editing

- [Note routes](https://github.com/praveen02102004/daily-notes/blob/main/index.js): `index.js`

### Page rendering

- [Topic page](https://github.com/praveen02102004/daily-notes/blob/main/views/topic.ejs): `views/topic.ejs`
- [Note editor](https://github.com/praveen02102004/daily-notes/blob/main/views/content.ejs): `views/content.ejs`
- [Landing page](https://github.com/praveen02102004/daily-notes/blob/main/views/index.ejs): `views/index.ejs`
- [Login page](https://github.com/praveen02102004/daily-notes/blob/main/views/login.ejs): `views/login.ejs`
- [Registration page](https://github.com/praveen02102004/daily-notes/blob/main/views/register.ejs): `views/register.ejs`

### Other components

- **User**
- **PostgreSQL**

## Connections

- User → Registration and login: submits credentials (evidence: `index.js`)
- Registration and login → PostgreSQL: queries users (evidence: `index.js`)
- Registration and login → Password hashing: hashes or checks (evidence: `index.js`)
- Registration and login → Session handling: sets user session (evidence: `index.js`)
- User → Topic routes: requests topics (evidence: `index.js`)
- Topic routes → Topic lookup: loads topics (evidence: `index.js`)
- Topic lookup → PostgreSQL: queries topics (evidence: `index.js`)
- Topic routes → PostgreSQL: adds or deletes (evidence: `index.js`)
- Topic routes → Topic page: renders (evidence: `index.js`)
- User → Note routes: opens or saves note (evidence: `index.js`)
- Note routes → PostgreSQL: reads or writes notes (evidence: `index.js`)
- Note routes → PostgreSQL: looks up topic (evidence: `index.js`)
- Note routes → Note editor: renders (evidence: `index.js`)
- User → Landing page: visits home
- User → Login page: opens login
- User → Registration page: opens registration
- Session handling → PostgreSQL: reloads user (evidence: `index.js`)
