# alexandruciucalau/nextjs_dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/alexandruciucalau/nextjs_dashboard
- Repository: https://github.com/alexandruciucalau/nextjs_dashboard

## Overview

This is a Next.js App Router course starter for an Acme business dashboard. A user enters through the landing page, navigates the dashboard, and views invoice and customer records; invoice search parameters feed the invoice table, which fetches filtered data from PostgreSQL. The overview presents summary cards, revenue, and recent invoices. Invoice forms and seed/query routes are also present. The sampled sources show the overview and invoice data flow directly; several unsampled route and form connections are therefore left unverified.

Main entry points: [`app/dashboard/(overview)/page.tsx`](https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/dashboard/(overview)/page.tsx) (Overview route), [`app/dashboard/invoices/page.tsx`](https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/dashboard/invoices/page.tsx) (Invoices route), [`app/lib/data.ts`](https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/lib/data.ts) (Dashboard data access), [`app/ui/invoices/table.tsx`](https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/ui/invoices/table.tsx) (Invoice table)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and navigation"]
  node_landing["Landing page<br/>[page.tsx]"]
  node_dashboard_layout["Dashboard layout<br/>[layout.tsx]"]
  node_sidebar["Sidebar navigation<br/>[sidenav.tsx]"]
  node_nav_links["Navigation links<br/>[nav-links.tsx]"]
end

subgraph group_dashboard["Dashboard views"]
  node_overview["Overview route<br/>[page.tsx]"]
  node_summary_cards["Summary cards<br/>[cards.tsx]"]
  node_revenue_chart["Revenue chart<br/>[revenue-chart.tsx]"]
  node_latest_invoices["Latest invoices"]
end

subgraph group_records["Record management"]
  node_invoices_route["Invoices route<br/>[page.tsx]"]
  node_invoice_search["Invoice search<br/>[search.tsx]"]
  node_invoice_table["Invoice table<br/>[table.tsx]"]
  node_invoice_actions["Invoice actions<br/>[buttons.tsx]"]
  node_invoice_forms["Invoice forms<br/>[create-form.tsx]"]
  node_customer_route["Customers route<br/>[page.tsx]"]
  node_customer_table["Customer table<br/>[table.tsx]"]
end

subgraph group_data["Data and operations"]
  node_data_access["Dashboard data access<br/>[data.ts]"]
  node_postgres[("PostgreSQL")]
  node_seed_route["Seed endpoint<br/>[route.ts]"]
  node_placeholder_data["Sample records"]
  node_query_route["Query endpoint<br/>[route.ts]"]
end

node_visitor(("Dashboard user"))

node_visitor -->|"opens"| node_landing
node_landing -.->|"links to login"| node_dashboard_layout
node_dashboard_layout -->|"renders"| node_sidebar
node_sidebar -->|"renders"| node_nav_links
node_visitor -.->|"opens"| node_overview
node_overview -->|"renders"| node_summary_cards
node_overview -->|"renders"| node_revenue_chart
node_overview -->|"renders"| node_latest_invoices
node_overview -->|"fetches summary"| node_data_access
node_revenue_chart -->|"fetches revenue"| node_data_access
node_visitor -.->|"opens"| node_invoices_route
node_invoices_route -->|"renders"| node_invoice_search
node_invoices_route -->|"renders with filters"| node_invoice_table
node_invoices_route -->|"renders create action"| node_invoice_actions
node_invoice_search -->|"updates URL query"| node_invoices_route
node_invoice_table -->|"fetches filtered rows"| node_data_access
node_invoice_table -->|"renders row actions"| node_invoice_actions
node_invoice_actions -.->|"opens forms"| node_invoice_forms
node_visitor -.->|"opens"| node_customer_route
node_customer_route -.->|"displays"| node_customer_table
node_customer_table -.->|"loads customer records"| node_data_access
node_data_access -->|"queries"| node_postgres
node_seed_route -->|"reads seed records"| node_placeholder_data
node_seed_route -.->|"writes seed data"| node_postgres

click node_landing "https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/page.tsx"
click node_dashboard_layout "https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/dashboard/layout.tsx"
click node_sidebar "https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/ui/dashboard/sidenav.tsx"
click node_nav_links "https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/ui/dashboard/nav-links.tsx"
click node_overview "https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/dashboard/(overview)/page.tsx"
click node_summary_cards "https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/ui/dashboard/cards.tsx"
click node_revenue_chart "https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/ui/dashboard/revenue-chart.tsx"
click node_latest_invoices "https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/ui/dashboard/latest-invoices.tsx"
click node_invoices_route "https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/dashboard/invoices/page.tsx"
click node_invoice_search "https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/ui/search.tsx"
click node_invoice_table "https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/ui/invoices/table.tsx"
click node_invoice_actions "https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/ui/invoices/buttons.tsx"
click node_invoice_forms "https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/ui/invoices/create-form.tsx"
click node_customer_route "https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/dashboard/customers/page.tsx"
click node_customer_table "https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/ui/customers/table.tsx"
click node_data_access "https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/lib/data.ts"
click node_seed_route "https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/seed/route.ts"
click node_placeholder_data "https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/lib/placeholder-data.ts"
click node_query_route "https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/query/route.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_landing,node_dashboard_layout,node_sidebar,node_nav_links,node_visitor toneBlue
class node_overview,node_summary_cards,node_revenue_chart,node_latest_invoices toneAmber
class node_invoices_route,node_invoice_search,node_invoice_table,node_invoice_actions,node_invoice_forms,node_customer_route,node_customer_table toneMint
class node_data_access,node_postgres,node_seed_route,node_placeholder_data,node_query_route toneRose
```

## Components

### Entry and navigation

- [Landing page](https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/page.tsx): `app/page.tsx`
- [Dashboard layout](https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/dashboard/layout.tsx): `app/dashboard/layout.tsx`
- [Sidebar navigation](https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/ui/dashboard/sidenav.tsx): `app/ui/dashboard/sidenav.tsx`
- [Navigation links](https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/ui/dashboard/nav-links.tsx): `app/ui/dashboard/nav-links.tsx`

### Dashboard views

- [Overview route](https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/dashboard/(overview)/page.tsx): `app/dashboard/(overview)/page.tsx`
- [Summary cards](https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/ui/dashboard/cards.tsx): `app/ui/dashboard/cards.tsx`
- [Revenue chart](https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/ui/dashboard/revenue-chart.tsx): `app/ui/dashboard/revenue-chart.tsx`
- [Latest invoices](https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/ui/dashboard/latest-invoices.tsx): `app/ui/dashboard/latest-invoices.tsx`

### Record management

- [Invoices route](https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/dashboard/invoices/page.tsx): `app/dashboard/invoices/page.tsx`
- [Invoice search](https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/ui/search.tsx): `app/ui/search.tsx`
- [Invoice table](https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/ui/invoices/table.tsx): `app/ui/invoices/table.tsx`
- [Invoice actions](https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/ui/invoices/buttons.tsx): `app/ui/invoices/buttons.tsx`
- [Invoice forms](https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/ui/invoices/create-form.tsx): `app/ui/invoices/create-form.tsx`
- [Customers route](https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/dashboard/customers/page.tsx): `app/dashboard/customers/page.tsx`
- [Customer table](https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/ui/customers/table.tsx): `app/ui/customers/table.tsx`

### Data and operations

- [Dashboard data access](https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/lib/data.ts): `app/lib/data.ts`
- **PostgreSQL**
- [Seed endpoint](https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/seed/route.ts): `app/seed/route.ts`
- [Sample records](https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/lib/placeholder-data.ts): `app/lib/placeholder-data.ts`
- [Query endpoint](https://github.com/alexandruciucalau/nextjs_dashboard/blob/main/app/query/route.ts): `app/query/route.ts`

### Other components

- **Dashboard user**

## Connections

- Dashboard user → Landing page: opens (evidence: `app/page.tsx`)
- Landing page → Dashboard layout: links to login
- Dashboard layout → Sidebar navigation: renders (evidence: `app/dashboard/layout.tsx`)
- Sidebar navigation → Navigation links: renders (evidence: `app/ui/dashboard/sidenav.tsx`)
- Dashboard user → Overview route: opens
- Overview route → Summary cards: renders (evidence: `app/dashboard/(overview)/page.tsx`)
- Overview route → Revenue chart: renders (evidence: `app/dashboard/(overview)/page.tsx`)
- Overview route → Latest invoices: renders (evidence: `app/dashboard/(overview)/page.tsx`)
- Overview route → Dashboard data access: fetches summary (evidence: `app/dashboard/(overview)/page.tsx`)
- Revenue chart → Dashboard data access: fetches revenue (evidence: `app/ui/dashboard/revenue-chart.tsx`)
- Dashboard user → Invoices route: opens
- Invoices route → Invoice search: renders (evidence: `app/dashboard/invoices/page.tsx`)
- Invoices route → Invoice table: renders with filters (evidence: `app/dashboard/invoices/page.tsx`)
- Invoices route → Invoice actions: renders create action (evidence: `app/dashboard/invoices/page.tsx`)
- Invoice search → Invoices route: updates URL query (evidence: `app/ui/search.tsx`)
- Invoice table → Dashboard data access: fetches filtered rows (evidence: `app/ui/invoices/table.tsx`)
- Invoice table → Invoice actions: renders row actions (evidence: `app/ui/invoices/table.tsx`)
- Invoice actions → Invoice forms: opens forms
- Dashboard user → Customers route: opens
- Customers route → Customer table: displays
- Customer table → Dashboard data access: loads customer records
- Dashboard data access → PostgreSQL: queries (evidence: `app/lib/data.ts`)
- Seed endpoint → Sample records: reads seed records (evidence: `app/seed/route.ts`)
- Seed endpoint → PostgreSQL: writes seed data
