# ajithselvam/3-tier-app-login architecture

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

- Interactive diagram: https://gitdiagram.com/ajithselvam/3-tier-app-login
- Repository: https://github.com/ajithselvam/3-tier-app-login

## Overview

This is a Kubernetes-hosted login and signup application. A browser submits signup or login details through the frontend; after login, the frontend stores the JWT and requests the authenticated profile. The backend validates credentials, hashes signup passwords, issues and verifies JWTs, and uses a MySQL connection pool for user data. The README documents NGINX API proxying and Kubernetes deployment resources; manifest-level wiring is not shown in the sampled source, so it is represented only as a deployment subsystem.

Main entry points: [`frontend/app.js`](https://github.com/ajithselvam/3-tier-app-login/blob/main/frontend/app.js) (Login and signup UI), [`backend/server.js`](https://github.com/ajithselvam/3-tier-app-login/blob/main/backend/server.js) (Signup handler), [`backend/db.js`](https://github.com/ajithselvam/3-tier-app-login/blob/main/backend/db.js) (MySQL connection pool), [`k8s/05-mysql-deployment.yaml`](https://github.com/ajithselvam/3-tier-app-login/blob/main/k8s/05-mysql-deployment.yaml) (MySQL user store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser experience"]
  node_web_ui["Login and signup UI<br/>[app.js]"]
  node_nginx["NGINX frontend proxy<br/>[nginx.conf]"]
end

subgraph group_api["Authentication API"]
  node_signup["Signup handler<br/>[server.js]"]
  node_login["Login and JWT<br/>[server.js]"]
  node_profile["Profile authentication<br/>[server.js]"]
end

subgraph group_data["User data"]
  node_pool["MySQL connection pool<br/>[db.js]"]
  node_mysql[("MySQL user store")]
end

subgraph group_platform["Kubernetes platform"]
  node_manifests["Kubernetes resources"]
end

node_browser(("Browser user"))

node_browser -->|"uses"| node_web_ui
node_web_ui -->|"sends API requests"| node_nginx
node_nginx -->|"proxies API"| node_signup
node_web_ui -->|"submits signup"| node_signup
node_web_ui -->|"submits credentials"| node_login
node_web_ui -->|"requests profile"| node_profile
node_signup -->|"queries and inserts"| node_pool
node_login -->|"loads user"| node_pool
node_profile -->|"loads profile"| node_pool
node_signup -->|"stores account data"| node_mysql
node_login -->|"checks credentials"| node_mysql
node_profile -->|"reads user data"| node_mysql
node_pool -->|"connects to"| node_mysql
node_manifests -->|"configures proxy"| node_nginx

click node_web_ui "https://github.com/ajithselvam/3-tier-app-login/blob/main/frontend/app.js"
click node_nginx "https://github.com/ajithselvam/3-tier-app-login/blob/main/frontend/nginx.conf"
click node_signup "https://github.com/ajithselvam/3-tier-app-login/blob/main/backend/server.js"
click node_login "https://github.com/ajithselvam/3-tier-app-login/blob/main/backend/server.js"
click node_profile "https://github.com/ajithselvam/3-tier-app-login/blob/main/backend/server.js"
click node_pool "https://github.com/ajithselvam/3-tier-app-login/blob/main/backend/db.js"
click node_mysql "https://github.com/ajithselvam/3-tier-app-login/blob/main/k8s/05-mysql-deployment.yaml"
click node_manifests "https://github.com/ajithselvam/3-tier-app-login/tree/main/k8s"

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_web_ui,node_nginx,node_browser toneBlue
class node_signup,node_login,node_profile toneAmber
class node_pool,node_mysql toneMint
class node_manifests toneRose
```

## Components

### Browser experience

- [Login and signup UI](https://github.com/ajithselvam/3-tier-app-login/blob/main/frontend/app.js): `frontend/app.js`
- [NGINX frontend proxy](https://github.com/ajithselvam/3-tier-app-login/blob/main/frontend/nginx.conf): `frontend/nginx.conf`

### Authentication API

- [Signup handler](https://github.com/ajithselvam/3-tier-app-login/blob/main/backend/server.js): `backend/server.js`
- [Login and JWT](https://github.com/ajithselvam/3-tier-app-login/blob/main/backend/server.js): `backend/server.js`
- [Profile authentication](https://github.com/ajithselvam/3-tier-app-login/blob/main/backend/server.js): `backend/server.js`

### User data

- [MySQL connection pool](https://github.com/ajithselvam/3-tier-app-login/blob/main/backend/db.js): `backend/db.js`
- [MySQL user store](https://github.com/ajithselvam/3-tier-app-login/blob/main/k8s/05-mysql-deployment.yaml): `k8s/05-mysql-deployment.yaml`

### Kubernetes platform

- [Kubernetes resources](https://github.com/ajithselvam/3-tier-app-login/tree/main/k8s): `k8s`

### Other components

- **Browser user**

## Connections

- Browser user → Login and signup UI: uses (evidence: `README.md`)
- Login and signup UI → NGINX frontend proxy: sends API requests (evidence: `README.md`)
- NGINX frontend proxy → Signup handler: proxies API (evidence: `README.md`)
- Login and signup UI → Signup handler: submits signup (evidence: `frontend/app.js`)
- Login and signup UI → Login and JWT: submits credentials (evidence: `frontend/app.js`)
- Login and signup UI → Profile authentication: requests profile (evidence: `frontend/app.js`)
- Signup handler → MySQL connection pool: queries and inserts (evidence: `backend/server.js`)
- Login and JWT → MySQL connection pool: loads user (evidence: `backend/server.js`)
- Profile authentication → MySQL connection pool: loads profile (evidence: `backend/server.js`)
- Signup handler → MySQL user store: stores account data (evidence: `README.md`)
- Login and JWT → MySQL user store: checks credentials (evidence: `README.md`)
- Profile authentication → MySQL user store: reads user data (evidence: `README.md`)
- MySQL connection pool → MySQL user store: connects to (evidence: `backend/db.js`)
- Kubernetes resources → NGINX frontend proxy: configures proxy (evidence: `README.md`)
