# getmilan4/servicepro architecture

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

- Interactive diagram: https://gitdiagram.com/getmilan4/servicepro
- Repository: https://github.com/getmilan4/servicepro

## Overview

Whimstack is a role-based internal portal with sign-in, dashboards, user administration, and navigation to customer, application, loan-pipeline, and resource areas. The visible workflow is login form → server action → Oracle-backed authentication and role routing → dashboard; administrators can then view platform statistics and manage users. The sampled code also documents optional WhimReward provisioning during user creation. Several feature pages are indexed but not excerpted, so their internal behavior and connections are not inferred.

Main entry points: [`lib/db.ts`](https://github.com/getmilan4/servicepro/blob/main/lib/db.ts) (Oracle connection pool), [`app/admin/users/actions.ts`](https://github.com/getmilan4/servicepro/blob/main/app/admin/users/actions.ts) (User mutations), [`app/admin/users/page.tsx`](https://github.com/getmilan4/servicepro/blob/main/app/admin/users/page.tsx) (User management page), [`components/Sidebar.tsx`](https://github.com/getmilan4/servicepro/blob/main/components/Sidebar.tsx) (Role-based sidebar)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and navigation"]
  node_login_ui["Sign-in form<br/>[page.tsx]"]
  node_login_actions["Login actions<br/>[actions.ts]"]
  node_auth["Session authentication<br/>[auth.ts]"]
  node_role_routing["Role routing<br/>[role-routing.ts]"]
  node_shell["Client shell<br/>[ClientShell.tsx]"]
  node_sidebar["Role-based sidebar<br/>[Sidebar.tsx]"]
  node_navigation["Navigation rules<br/>[navigation.ts]"]
  node_logout["Logout action<br/>[logout.ts]"]
  node_logo["Brand logo<br/>[WhimstackLogo.tsx]"]
end

subgraph group_admin["Administration"]
  node_admin_dashboard["Admin overview<br/>[page.tsx]"]
  node_user_page["User management page<br/>[page.tsx]"]
  node_user_actions["User mutations<br/>[actions.ts]"]
  node_user_form["User creation form<br/>[CreateUserForm.tsx]"]
  node_user_table["User table<br/>[UserTable.tsx]"]
end

subgraph group_workspace["Portal areas"]
  node_dashboard["Role dashboard<br/>[page.tsx]"]
  node_customers["Customer area<br/>[page.tsx]"]
  node_applications["Applications area<br/>[page.tsx]"]
  node_pipeline["Loan pipeline<br/>[page.tsx]"]
  node_resources["Resource center"]
end

subgraph group_data["Data and integrations"]
  node_oracle_pool["Oracle connection pool<br/>[db.ts]"]
  node_oracle[("Oracle database")]
  node_whimreward["WhimReward API"]
end

node_visitor(("Portal user"))

node_visitor -->|"signs in"| node_login_ui
node_login_ui -->|"submits credentials"| node_login_actions
node_login_actions -->|"queries users"| node_oracle_pool
node_login_actions -->|"routes by role"| node_role_routing
node_shell -->|"renders"| node_sidebar
node_sidebar -->|"gets visible links"| node_navigation
node_sidebar -->|"selects dashboard"| node_role_routing
node_sidebar -->|"invokes"| node_logout
node_sidebar -->|"renders"| node_logo
node_dashboard -->|"requires user"| node_auth
node_dashboard -->|"routes by role"| node_role_routing
node_auth -->|"checks session"| node_oracle_pool
node_admin_dashboard -->|"requires user"| node_auth
node_admin_dashboard -->|"queries statistics"| node_oracle_pool
node_user_page -->|"requires user"| node_auth
node_user_page -->|"loads users"| node_oracle_pool
node_user_page -->|"imports actions"| node_user_actions
node_user_page -->|"renders"| node_user_form
node_user_page -->|"renders"| node_user_table
node_user_form -->|"submits to"| node_user_actions
node_user_table -->|"uses actions"| node_user_actions
node_user_actions -->|"requires admin"| node_auth
node_user_actions -->|"writes users"| node_oracle_pool
node_user_actions -.->|"provisions account"| node_whimreward
node_oracle_pool -->|"opens connections"| node_oracle
node_logout -->|"updates session"| node_oracle_pool

click node_login_ui "https://github.com/getmilan4/servicepro/blob/main/app/login/page.tsx"
click node_login_actions "https://github.com/getmilan4/servicepro/blob/main/app/login/actions.ts"
click node_auth "https://github.com/getmilan4/servicepro/blob/main/lib/auth.ts"
click node_role_routing "https://github.com/getmilan4/servicepro/blob/main/lib/role-routing.ts"
click node_shell "https://github.com/getmilan4/servicepro/blob/main/app/ClientShell.tsx"
click node_sidebar "https://github.com/getmilan4/servicepro/blob/main/components/Sidebar.tsx"
click node_navigation "https://github.com/getmilan4/servicepro/blob/main/lib/navigation.ts"
click node_logout "https://github.com/getmilan4/servicepro/blob/main/app/logout.ts"
click node_logo "https://github.com/getmilan4/servicepro/blob/main/components/WhimstackLogo.tsx"
click node_dashboard "https://github.com/getmilan4/servicepro/blob/main/app/dashboard/page.tsx"
click node_admin_dashboard "https://github.com/getmilan4/servicepro/blob/main/app/admin/page.tsx"
click node_user_page "https://github.com/getmilan4/servicepro/blob/main/app/admin/users/page.tsx"
click node_user_actions "https://github.com/getmilan4/servicepro/blob/main/app/admin/users/actions.ts"
click node_user_form "https://github.com/getmilan4/servicepro/blob/main/app/admin/users/CreateUserForm.tsx"
click node_user_table "https://github.com/getmilan4/servicepro/blob/main/app/admin/users/UserTable.tsx"
click node_customers "https://github.com/getmilan4/servicepro/blob/main/app/customers/page.tsx"
click node_applications "https://github.com/getmilan4/servicepro/blob/main/app/applications/page.tsx"
click node_pipeline "https://github.com/getmilan4/servicepro/blob/main/app/pipeline/page.tsx"
click node_resources "https://github.com/getmilan4/servicepro/tree/main/app/resources"
click node_oracle_pool "https://github.com/getmilan4/servicepro/blob/main/lib/db.ts"

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_login_ui,node_login_actions,node_auth,node_role_routing,node_shell,node_sidebar,node_navigation,node_logout,node_logo,node_visitor toneBlue
class node_admin_dashboard,node_user_page,node_user_actions,node_user_form,node_user_table toneAmber
class node_dashboard,node_customers,node_applications,node_pipeline,node_resources toneMint
class node_oracle_pool,node_oracle,node_whimreward toneRose
```

## Components

### Access and navigation

- [Sign-in form](https://github.com/getmilan4/servicepro/blob/main/app/login/page.tsx): `app/login/page.tsx`
- [Login actions](https://github.com/getmilan4/servicepro/blob/main/app/login/actions.ts): `app/login/actions.ts`
- [Session authentication](https://github.com/getmilan4/servicepro/blob/main/lib/auth.ts): `lib/auth.ts`
- [Role routing](https://github.com/getmilan4/servicepro/blob/main/lib/role-routing.ts): `lib/role-routing.ts`
- [Client shell](https://github.com/getmilan4/servicepro/blob/main/app/ClientShell.tsx): `app/ClientShell.tsx`
- [Role-based sidebar](https://github.com/getmilan4/servicepro/blob/main/components/Sidebar.tsx): `components/Sidebar.tsx`
- [Navigation rules](https://github.com/getmilan4/servicepro/blob/main/lib/navigation.ts): `lib/navigation.ts`
- [Logout action](https://github.com/getmilan4/servicepro/blob/main/app/logout.ts): `app/logout.ts`
- [Brand logo](https://github.com/getmilan4/servicepro/blob/main/components/WhimstackLogo.tsx): `components/WhimstackLogo.tsx`

### Administration

- [Admin overview](https://github.com/getmilan4/servicepro/blob/main/app/admin/page.tsx): `app/admin/page.tsx`
- [User management page](https://github.com/getmilan4/servicepro/blob/main/app/admin/users/page.tsx): `app/admin/users/page.tsx`
- [User mutations](https://github.com/getmilan4/servicepro/blob/main/app/admin/users/actions.ts): `app/admin/users/actions.ts`
- [User creation form](https://github.com/getmilan4/servicepro/blob/main/app/admin/users/CreateUserForm.tsx): `app/admin/users/CreateUserForm.tsx`
- [User table](https://github.com/getmilan4/servicepro/blob/main/app/admin/users/UserTable.tsx): `app/admin/users/UserTable.tsx`

### Portal areas

- [Role dashboard](https://github.com/getmilan4/servicepro/blob/main/app/dashboard/page.tsx): `app/dashboard/page.tsx`
- [Customer area](https://github.com/getmilan4/servicepro/blob/main/app/customers/page.tsx): `app/customers/page.tsx`
- [Applications area](https://github.com/getmilan4/servicepro/blob/main/app/applications/page.tsx): `app/applications/page.tsx`
- [Loan pipeline](https://github.com/getmilan4/servicepro/blob/main/app/pipeline/page.tsx): `app/pipeline/page.tsx`
- [Resource center](https://github.com/getmilan4/servicepro/tree/main/app/resources): `app/resources`

### Data and integrations

- [Oracle connection pool](https://github.com/getmilan4/servicepro/blob/main/lib/db.ts): `lib/db.ts`
- **Oracle database**
- **WhimReward API**

### Other components

- **Portal user**

## Connections

- Portal user → Sign-in form: signs in (evidence: `app/login/page.tsx`)
- Sign-in form → Login actions: submits credentials (evidence: `app/login/page.tsx`)
- Login actions → Oracle connection pool: queries users (evidence: `app/login/actions.ts`)
- Login actions → Role routing: routes by role (evidence: `app/login/actions.ts`)
- Client shell → Role-based sidebar: renders (evidence: `app/ClientShell.tsx`)
- Role-based sidebar → Navigation rules: gets visible links (evidence: `components/Sidebar.tsx`)
- Role-based sidebar → Role routing: selects dashboard (evidence: `components/Sidebar.tsx`)
- Role-based sidebar → Logout action: invokes (evidence: `components/Sidebar.tsx`)
- Role-based sidebar → Brand logo: renders (evidence: `components/Sidebar.tsx`)
- Role dashboard → Session authentication: requires user (evidence: `app/dashboard/page.tsx`)
- Role dashboard → Role routing: routes by role (evidence: `app/dashboard/page.tsx`)
- Session authentication → Oracle connection pool: checks session (evidence: `lib/auth.ts`)
- Admin overview → Session authentication: requires user (evidence: `app/admin/page.tsx`)
- Admin overview → Oracle connection pool: queries statistics (evidence: `app/admin/page.tsx`)
- User management page → Session authentication: requires user (evidence: `app/admin/users/page.tsx`)
- User management page → Oracle connection pool: loads users (evidence: `app/admin/users/page.tsx`)
- User management page → User mutations: imports actions (evidence: `app/admin/users/page.tsx`)
- User management page → User creation form: renders (evidence: `app/admin/users/page.tsx`)
- User management page → User table: renders (evidence: `app/admin/users/page.tsx`)
- User creation form → User mutations: submits to (evidence: `app/admin/users/CreateUserForm.tsx`)
- User table → User mutations: uses actions (evidence: `app/admin/users/UserTable.tsx`)
- User mutations → Session authentication: requires admin (evidence: `app/admin/users/actions.ts`)
- User mutations → Oracle connection pool: writes users (evidence: `app/admin/users/actions.ts`)
- User mutations → WhimReward API: provisions account (evidence: `app/admin/users/actions.ts`)
- Oracle connection pool → Oracle database: opens connections (evidence: `lib/db.ts`)
- Logout action → Oracle connection pool: updates session (evidence: `app/logout.ts`)
