# atulranjan97/devshelf architecture

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

- Interactive diagram: https://gitdiagram.com/atulranjan97/devshelf
- Repository: https://github.com/atulranjan97/devshelf

## Overview

DevShelf is a developer knowledge-hub dashboard for browsing typed items and collections, with pinned/recent views and summary counts. The dashboard route composes these views; sidebar and data-backed panels retrieve records through Prisma-backed query modules. The item and collection query functions are supported by excerpts; several panels are only indexed, so their internal behavior is not inferred. The repository also contains mock data, but the sampled runtime does not establish it as the dashboard’s result source beyond the sidebar’s demo-user display.

Main entry points: [`src/app/dashboard/page.tsx`](https://github.com/atulranjan97/devshelf/blob/main/src/app/dashboard/page.tsx) (Dashboard route), [`src/components/dashboard/AppSidebar.tsx`](https://github.com/atulranjan97/devshelf/blob/main/src/components/dashboard/AppSidebar.tsx) (Navigation sidebar), [`src/lib/db/items.ts`](https://github.com/atulranjan97/devshelf/blob/main/src/lib/db/items.ts) (Item queries), [`src/components/ui/sidebar.tsx`](https://github.com/atulranjan97/devshelf/blob/main/src/components/ui/sidebar.tsx) (Sidebar primitives)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard experience"]
  node_route["Dashboard route<br/>[page.tsx]"]
  node_sidebar["Navigation sidebar<br/>[AppSidebar.tsx]"]
  node_collections_view["Collections panel"]
  node_pinned_view["Pinned items<br/>[PinnedItems.tsx]"]
  node_recent_view["Recent items<br/>[RecentItems.tsx]"]
  node_stats_view["Dashboard statistics<br/>[StatsCards.tsx]"]
  node_topbar["Dashboard top bar<br/>[TopBar.tsx]"]
  node_item_row["Item display row<br/>[ItemRow.tsx]"]
end

subgraph group_data["Knowledge data"]
  node_collection_queries["Collection queries<br/>[collections.ts]"]
  node_item_queries["Item queries<br/>[items.ts]"]
  node_mock_data["Demo user data<br/>[mock-data.ts]"]
  node_prisma_client["Prisma client<br/>[prisma.ts]"]
  node_database[("PostgreSQL database")]
end

subgraph group_ui["UI foundations"]
  node_item_icons["Item type icons"]
  node_sidebar_ui["Sidebar primitives<br/>[sidebar.tsx]"]
  node_sheet_ui["Sheet primitive<br/>[sheet.tsx]"]
  node_mobile_hook["Mobile detection hook<br/>[use-mobile.ts]"]
  node_ui_utils["Class utilities<br/>[utils.ts]"]
end

node_visitor(("Dashboard visitor"))

node_visitor -->|"opens"| node_route
node_route -->|"renders"| node_topbar
node_route -->|"renders"| node_sidebar
node_route -->|"renders"| node_collections_view
node_route -->|"renders"| node_pinned_view
node_route -->|"renders"| node_recent_view
node_route -->|"renders"| node_stats_view
node_sidebar -->|"loads types"| node_item_queries
node_sidebar -->|"loads collections"| node_collection_queries
node_sidebar -->|"reads demo user"| node_mock_data
node_sidebar -->|"maps type icons"| node_item_icons
node_collections_view -->|"loads collections"| node_collection_queries
node_pinned_view -->|"loads pinned"| node_item_queries
node_recent_view -->|"loads recent"| node_item_queries
node_stats_view -->|"loads item stats"| node_item_queries
node_stats_view -->|"loads collection stats"| node_collection_queries
node_pinned_view -->|"renders"| node_item_row
node_recent_view -->|"renders"| node_item_row
node_item_row -->|"renders icon"| node_item_icons
node_collection_queries -->|"queries via"| node_prisma_client
node_item_queries -->|"queries via"| node_prisma_client
node_prisma_client -->|"connects"| node_database
node_route -->|"uses provider"| node_sidebar_ui
node_sidebar_ui -->|"uses mobile sheet"| node_sheet_ui
node_sidebar_ui -->|"checks viewport"| node_mobile_hook
node_sidebar_ui -->|"merges classes"| node_ui_utils

click node_route "https://github.com/atulranjan97/devshelf/blob/main/src/app/dashboard/page.tsx"
click node_sidebar "https://github.com/atulranjan97/devshelf/blob/main/src/components/dashboard/AppSidebar.tsx"
click node_collections_view "https://github.com/atulranjan97/devshelf/blob/main/src/components/dashboard/CollectionsSection.tsx"
click node_pinned_view "https://github.com/atulranjan97/devshelf/blob/main/src/components/dashboard/PinnedItems.tsx"
click node_recent_view "https://github.com/atulranjan97/devshelf/blob/main/src/components/dashboard/RecentItems.tsx"
click node_stats_view "https://github.com/atulranjan97/devshelf/blob/main/src/components/dashboard/StatsCards.tsx"
click node_topbar "https://github.com/atulranjan97/devshelf/blob/main/src/components/dashboard/TopBar.tsx"
click node_item_row "https://github.com/atulranjan97/devshelf/blob/main/src/components/dashboard/ItemRow.tsx"
click node_collection_queries "https://github.com/atulranjan97/devshelf/blob/main/src/lib/db/collections.ts"
click node_item_queries "https://github.com/atulranjan97/devshelf/blob/main/src/lib/db/items.ts"
click node_mock_data "https://github.com/atulranjan97/devshelf/blob/main/src/lib/mock-data.ts"
click node_prisma_client "https://github.com/atulranjan97/devshelf/blob/main/src/lib/prisma.ts"
click node_item_icons "https://github.com/atulranjan97/devshelf/blob/main/src/lib/item-type-icons.tsx"
click node_sidebar_ui "https://github.com/atulranjan97/devshelf/blob/main/src/components/ui/sidebar.tsx"
click node_sheet_ui "https://github.com/atulranjan97/devshelf/blob/main/src/components/ui/sheet.tsx"
click node_mobile_hook "https://github.com/atulranjan97/devshelf/blob/main/src/hooks/use-mobile.ts"
click node_ui_utils "https://github.com/atulranjan97/devshelf/blob/main/src/lib/utils.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_route,node_sidebar,node_collections_view,node_pinned_view,node_recent_view,node_stats_view,node_topbar,node_item_row toneBlue
class node_collection_queries,node_item_queries,node_mock_data,node_prisma_client,node_database toneAmber
class node_item_icons,node_sidebar_ui,node_sheet_ui,node_mobile_hook,node_ui_utils toneMint
class node_visitor toneIndigo
```

## Components

### Dashboard experience

- [Dashboard route](https://github.com/atulranjan97/devshelf/blob/main/src/app/dashboard/page.tsx): `src/app/dashboard/page.tsx`
- [Navigation sidebar](https://github.com/atulranjan97/devshelf/blob/main/src/components/dashboard/AppSidebar.tsx): `src/components/dashboard/AppSidebar.tsx`
- [Collections panel](https://github.com/atulranjan97/devshelf/blob/main/src/components/dashboard/CollectionsSection.tsx): `src/components/dashboard/CollectionsSection.tsx`
- [Pinned items](https://github.com/atulranjan97/devshelf/blob/main/src/components/dashboard/PinnedItems.tsx): `src/components/dashboard/PinnedItems.tsx`
- [Recent items](https://github.com/atulranjan97/devshelf/blob/main/src/components/dashboard/RecentItems.tsx): `src/components/dashboard/RecentItems.tsx`
- [Dashboard statistics](https://github.com/atulranjan97/devshelf/blob/main/src/components/dashboard/StatsCards.tsx): `src/components/dashboard/StatsCards.tsx`
- [Dashboard top bar](https://github.com/atulranjan97/devshelf/blob/main/src/components/dashboard/TopBar.tsx): `src/components/dashboard/TopBar.tsx`
- [Item display row](https://github.com/atulranjan97/devshelf/blob/main/src/components/dashboard/ItemRow.tsx): `src/components/dashboard/ItemRow.tsx`

### Knowledge data

- [Collection queries](https://github.com/atulranjan97/devshelf/blob/main/src/lib/db/collections.ts): `src/lib/db/collections.ts`
- [Item queries](https://github.com/atulranjan97/devshelf/blob/main/src/lib/db/items.ts): `src/lib/db/items.ts`
- [Demo user data](https://github.com/atulranjan97/devshelf/blob/main/src/lib/mock-data.ts): `src/lib/mock-data.ts`
- [Prisma client](https://github.com/atulranjan97/devshelf/blob/main/src/lib/prisma.ts): `src/lib/prisma.ts`
- **PostgreSQL database**

### UI foundations

- [Item type icons](https://github.com/atulranjan97/devshelf/blob/main/src/lib/item-type-icons.tsx): `src/lib/item-type-icons.tsx`
- [Sidebar primitives](https://github.com/atulranjan97/devshelf/blob/main/src/components/ui/sidebar.tsx): `src/components/ui/sidebar.tsx`
- [Sheet primitive](https://github.com/atulranjan97/devshelf/blob/main/src/components/ui/sheet.tsx): `src/components/ui/sheet.tsx`
- [Mobile detection hook](https://github.com/atulranjan97/devshelf/blob/main/src/hooks/use-mobile.ts): `src/hooks/use-mobile.ts`
- [Class utilities](https://github.com/atulranjan97/devshelf/blob/main/src/lib/utils.ts): `src/lib/utils.ts`

### Other components

- **Dashboard visitor**

## Connections

- Dashboard visitor → Dashboard route: opens (evidence: `src/app/dashboard/page.tsx`)
- Dashboard route → Dashboard top bar: renders (evidence: `src/app/dashboard/page.tsx`)
- Dashboard route → Navigation sidebar: renders (evidence: `src/app/dashboard/page.tsx`)
- Dashboard route → Collections panel: renders (evidence: `src/app/dashboard/page.tsx`)
- Dashboard route → Pinned items: renders (evidence: `src/app/dashboard/page.tsx`)
- Dashboard route → Recent items: renders (evidence: `src/app/dashboard/page.tsx`)
- Dashboard route → Dashboard statistics: renders (evidence: `src/app/dashboard/page.tsx`)
- Navigation sidebar → Item queries: loads types (evidence: `src/components/dashboard/AppSidebar.tsx`)
- Navigation sidebar → Collection queries: loads collections (evidence: `src/components/dashboard/AppSidebar.tsx`)
- Navigation sidebar → Demo user data: reads demo user (evidence: `src/components/dashboard/AppSidebar.tsx`)
- Navigation sidebar → Item type icons: maps type icons (evidence: `src/components/dashboard/AppSidebar.tsx`)
- Collections panel → Collection queries: loads collections (evidence: `src/components/dashboard/CollectionsSection.tsx`)
- Pinned items → Item queries: loads pinned (evidence: `src/components/dashboard/PinnedItems.tsx`)
- Recent items → Item queries: loads recent (evidence: `src/components/dashboard/RecentItems.tsx`)
- Dashboard statistics → Item queries: loads item stats (evidence: `src/components/dashboard/StatsCards.tsx`)
- Dashboard statistics → Collection queries: loads collection stats (evidence: `src/components/dashboard/StatsCards.tsx`)
- Pinned items → Item display row: renders (evidence: `src/components/dashboard/PinnedItems.tsx`)
- Recent items → Item display row: renders (evidence: `src/components/dashboard/RecentItems.tsx`)
- Item display row → Item type icons: renders icon (evidence: `src/components/dashboard/ItemRow.tsx`)
- Collection queries → Prisma client: queries via (evidence: `src/lib/db/collections.ts`)
- Item queries → Prisma client: queries via (evidence: `src/lib/db/items.ts`)
- Prisma client → PostgreSQL database: connects (evidence: `src/lib/prisma.ts`)
- Dashboard route → Sidebar primitives: uses provider (evidence: `src/app/dashboard/page.tsx`)
- Sidebar primitives → Sheet primitive: uses mobile sheet (evidence: `src/components/ui/sidebar.tsx`)
- Sidebar primitives → Mobile detection hook: checks viewport (evidence: `src/components/ui/sidebar.tsx`)
- Sidebar primitives → Class utilities: merges classes (evidence: `src/components/ui/sidebar.tsx`)
