# linnovate/mean architecture

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

- Interactive diagram: https://gitdiagram.com/linnovate/mean
- Repository: https://github.com/linnovate/mean

## Overview

This is a MEAN-stack starter application with an Angular client and an Express/Node API backed by MongoDB. The principal workflow is account registration or login: the client submits credentials, the API validates and stores a user or authenticates an existing one, then returns a JWT and user data for client-side session state. The graph also includes the documented admin and home areas, shared HTTP plumbing, and user persistence. Some connections are limited to the source index or README, so unsampled details are not inferred.

Main entry points: [`src/app/shared/services/auth/auth.service.ts`](https://github.com/linnovate/mean/blob/master/src/app/shared/services/auth/auth.service.ts) (Auth client), [`server/routes/auth.route.js`](https://github.com/linnovate/mean/blob/master/server/routes/auth.route.js) (Auth endpoints), [`src/app/app-routing.module.ts`](https://github.com/linnovate/mean/blob/master/src/app/app-routing.module.ts) (App routes), [`src/app/auth/auth-routing.module.ts`](https://github.com/linnovate/mean/blob/master/src/app/auth/auth-routing.module.ts) (Auth routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Angular client"]
  node_app_shell["App shell<br/>[app.component.ts]"]
  node_app_routes["App routes"]
  node_home["Home view<br/>[home.component.ts]"]
  node_admin["Admin view<br/>[admin.component.ts]"]
  node_admin_guard["Admin guard"]
  node_http_layer["HTTP interceptors"]
end

subgraph group_session["Authentication"]
  node_auth_routes["Auth routes"]
  node_login["Login form<br/>[login.component.ts]"]
  node_register["Registration form"]
  node_auth_service["Auth client<br/>[auth.service.ts]"]
  node_token_storage[("Token storage<br/>[token.storage.ts]")]
end

subgraph group_api["Express API"]
  node_api_app["Express app<br/>[express.js]"]
  node_api_routes["API routes<br/>[index.route.js]"]
  node_auth_api["Auth endpoints<br/>[auth.route.js]"]
  node_auth_controller["JWT issuer<br/>[auth.controller.js]"]
  node_user_api["User endpoints<br/>[user.route.js]"]
end

subgraph group_data["User data"]
  node_user_controller["User creation<br/>[user.controller.js]"]
  node_user_model["User model<br/>[user.model.js]"]
  node_mongodb[("MongoDB")]
end

node_browser(("User browser"))

node_browser -->|"uses"| node_app_shell
node_app_routes -->|"routes to"| node_home
node_app_routes -->|"routes to"| node_auth_routes
node_app_routes -->|"routes to"| node_admin
node_auth_routes -->|"routes to"| node_login
node_auth_routes -->|"routes to"| node_register
node_admin_guard -->|"guards access"| node_admin
node_app_shell -->|"loads session"| node_auth_service
node_login -.->|"submits credentials"| node_auth_service
node_register -.->|"submits account"| node_auth_service
node_auth_service -->|"stores token"| node_token_storage
node_auth_service -->|"calls auth API"| node_auth_api
node_api_app -->|"mounts API"| node_api_routes
node_api_routes -->|"dispatches to"| node_auth_api
node_api_routes -->|"dispatches to"| node_user_api
node_auth_api -->|"creates user"| node_user_controller
node_auth_api -->|"issues token"| node_auth_controller
node_user_api -->|"dispatches to"| node_user_controller
node_user_controller -->|"saves user"| node_user_model
node_user_model -->|"persists documents"| node_mongodb

click node_app_shell "https://github.com/linnovate/mean/blob/master/src/app/app.component.ts"
click node_app_routes "https://github.com/linnovate/mean/blob/master/src/app/app-routing.module.ts"
click node_home "https://github.com/linnovate/mean/blob/master/src/app/home/home.component.ts"
click node_admin "https://github.com/linnovate/mean/blob/master/src/app/admin/admin.component.ts"
click node_admin_guard "https://github.com/linnovate/mean/blob/master/src/app/admin/admin-user-guard.ts"
click node_auth_routes "https://github.com/linnovate/mean/blob/master/src/app/auth/auth-routing.module.ts"
click node_login "https://github.com/linnovate/mean/blob/master/src/app/auth/login/login.component.ts"
click node_register "https://github.com/linnovate/mean/blob/master/src/app/auth/register/register.component.ts"
click node_auth_service "https://github.com/linnovate/mean/blob/master/src/app/shared/services/auth/auth.service.ts"
click node_token_storage "https://github.com/linnovate/mean/blob/master/src/app/shared/services/auth/token.storage.ts"
click node_http_layer "https://github.com/linnovate/mean/blob/master/src/app/interceptors/header.interceptor.ts"
click node_api_app "https://github.com/linnovate/mean/blob/master/server/config/express.js"
click node_api_routes "https://github.com/linnovate/mean/blob/master/server/routes/index.route.js"
click node_auth_api "https://github.com/linnovate/mean/blob/master/server/routes/auth.route.js"
click node_auth_controller "https://github.com/linnovate/mean/blob/master/server/controllers/auth.controller.js"
click node_user_api "https://github.com/linnovate/mean/blob/master/server/routes/user.route.js"
click node_user_controller "https://github.com/linnovate/mean/blob/master/server/controllers/user.controller.js"
click node_user_model "https://github.com/linnovate/mean/blob/master/server/models/user.model.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_app_shell,node_app_routes,node_home,node_admin,node_admin_guard,node_http_layer,node_browser toneBlue
class node_auth_routes,node_login,node_register,node_auth_service,node_token_storage toneAmber
class node_api_app,node_api_routes,node_auth_api,node_auth_controller,node_user_api toneMint
class node_user_controller,node_user_model,node_mongodb toneRose
```

## Components

### Angular client

- [App shell](https://github.com/linnovate/mean/blob/master/src/app/app.component.ts): `src/app/app.component.ts`
- [App routes](https://github.com/linnovate/mean/blob/master/src/app/app-routing.module.ts): `src/app/app-routing.module.ts`
- [Home view](https://github.com/linnovate/mean/blob/master/src/app/home/home.component.ts): `src/app/home/home.component.ts`
- [Admin view](https://github.com/linnovate/mean/blob/master/src/app/admin/admin.component.ts): `src/app/admin/admin.component.ts`
- [Admin guard](https://github.com/linnovate/mean/blob/master/src/app/admin/admin-user-guard.ts): `src/app/admin/admin-user-guard.ts`
- [HTTP interceptors](https://github.com/linnovate/mean/blob/master/src/app/interceptors/header.interceptor.ts): `src/app/interceptors/header.interceptor.ts`

### Authentication

- [Auth routes](https://github.com/linnovate/mean/blob/master/src/app/auth/auth-routing.module.ts): `src/app/auth/auth-routing.module.ts`
- [Login form](https://github.com/linnovate/mean/blob/master/src/app/auth/login/login.component.ts): `src/app/auth/login/login.component.ts`
- [Registration form](https://github.com/linnovate/mean/blob/master/src/app/auth/register/register.component.ts): `src/app/auth/register/register.component.ts`
- [Auth client](https://github.com/linnovate/mean/blob/master/src/app/shared/services/auth/auth.service.ts): `src/app/shared/services/auth/auth.service.ts`
- [Token storage](https://github.com/linnovate/mean/blob/master/src/app/shared/services/auth/token.storage.ts): `src/app/shared/services/auth/token.storage.ts`

### Express API

- [Express app](https://github.com/linnovate/mean/blob/master/server/config/express.js): `server/config/express.js`
- [API routes](https://github.com/linnovate/mean/blob/master/server/routes/index.route.js): `server/routes/index.route.js`
- [Auth endpoints](https://github.com/linnovate/mean/blob/master/server/routes/auth.route.js): `server/routes/auth.route.js`
- [JWT issuer](https://github.com/linnovate/mean/blob/master/server/controllers/auth.controller.js): `server/controllers/auth.controller.js`
- [User endpoints](https://github.com/linnovate/mean/blob/master/server/routes/user.route.js): `server/routes/user.route.js`

### User data

- [User creation](https://github.com/linnovate/mean/blob/master/server/controllers/user.controller.js): `server/controllers/user.controller.js`
- [User model](https://github.com/linnovate/mean/blob/master/server/models/user.model.js): `server/models/user.model.js`
- **MongoDB**

### Other components

- **User browser**

## Connections

- User browser → App shell: uses
- App routes → Home view: routes to (evidence: `src/app/app-routing.module.ts`)
- App routes → Auth routes: routes to (evidence: `src/app/app-routing.module.ts`)
- App routes → Admin view: routes to (evidence: `src/app/app-routing.module.ts`)
- Auth routes → Login form: routes to (evidence: `src/app/auth/auth-routing.module.ts`)
- Auth routes → Registration form: routes to (evidence: `src/app/auth/auth-routing.module.ts`)
- Admin guard → Admin view: guards access (evidence: `src/app/admin/admin-routing.module.ts`)
- App shell → Auth client: loads session (evidence: `src/app/app.component.ts`)
- Login form → Auth client: submits credentials
- Registration form → Auth client: submits account
- Auth client → Token storage: stores token (evidence: `src/app/shared/services/auth/auth.service.ts`)
- Auth client → Auth endpoints: calls auth API (evidence: `src/app/shared/services/auth/auth.service.ts`)
- Express app → API routes: mounts API (evidence: `server/config/express.js`)
- API routes → Auth endpoints: dispatches to (evidence: `server/routes/index.route.js`)
- API routes → User endpoints: dispatches to (evidence: `server/routes/index.route.js`)
- Auth endpoints → User creation: creates user (evidence: `server/routes/auth.route.js`)
- Auth endpoints → JWT issuer: issues token (evidence: `server/routes/auth.route.js`)
- User endpoints → User creation: dispatches to (evidence: `server/routes/user.route.js`)
- User creation → User model: saves user (evidence: `server/controllers/user.controller.js`)
- User model → MongoDB: persists documents
