# alfinakash/autodeploy-fullstack-ec2 architecture

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

- Interactive diagram: https://gitdiagram.com/alfinakash/autodeploy-fullstack-ec2
- Repository: https://github.com/alfinakash/autodeploy-fullstack-ec2

## Overview

This is a React user-management application backed by an Express API and PostgreSQL. The main workflow is registration or login in the browser, followed by authenticated access to the user list; the API verifies credentials or tokens and reads or writes user records. The UI also provides welcome and version pages. Relationships reflect the sampled source and README; the database schema file is present in the tree, but its contents were not sampled.

Main entry points: [`frontend/src/App.jsx`](https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/frontend/src/App.jsx) (React app and routes), [`frontend/src/api.jsx`](https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/frontend/src/api.jsx) (HTTP API client), [`backend/routes/auth.js`](https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/backend/routes/auth.js) (Auth routes), [`backend/config/db.js`](https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/backend/config/db.js) (PostgreSQL connection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_app["React app and routes<br/>[App.jsx]"]
  node_welcome["Welcome page<br/>[Welcome.jsx]"]
  node_header["Header navigation<br/>[Headers.jsx]"]
  node_register["Registration form<br/>[Register.jsx]"]
  node_login["Login form<br/>[Login.jsx]"]
  node_users["Users view<br/>[Users.jsx]"]
  node_version["Version page<br/>[Version.jsx]"]
  node_api_client["HTTP API client<br/>[api.jsx]"]
end

subgraph group_api["Backend API"]
  node_server["Express server<br/>[index.js]"]
  node_auth_routes["Auth routes<br/>[auth.js]"]
  node_token_check["Token verification<br/>[middleware.js]"]
  node_auth_controller["User operations<br/>[authController.js]"]
end

subgraph group_data["Persistence"]
  node_db_pool["PostgreSQL connection<br/>[db.js]"]
  node_schema["Schema initialization SQL<br/>[init.sql]"]
  node_postgres[("PostgreSQL")]
end

node_visitor(("Browser user"))

node_visitor -->|"uses"| node_app
node_app -->|"routes to"| node_welcome
node_app -->|"renders"| node_header
node_app -->|"routes to"| node_register
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_users
node_app -->|"routes to"| node_version
node_login -->|"posts credentials"| node_api_client
node_register -->|"posts registration"| node_api_client
node_users -->|"requests users"| node_api_client
node_api_client -->|"calls API"| node_server
node_server -->|"mounts routes"| node_auth_routes
node_auth_routes -->|"dispatches"| node_auth_controller
node_auth_routes -->|"protects users route"| node_token_check
node_auth_controller -->|"queries"| node_db_pool
node_db_pool -->|"loads SQL"| node_schema
node_db_pool -->|"connects to"| node_postgres
node_version -.-> node_schema

click node_app "https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/frontend/src/App.jsx"
click node_welcome "https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/frontend/src/pages/Welcome.jsx"
click node_header "https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/frontend/src/components/Headers.jsx"
click node_register "https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/frontend/src/components/Register.jsx"
click node_login "https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/frontend/src/components/Login.jsx"
click node_users "https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/frontend/src/components/Users.jsx"
click node_version "https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/frontend/src/pages/Version.jsx"
click node_api_client "https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/frontend/src/api.jsx"
click node_server "https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/backend/index.js"
click node_auth_routes "https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/backend/routes/auth.js"
click node_token_check "https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/backend/middleware/middleware.js"
click node_auth_controller "https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/backend/controller/authController.js"
click node_db_pool "https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/backend/config/db.js"
click node_schema "https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/backend/db/init.sql"

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_app,node_welcome,node_header,node_register,node_login,node_users,node_version,node_api_client,node_visitor toneBlue
class node_server,node_auth_routes,node_token_check,node_auth_controller toneAmber
class node_db_pool,node_schema,node_postgres toneMint
```

## Components

### Web interface

- [React app and routes](https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Welcome page](https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/frontend/src/pages/Welcome.jsx): `frontend/src/pages/Welcome.jsx`
- [Header navigation](https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/frontend/src/components/Headers.jsx): `frontend/src/components/Headers.jsx`
- [Registration form](https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/frontend/src/components/Register.jsx): `frontend/src/components/Register.jsx`
- [Login form](https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/frontend/src/components/Login.jsx): `frontend/src/components/Login.jsx`
- [Users view](https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/frontend/src/components/Users.jsx): `frontend/src/components/Users.jsx`
- [Version page](https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/frontend/src/pages/Version.jsx): `frontend/src/pages/Version.jsx`
- [HTTP API client](https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/frontend/src/api.jsx): `frontend/src/api.jsx`

### Backend API

- [Express server](https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/backend/index.js): `backend/index.js`
- [Auth routes](https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/backend/routes/auth.js): `backend/routes/auth.js`
- [Token verification](https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/backend/middleware/middleware.js): `backend/middleware/middleware.js`
- [User operations](https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/backend/controller/authController.js): `backend/controller/authController.js`

### Persistence

- [PostgreSQL connection](https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/backend/config/db.js): `backend/config/db.js`
- [Schema initialization SQL](https://github.com/alfinakash/autodeploy-fullstack-ec2/blob/main/backend/db/init.sql): `backend/db/init.sql`
- **PostgreSQL**

### Other components

- **Browser user**

## Connections

- Browser user → React app and routes: uses (evidence: `README.md`)
- React app and routes → Welcome page: routes to (evidence: `frontend/src/App.jsx`)
- React app and routes → Header navigation: renders (evidence: `frontend/src/App.jsx`)
- React app and routes → Registration form: routes to (evidence: `frontend/src/App.jsx`)
- React app and routes → Login form: routes to (evidence: `frontend/src/App.jsx`)
- React app and routes → Users view: routes to (evidence: `frontend/src/App.jsx`)
- React app and routes → Version page: routes to (evidence: `frontend/src/App.jsx`)
- Login form → HTTP API client: posts credentials (evidence: `frontend/src/components/Login.jsx`)
- Registration form → HTTP API client: posts registration (evidence: `frontend/src/components/Register.jsx`)
- Users view → HTTP API client: requests users (evidence: `frontend/src/components/Users.jsx`)
- HTTP API client → Express server: calls API (evidence: `README.md`)
- Express server → Auth routes: mounts routes (evidence: `backend/index.js`)
- Auth routes → User operations: dispatches (evidence: `backend/routes/auth.js`)
- Auth routes → Token verification: protects users route (evidence: `backend/routes/auth.js`)
- User operations → PostgreSQL connection: queries (evidence: `backend/controller/authController.js`)
- PostgreSQL connection → Schema initialization SQL: loads SQL (evidence: `backend/config/db.js`)
- PostgreSQL connection → PostgreSQL: connects to (evidence: `backend/config/db.js`)
- Version page → Schema initialization SQL
