# rajbhokare/e-commerce-group-project architecture

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

- Interactive diagram: https://gitdiagram.com/rajbhokare/e-commerce-group-project
- Repository: https://github.com/rajbhokare/e-commerce-group-project

## Overview

This is a small Express-based RiskMonitor dashboard project presented as an e-commerce group project. The main workflow is an administrator submitting login credentials, receiving a session on success, and viewing a session-protected dashboard populated with hardcoded sample metrics and alerts. The app configures sessions and serves the EJS interface and static assets; separate route modules dispatch login and dashboard requests to their controllers. The README documents no further capabilities, and the UI templates and styles were not sampled, so their detailed behavior is uncertain.

Main entry points: [`app.js`](https://github.com/rajbhokare/e-commerce-group-project/blob/main/app.js) (Express app), [`routes/auth.js`](https://github.com/rajbhokare/e-commerce-group-project/blob/main/routes/auth.js) (Auth routes), [`controller/authController.js`](https://github.com/rajbhokare/e-commerce-group-project/blob/main/controller/authController.js) (Auth controller), [`routes/dashboard.js`](https://github.com/rajbhokare/e-commerce-group-project/blob/main/routes/dashboard.js) (Dashboard route)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_server["Web server"]
  node_app["Express app<br/>[app.js]"]
  node_session["Session middleware<br/>[app.js]"]
end

subgraph group_auth["Authentication"]
  node_auth_routes["Auth routes<br/>[auth.js]"]
  node_auth_controller["Auth controller<br/>[authController.js]"]
  node_login_view["Login view<br/>[index.ejs]"]
end

subgraph group_dashboard["Dashboard UI"]
  node_dashboard_routes["Dashboard route<br/>[dashboard.js]"]
  node_dashboard_controller["Dashboard controller"]
  node_dashboard_view["Dashboard view<br/>[dashboard.ejs]"]
  node_browser_js["Browser interactions<br/>[main.js]"]
  node_styles["Dashboard styles<br/>[style.css]"]
end

node_admin(("Administrator"))

node_app -->|"mounts routes"| node_auth_routes
node_app -->|"mounts routes"| node_dashboard_routes
node_app -->|"configures"| node_session
node_app -->|"serves static"| node_browser_js
node_app -->|"serves static"| node_styles
node_auth_routes -->|"dispatches to"| node_auth_controller
node_auth_controller -->|"renders"| node_login_view
node_dashboard_routes -->|"dispatches to"| node_dashboard_controller
node_dashboard_controller -->|"renders"| node_dashboard_view

click node_app "https://github.com/rajbhokare/e-commerce-group-project/blob/main/app.js"
click node_session "https://github.com/rajbhokare/e-commerce-group-project/blob/main/app.js"
click node_auth_routes "https://github.com/rajbhokare/e-commerce-group-project/blob/main/routes/auth.js"
click node_auth_controller "https://github.com/rajbhokare/e-commerce-group-project/blob/main/controller/authController.js"
click node_login_view "https://github.com/rajbhokare/e-commerce-group-project/blob/main/views/index.ejs"
click node_dashboard_routes "https://github.com/rajbhokare/e-commerce-group-project/blob/main/routes/dashboard.js"
click node_dashboard_controller "https://github.com/rajbhokare/e-commerce-group-project/blob/main/controller/dashboardcontroller.js"
click node_dashboard_view "https://github.com/rajbhokare/e-commerce-group-project/blob/main/views/dashboard.ejs"
click node_browser_js "https://github.com/rajbhokare/e-commerce-group-project/blob/main/public/js/main.js"
click node_styles "https://github.com/rajbhokare/e-commerce-group-project/blob/main/public/css/style.css"

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_session toneBlue
class node_auth_routes,node_auth_controller,node_login_view toneAmber
class node_dashboard_routes,node_dashboard_controller,node_dashboard_view,node_browser_js,node_styles toneMint
class node_admin toneIndigo
```

## Components

### Web server

- [Express app](https://github.com/rajbhokare/e-commerce-group-project/blob/main/app.js): `app.js`
- [Session middleware](https://github.com/rajbhokare/e-commerce-group-project/blob/main/app.js): `app.js`

### Authentication

- [Auth routes](https://github.com/rajbhokare/e-commerce-group-project/blob/main/routes/auth.js): `routes/auth.js`
- [Auth controller](https://github.com/rajbhokare/e-commerce-group-project/blob/main/controller/authController.js): `controller/authController.js`
- [Login view](https://github.com/rajbhokare/e-commerce-group-project/blob/main/views/index.ejs): `views/index.ejs`

### Dashboard UI

- [Dashboard route](https://github.com/rajbhokare/e-commerce-group-project/blob/main/routes/dashboard.js): `routes/dashboard.js`
- [Dashboard controller](https://github.com/rajbhokare/e-commerce-group-project/blob/main/controller/dashboardcontroller.js): `controller/dashboardcontroller.js`
- [Dashboard view](https://github.com/rajbhokare/e-commerce-group-project/blob/main/views/dashboard.ejs): `views/dashboard.ejs`
- [Browser interactions](https://github.com/rajbhokare/e-commerce-group-project/blob/main/public/js/main.js): `public/js/main.js`
- [Dashboard styles](https://github.com/rajbhokare/e-commerce-group-project/blob/main/public/css/style.css): `public/css/style.css`

### Other components

- **Administrator**

## Connections

- Express app → Auth routes: mounts routes (evidence: `app.js`)
- Express app → Dashboard route: mounts routes (evidence: `app.js`)
- Express app → Session middleware: configures (evidence: `app.js`)
- Express app → Browser interactions: serves static (evidence: `app.js`)
- Express app → Dashboard styles: serves static (evidence: `app.js`)
- Auth routes → Auth controller: dispatches to (evidence: `routes/auth.js`)
- Auth controller → Login view: renders (evidence: `controller/authController.js`)
- Dashboard route → Dashboard controller: dispatches to (evidence: `routes/dashboard.js`)
- Dashboard controller → Dashboard view: renders (evidence: `controller/dashboardcontroller.js`)
