# kargulstudio/sales-crm architecture

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

- Interactive diagram: https://gitdiagram.com/kargulstudio/sales-crm
- Repository: https://github.com/kargulstudio/sales-crm

## Overview

This repository is a Next.js sales-CRM starter/demo. Its main workflow is opening the Companies workspace, exploring and filtering company records, and using detail/profile views or the new-company form to work with pipeline data. The workspace also exposes search, notifications, and reporting-oriented interface elements. The graph follows documented and indexed module references; unsampled component internals and data flows are not assumed.

Main entry points: [`components/companies/companies.tsx`](https://github.com/kargulstudio/sales-crm/blob/main/components/companies/companies.tsx) (Companies workspace), [`stores/companies-store.ts`](https://github.com/kargulstudio/sales-crm/blob/main/stores/companies-store.ts) (Companies store), [`app/page.tsx`](https://github.com/kargulstudio/sales-crm/blob/main/app/page.tsx) (Home page), [`lib/seo.ts`](https://github.com/kargulstudio/sales-crm/blob/main/lib/seo.ts) (Site metadata)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_page["Home page<br/>[page.tsx]"]
end

subgraph group_crm["CRM workspace"]
  node_workspace["Companies workspace<br/>[companies.tsx]"]
  node_sidebar["Navigation sidebar<br/>[sidebar.tsx]"]
  node_toolbar["Filters and toolbar<br/>[toolbar.tsx]"]
  node_table["Company table"]
  node_detail["Company detail<br/>[company-detail.tsx]"]
  node_profile["Owner profile<br/>[profile.tsx]"]
  node_create["Create company"]
  node_command["Command menu<br/>[command-menu.tsx]"]
end

subgraph group_state["CRM state and domain"]
  node_store["Companies store<br/>[companies-store.ts]"]
  node_records[("Company records<br/>[companies.ts]")]
  node_logic["Company calculations<br/>[companies.ts]"]
  node_notifications[("Notification records<br/>[notifications.ts]")]
end

subgraph group_seo["Search metadata"]
  node_metadata["Site metadata<br/>[seo.ts]"]
  node_llms["LLMs route<br/>[route.ts]"]
  node_robots["Robots metadata<br/>[robots.ts]"]
  node_sitemap["Sitemap metadata<br/>[sitemap.ts]"]
end

node_user(("CRM user"))

node_user -->|"opens"| node_page
node_page -->|"renders"| node_workspace
node_page -->|"renders"| node_sidebar
node_workspace -->|"renders"| node_toolbar
node_workspace -->|"renders"| node_table
node_workspace -->|"renders"| node_detail
node_workspace -->|"renders"| node_profile
node_workspace -->|"renders"| node_create
node_workspace -->|"renders"| node_command
node_sidebar -->|"reads"| node_store
node_toolbar -->|"updates filters"| node_store
node_create -->|"adds company"| node_store
node_store -->|"initializes from"| node_records
node_store -->|"initializes from"| node_notifications
node_store -->|"uses defaults"| node_logic
node_page -->|"uses metadata"| node_metadata
node_llms -->|"reads routes"| node_metadata
node_robots -.->|"derives from"| node_metadata
node_sitemap -.->|"derives from"| node_metadata

click node_page "https://github.com/kargulstudio/sales-crm/blob/main/app/page.tsx"
click node_workspace "https://github.com/kargulstudio/sales-crm/blob/main/components/companies/companies.tsx"
click node_sidebar "https://github.com/kargulstudio/sales-crm/blob/main/components/_common/sidebar/sidebar.tsx"
click node_toolbar "https://github.com/kargulstudio/sales-crm/blob/main/components/companies/toolbar/toolbar.tsx"
click node_table "https://github.com/kargulstudio/sales-crm/blob/main/components/companies/table/companies-table.tsx"
click node_detail "https://github.com/kargulstudio/sales-crm/blob/main/components/companies/detail/company-detail.tsx"
click node_profile "https://github.com/kargulstudio/sales-crm/blob/main/components/companies/profile/profile.tsx"
click node_create "https://github.com/kargulstudio/sales-crm/blob/main/components/companies/new-company/new-company-dialog.tsx"
click node_command "https://github.com/kargulstudio/sales-crm/blob/main/components/companies/command-menu/command-menu.tsx"
click node_store "https://github.com/kargulstudio/sales-crm/blob/main/stores/companies-store.ts"
click node_records "https://github.com/kargulstudio/sales-crm/blob/main/data/companies.ts"
click node_logic "https://github.com/kargulstudio/sales-crm/blob/main/lib/companies.ts"
click node_notifications "https://github.com/kargulstudio/sales-crm/blob/main/data/notifications.ts"
click node_metadata "https://github.com/kargulstudio/sales-crm/blob/main/lib/seo.ts"
click node_llms "https://github.com/kargulstudio/sales-crm/blob/main/app/llms.txt/route.ts"
click node_robots "https://github.com/kargulstudio/sales-crm/blob/main/app/robots.ts"
click node_sitemap "https://github.com/kargulstudio/sales-crm/blob/main/app/sitemap.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_page,node_user toneBlue
class node_workspace,node_sidebar,node_toolbar,node_table,node_detail,node_profile,node_create,node_command toneAmber
class node_store,node_records,node_logic,node_notifications toneMint
class node_metadata,node_llms,node_robots,node_sitemap toneRose
```

## Components

### Application shell

- [Home page](https://github.com/kargulstudio/sales-crm/blob/main/app/page.tsx): `app/page.tsx`

### CRM workspace

- [Companies workspace](https://github.com/kargulstudio/sales-crm/blob/main/components/companies/companies.tsx): `components/companies/companies.tsx`
- [Navigation sidebar](https://github.com/kargulstudio/sales-crm/blob/main/components/_common/sidebar/sidebar.tsx): `components/_common/sidebar/sidebar.tsx`
- [Filters and toolbar](https://github.com/kargulstudio/sales-crm/blob/main/components/companies/toolbar/toolbar.tsx): `components/companies/toolbar/toolbar.tsx`
- [Company table](https://github.com/kargulstudio/sales-crm/blob/main/components/companies/table/companies-table.tsx): `components/companies/table/companies-table.tsx`
- [Company detail](https://github.com/kargulstudio/sales-crm/blob/main/components/companies/detail/company-detail.tsx): `components/companies/detail/company-detail.tsx`
- [Owner profile](https://github.com/kargulstudio/sales-crm/blob/main/components/companies/profile/profile.tsx): `components/companies/profile/profile.tsx`
- [Create company](https://github.com/kargulstudio/sales-crm/blob/main/components/companies/new-company/new-company-dialog.tsx): `components/companies/new-company/new-company-dialog.tsx`
- [Command menu](https://github.com/kargulstudio/sales-crm/blob/main/components/companies/command-menu/command-menu.tsx): `components/companies/command-menu/command-menu.tsx`

### CRM state and domain

- [Companies store](https://github.com/kargulstudio/sales-crm/blob/main/stores/companies-store.ts): `stores/companies-store.ts`
- [Company records](https://github.com/kargulstudio/sales-crm/blob/main/data/companies.ts): `data/companies.ts`
- [Company calculations](https://github.com/kargulstudio/sales-crm/blob/main/lib/companies.ts): `lib/companies.ts`
- [Notification records](https://github.com/kargulstudio/sales-crm/blob/main/data/notifications.ts): `data/notifications.ts`

### Search metadata

- [Site metadata](https://github.com/kargulstudio/sales-crm/blob/main/lib/seo.ts): `lib/seo.ts`
- [LLMs route](https://github.com/kargulstudio/sales-crm/blob/main/app/llms.txt/route.ts): `app/llms.txt/route.ts`
- [Robots metadata](https://github.com/kargulstudio/sales-crm/blob/main/app/robots.ts): `app/robots.ts`
- [Sitemap metadata](https://github.com/kargulstudio/sales-crm/blob/main/app/sitemap.ts): `app/sitemap.ts`

### Other components

- **CRM user**

## Connections

- CRM user → Home page: opens (evidence: `app/page.tsx`)
- Home page → Companies workspace: renders (evidence: `app/page.tsx`)
- Home page → Navigation sidebar: renders (evidence: `app/page.tsx`)
- Companies workspace → Filters and toolbar: renders (evidence: `components/companies/companies.tsx`)
- Companies workspace → Company table: renders (evidence: `components/companies/companies.tsx`)
- Companies workspace → Company detail: renders (evidence: `components/companies/companies.tsx`)
- Companies workspace → Owner profile: renders (evidence: `components/companies/companies.tsx`)
- Companies workspace → Create company: renders (evidence: `components/companies/companies.tsx`)
- Companies workspace → Command menu: renders (evidence: `components/companies/companies.tsx`)
- Navigation sidebar → Companies store: reads (evidence: `components/_common/sidebar/sidebar.tsx`)
- Filters and toolbar → Companies store: updates filters
- Create company → Companies store: adds company (evidence: `components/companies/new-company/new-company-dialog.tsx`)
- Companies store → Company records: initializes from (evidence: `stores/companies-store.ts`)
- Companies store → Notification records: initializes from (evidence: `stores/companies-store.ts`)
- Companies store → Company calculations: uses defaults (evidence: `stores/companies-store.ts`)
- Home page → Site metadata: uses metadata
- LLMs route → Site metadata: reads routes (evidence: `app/llms.txt/route.ts`)
- Robots metadata → Site metadata: derives from (evidence: `README.md`)
- Sitemap metadata → Site metadata: derives from (evidence: `README.md`)
