# vidhiu/mern_app_docker architecture

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

- Interactive diagram: https://gitdiagram.com/vidhiu/mern_app_docker
- Repository: https://github.com/vidhiu/mern_app_docker

## Overview

This repository combines a public SaaS-style site with an admin dashboard and an Express/MongoDB backend. The user-facing flow spans public pages and sign-in, then dashboard views for products, orders, inventory, users, and account settings; backend routes protect product and order operations and controllers persist domain records. The sampled code confirms several UI compositions and backend dispatches. The frontend API client’s server target and several unsampled dashboard integrations are not shown, so those connections are left unverified.

Main entry points: [`app/dashboard/settings/page.tsx`](https://github.com/vidhiu/mern_app_docker/blob/main/app/dashboard/settings/page.tsx) (Account settings), [`components/AuthModal.tsx`](https://github.com/vidhiu/mern_app_docker/blob/main/components/AuthModal.tsx) (Auth modal), [`backend/routes/productRoutes.js`](https://github.com/vidhiu/mern_app_docker/blob/main/backend/routes/productRoutes.js) (Product routes), [`lib/api.ts`](https://github.com/vidhiu/mern_app_docker/blob/main/lib/api.ts) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public site"]
  node_home["Home page<br/>[page.tsx]"]
  node_features["Features page<br/>[page.tsx]"]
  node_about["About page<br/>[page.tsx]"]
  node_contact["Contact page<br/>[page.tsx]"]
  node_hero["Hero content<br/>[Hero.tsx]"]
  node_featurecontent["Feature content<br/>[Features.tsx]"]
  node_aboutcontent["About content<br/>[About.tsx]"]
  node_navbar["Navigation<br/>[Navbar.tsx]"]
  node_footer["Footer<br/>[Footer.tsx]"]
end

subgraph group_identity["Authentication"]
  node_authmodal["Auth modal<br/>[AuthModal.tsx]"]
  node_login["Login form<br/>[LoginForm.tsx]"]
  node_signup["Signup form<br/>[SignupForm.tsx]"]
  node_userauth["Login endpoint<br/>[server.js]"]
  node_authmiddleware["Token middleware<br/>[authMiddleware.js]"]
end

subgraph group_dashboard["Dashboard"]
  node_api["API client<br/>[api.ts]"]
  node_overview["Dashboard overview<br/>[page.tsx]"]
  node_productsui["Product management<br/>[page.tsx]"]
  node_producttable["Product table<br/>[ProductTable.tsx]"]
  node_addproduct["Add product"]
  node_editproduct["Edit product"]
  node_ordersui["Order management<br/>[ordersPage.tsx]"]
  node_inventory["Inventory management<br/>[InventoryTable.jsx]"]
  node_usersui["User management<br/>[page.tsx]"]
  node_usertable["User table<br/>[UserTable.tsx]"]
  node_adduser["Add user<br/>[AddUserModal.tsx]"]
  node_settings["Account settings<br/>[page.tsx]"]
  node_profile["Profile view<br/>[ProfileView.tsx]"]
  node_editprofile["Edit profile"]
  node_changepassword["Change password"]
end

subgraph group_domain["Backend domain"]
  node_productroutes["Product routes<br/>[productRoutes.js]"]
  node_productcontroller["Product operations"]
  node_productmodel[("Product records<br/>[Product.js]")]
end

subgraph group_platform["Backend platform"]
  node_server["Express server<br/>[server.js]"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_home
node_visitor -->|"opens"| node_features
node_visitor -->|"opens"| node_about
node_home -->|"renders"| node_hero
node_features -->|"renders"| node_featurecontent
node_about -->|"renders"| node_aboutcontent
node_visitor -->|"opens"| node_contact
node_navbar -.->|"opens"| node_authmodal
node_authmodal -->|"renders"| node_login
node_authmodal -->|"renders"| node_signup
node_login -.->|"submits to"| node_userauth
node_userauth -->|"served by"| node_server
node_server -->|"mounts"| node_productroutes
node_productroutes -->|"guards"| node_authmiddleware
node_productroutes -->|"dispatches"| node_productcontroller
node_productcontroller -->|"queries"| node_productmodel
node_overview -->|"fetches counts"| node_api
node_ordersui -->|"uses"| node_api
node_api -.->|"requests"| node_server
node_productsui -->|"renders"| node_producttable
node_productsui -->|"opens"| node_addproduct
node_producttable -->|"renders"| node_editproduct
node_usersui -->|"renders"| node_usertable
node_usersui -->|"opens"| node_adduser
node_settings -->|"renders"| node_profile
node_settings -->|"renders"| node_editprofile
node_settings -->|"renders"| node_changepassword

click node_home "https://github.com/vidhiu/mern_app_docker/blob/main/app/(public)/page.tsx"
click node_features "https://github.com/vidhiu/mern_app_docker/blob/main/app/(public)/features/page.tsx"
click node_about "https://github.com/vidhiu/mern_app_docker/blob/main/app/(public)/about/page.tsx"
click node_contact "https://github.com/vidhiu/mern_app_docker/blob/main/app/(public)/contact/page.tsx"
click node_hero "https://github.com/vidhiu/mern_app_docker/blob/main/components/Hero.tsx"
click node_featurecontent "https://github.com/vidhiu/mern_app_docker/blob/main/components/Features.tsx"
click node_aboutcontent "https://github.com/vidhiu/mern_app_docker/blob/main/components/About.tsx"
click node_navbar "https://github.com/vidhiu/mern_app_docker/blob/main/components/Navbar.tsx"
click node_footer "https://github.com/vidhiu/mern_app_docker/blob/main/components/Footer.tsx"
click node_authmodal "https://github.com/vidhiu/mern_app_docker/blob/main/components/AuthModal.tsx"
click node_login "https://github.com/vidhiu/mern_app_docker/blob/main/components/LoginForm.tsx"
click node_signup "https://github.com/vidhiu/mern_app_docker/blob/main/components/SignupForm.tsx"
click node_server "https://github.com/vidhiu/mern_app_docker/blob/main/backend/server.js"
click node_userauth "https://github.com/vidhiu/mern_app_docker/blob/main/backend/server.js"
click node_authmiddleware "https://github.com/vidhiu/mern_app_docker/blob/main/backend/middleware/authMiddleware.js"
click node_api "https://github.com/vidhiu/mern_app_docker/blob/main/lib/api.ts"
click node_overview "https://github.com/vidhiu/mern_app_docker/blob/main/app/dashboard/page.tsx"
click node_productsui "https://github.com/vidhiu/mern_app_docker/blob/main/app/dashboard/products/page.tsx"
click node_producttable "https://github.com/vidhiu/mern_app_docker/blob/main/app/dashboard/products/ProductTable.tsx"
click node_addproduct "https://github.com/vidhiu/mern_app_docker/blob/main/app/dashboard/products/AddProductModal.tsx"
click node_editproduct "https://github.com/vidhiu/mern_app_docker/blob/main/app/dashboard/products/EditProductModal.tsx"
click node_ordersui "https://github.com/vidhiu/mern_app_docker/blob/main/app/dashboard/orders/ordersPage.tsx"
click node_inventory "https://github.com/vidhiu/mern_app_docker/blob/main/app/dashboard/inventory/InventoryTable.jsx"
click node_usersui "https://github.com/vidhiu/mern_app_docker/blob/main/app/dashboard/users/page.tsx"
click node_usertable "https://github.com/vidhiu/mern_app_docker/blob/main/app/dashboard/users/UserTable.tsx"
click node_adduser "https://github.com/vidhiu/mern_app_docker/blob/main/app/dashboard/users/AddUserModal.tsx"
click node_settings "https://github.com/vidhiu/mern_app_docker/blob/main/app/dashboard/settings/page.tsx"
click node_profile "https://github.com/vidhiu/mern_app_docker/blob/main/components/dashboard/settings/ProfileView.tsx"
click node_editprofile "https://github.com/vidhiu/mern_app_docker/blob/main/components/dashboard/settings/EditProfileForm.tsx"
click node_changepassword "https://github.com/vidhiu/mern_app_docker/blob/main/components/dashboard/settings/ChangePasswordForm.tsx"
click node_productroutes "https://github.com/vidhiu/mern_app_docker/blob/main/backend/routes/productRoutes.js"
click node_productcontroller "https://github.com/vidhiu/mern_app_docker/blob/main/backend/controllers/productController.js"
click node_productmodel "https://github.com/vidhiu/mern_app_docker/blob/main/backend/models/Product.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_home,node_features,node_about,node_contact,node_hero,node_featurecontent,node_aboutcontent,node_navbar,node_footer toneBlue
class node_authmodal,node_login,node_signup,node_userauth,node_authmiddleware toneAmber
class node_api,node_overview,node_productsui,node_producttable,node_addproduct,node_editproduct,node_ordersui,node_inventory,node_usersui,node_usertable,node_adduser,node_settings,node_profile,node_editprofile,node_changepassword toneMint
class node_productroutes,node_productcontroller,node_productmodel toneRose
class node_server,node_visitor toneIndigo
```

## Components

### Public site

- [Home page](https://github.com/vidhiu/mern_app_docker/blob/main/app/(public)/page.tsx): `app/(public)/page.tsx`
- [Features page](https://github.com/vidhiu/mern_app_docker/blob/main/app/(public)/features/page.tsx): `app/(public)/features/page.tsx`
- [About page](https://github.com/vidhiu/mern_app_docker/blob/main/app/(public)/about/page.tsx): `app/(public)/about/page.tsx`
- [Contact page](https://github.com/vidhiu/mern_app_docker/blob/main/app/(public)/contact/page.tsx): `app/(public)/contact/page.tsx`
- [Hero content](https://github.com/vidhiu/mern_app_docker/blob/main/components/Hero.tsx): `components/Hero.tsx`
- [Feature content](https://github.com/vidhiu/mern_app_docker/blob/main/components/Features.tsx): `components/Features.tsx`
- [About content](https://github.com/vidhiu/mern_app_docker/blob/main/components/About.tsx): `components/About.tsx`
- [Navigation](https://github.com/vidhiu/mern_app_docker/blob/main/components/Navbar.tsx): `components/Navbar.tsx`
- [Footer](https://github.com/vidhiu/mern_app_docker/blob/main/components/Footer.tsx): `components/Footer.tsx`

### Authentication

- [Auth modal](https://github.com/vidhiu/mern_app_docker/blob/main/components/AuthModal.tsx): `components/AuthModal.tsx`
- [Login form](https://github.com/vidhiu/mern_app_docker/blob/main/components/LoginForm.tsx): `components/LoginForm.tsx`
- [Signup form](https://github.com/vidhiu/mern_app_docker/blob/main/components/SignupForm.tsx): `components/SignupForm.tsx`
- [Login endpoint](https://github.com/vidhiu/mern_app_docker/blob/main/backend/server.js): `backend/server.js`
- [Token middleware](https://github.com/vidhiu/mern_app_docker/blob/main/backend/middleware/authMiddleware.js): `backend/middleware/authMiddleware.js`

### Dashboard

- [API client](https://github.com/vidhiu/mern_app_docker/blob/main/lib/api.ts): `lib/api.ts`
- [Dashboard overview](https://github.com/vidhiu/mern_app_docker/blob/main/app/dashboard/page.tsx): `app/dashboard/page.tsx`
- [Product management](https://github.com/vidhiu/mern_app_docker/blob/main/app/dashboard/products/page.tsx): `app/dashboard/products/page.tsx`
- [Product table](https://github.com/vidhiu/mern_app_docker/blob/main/app/dashboard/products/ProductTable.tsx): `app/dashboard/products/ProductTable.tsx`
- [Add product](https://github.com/vidhiu/mern_app_docker/blob/main/app/dashboard/products/AddProductModal.tsx): `app/dashboard/products/AddProductModal.tsx`
- [Edit product](https://github.com/vidhiu/mern_app_docker/blob/main/app/dashboard/products/EditProductModal.tsx): `app/dashboard/products/EditProductModal.tsx`
- [Order management](https://github.com/vidhiu/mern_app_docker/blob/main/app/dashboard/orders/ordersPage.tsx): `app/dashboard/orders/ordersPage.tsx`
- [Inventory management](https://github.com/vidhiu/mern_app_docker/blob/main/app/dashboard/inventory/InventoryTable.jsx): `app/dashboard/inventory/InventoryTable.jsx`
- [User management](https://github.com/vidhiu/mern_app_docker/blob/main/app/dashboard/users/page.tsx): `app/dashboard/users/page.tsx`
- [User table](https://github.com/vidhiu/mern_app_docker/blob/main/app/dashboard/users/UserTable.tsx): `app/dashboard/users/UserTable.tsx`
- [Add user](https://github.com/vidhiu/mern_app_docker/blob/main/app/dashboard/users/AddUserModal.tsx): `app/dashboard/users/AddUserModal.tsx`
- [Account settings](https://github.com/vidhiu/mern_app_docker/blob/main/app/dashboard/settings/page.tsx): `app/dashboard/settings/page.tsx`
- [Profile view](https://github.com/vidhiu/mern_app_docker/blob/main/components/dashboard/settings/ProfileView.tsx): `components/dashboard/settings/ProfileView.tsx`
- [Edit profile](https://github.com/vidhiu/mern_app_docker/blob/main/components/dashboard/settings/EditProfileForm.tsx): `components/dashboard/settings/EditProfileForm.tsx`
- [Change password](https://github.com/vidhiu/mern_app_docker/blob/main/components/dashboard/settings/ChangePasswordForm.tsx): `components/dashboard/settings/ChangePasswordForm.tsx`

### Backend domain

- [Product routes](https://github.com/vidhiu/mern_app_docker/blob/main/backend/routes/productRoutes.js): `backend/routes/productRoutes.js`
- [Product operations](https://github.com/vidhiu/mern_app_docker/blob/main/backend/controllers/productController.js): `backend/controllers/productController.js`
- [Product records](https://github.com/vidhiu/mern_app_docker/blob/main/backend/models/Product.js): `backend/models/Product.js`

### Backend platform

- [Express server](https://github.com/vidhiu/mern_app_docker/blob/main/backend/server.js): `backend/server.js`

### Other components

- **Visitor**

## Connections

- Visitor → Home page: opens (evidence: `README.md`)
- Visitor → Features page: opens (evidence: `README.md`)
- Visitor → About page: opens (evidence: `README.md`)
- Home page → Hero content: renders (evidence: `app/(public)/page.tsx`)
- Features page → Feature content: renders (evidence: `app/(public)/features/page.tsx`)
- About page → About content: renders (evidence: `app/(public)/about/page.tsx`)
- Visitor → Contact page: opens (evidence: `README.md`)
- Navigation → Auth modal: opens
- Auth modal → Login form: renders (evidence: `components/AuthModal.tsx`)
- Auth modal → Signup form: renders (evidence: `components/AuthModal.tsx`)
- Login form → Login endpoint: submits to
- Login endpoint → Express server: served by (evidence: `backend/server.js`)
- Express server → Product routes: mounts (evidence: `backend/server.js`)
- Product routes → Token middleware: guards (evidence: `backend/routes/productRoutes.js`)
- Product routes → Product operations: dispatches (evidence: `backend/routes/productRoutes.js`)
- Product operations → Product records: queries (evidence: `backend/controllers/productController.js`)
- Dashboard overview → API client: fetches counts (evidence: `app/dashboard/page.tsx`)
- Order management → API client: uses (evidence: `app/dashboard/orders/ordersPage.tsx`)
- API client → Express server: requests
- Product management → Product table: renders (evidence: `app/dashboard/products/page.tsx`)
- Product management → Add product: opens (evidence: `app/dashboard/products/page.tsx`)
- Product table → Edit product: renders (evidence: `app/dashboard/products/ProductTable.tsx`)
- User management → User table: renders (evidence: `app/dashboard/users/page.tsx`)
- User management → Add user: opens (evidence: `app/dashboard/users/page.tsx`)
- Account settings → Profile view: renders (evidence: `app/dashboard/settings/page.tsx`)
- Account settings → Edit profile: renders (evidence: `app/dashboard/settings/page.tsx`)
- Account settings → Change password: renders (evidence: `app/dashboard/settings/page.tsx`)
