# robertofare2002/vinted-dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/robertofare2002/vinted-dashboard
- Repository: https://github.com/robertofare2002/vinted-dashboard

## Overview

1. **Overall shape**
   - This is a **Next.js App Router** application, not a generic component library.
   - The repo is organized around a **public auth area** and a **protected dashboard area**, with shared UI components and a small Supabase integration layer.

2. **Routing structure**
   - `src/app/login` and `src/app/signup` are the unauthenticated entry points.
   - `src/app/(dashboard)` is a route group for authenticated pages, containing the main dashboard shell plus feature pages like inventory, sales, stock, templates, profiles, and transactions.
   - The route group implies a shared layout boundary for all dashboard pages.

3. **Dashboard shell and navigation**
   - `src/components/DashboardShell.tsx`, `Sidebar.tsx`, `TopNav.tsx`, `MobileHeader.tsx`, and `MobileTabBar.tsx` form the main application chrome.
   - This suggests a responsive shell that adapts between desktop navigation and mobile navigation.
   - The layout files in `src/app/layout.tsx` and `src/app/(dashboard)/layout.tsx` likely wire these global and section-level wrappers together.

4. **Feature domains**
   - The dashboard is split into distinct operational areas:
     - **Sales**: `src/app/(dashboard)/sales`, `SalesClient.tsx`, `SaleModal.tsx`, `SellModal.tsx`, `BulkSellModal.tsx`
     - **Stock**: `src/app/(dashboard)/stock`, `StockClient.tsx`, `StockEditModal.tsx`
     - **Templates**: `src/app/(dashboard)/templates`, `TemplatesClient.tsx`, `TemplateModal.tsx`
     - **Profiles**: `src/app/(dashboard)/profiles`
     - **Inventory** and **Transactions** pages for browsing operational data
   - These look like business workflow modules rather than generic content pages.

5. **Server actions as the mutation boundary**
   - Several feature folders contain `actions.ts` files: `sales`, `stock`, `templates`, and `profiles`.
   - That indicates the app uses **Next.js server actions** for writes and mutations, keeping form submissions and backend updates close to each domain.
   - The page/client components likely call these actions instead of exposing a separate API layer in the repo.

6. **Supabase integration**
   - `src/lib/supabase/client.ts` and `src/lib/supabase/server.ts` define the app’s data access boundary.
   - This points to **Supabase** as the backend service for auth and persistence, with separate client-side and server-side connection paths.
   - `src/lib/types.ts` probably centralizes database-derived or domain types shared across UI and data layers.

7. **Authentication and request gating**
   - `middleware.ts` is an important boundary: it likely protects dashboard routes and handles redirects between login/signup and authenticated pages.
   - The existence of both client and server Supabase helpers suggests auth state is validated on the server for routing, while client components can still interact with Supabase when needed.

8. **Data visualization and dashboard metrics**
   - Components like `StatsCards.tsx`, `RevenueChart.tsx`, `DashboardCharts.tsx`, `SalesChartCard.tsx`, `TopProductsCard.tsx`, `RecentTransactions.tsx`, `CashFlowCard.tsx`, `AvgTicketCard.tsx`, and `ConversionRateCard.tsx` show a metrics-heavy dashboard.
   - These appear to consume aggregated business data and present KPIs rather than raw records only.
   - The dashboard page is therefore both an operational console and an analytics surface.

9. **Client/server component split**
   - The `Client.tsx` naming pattern in several feature areas suggests a split between server-rendered pages and interactive client-side subtrees.
   - Modals and editing flows are isolated into reusable client components, while route pages likely assemble data and structure.
   - This helps keep interactive editing isolated from the higher-level page composition.

10. **Styling and app-wide presentation**
   - `src/app/globals.css`, `postcss.config.mjs`, and `eslint.config.mjs` indicate standard Next.js styling and linting setup.
   - `next.config.ts` and the root `package.json` define the framework/runtime boundary.
   - The project also uses `next/font` per the README, so typography is handled as part of the app shell rather than by an external CSS framework alone.

11. **Deployment/runtime implications**
   - The README explicitly points to **Vercel** deployment, which fits the Next.js + server actions + middleware architecture.
   - The app is built for a serverless-style deployment model where pages, middleware, and server actions run in the platform runtime, while Supabase provides the external data layer.

12. **How data likely flows**
   - Authenticated user lands on a dashboard route.
   - Middleware checks access and redirects unauthenticated traffic to login/signup.
   - Dashboard pages fetch domain data through Supabase server helpers or server-rendered page logic.
   - Interactive UI components open modals or trigger server actions to mutate sales, stock, templates, or profiles.
   - Updated data is reflected back in charts, tables, and summary cards across the dashboard.

Main entry points: [`src/app/(dashboard)/page.tsx`](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/(dashboard)/page.tsx) (Dashboard Home), [`src/components/DashboardShell.tsx`](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/components/DashboardShell.tsx) (Dashboard Shell), [`src/lib/supabase/server.ts`](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/lib/supabase/server.ts) (Supabase Server), [`src/app/layout.tsx`](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/layout.tsx) (Root Layout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["Routing"]
  node_node_1["Root Layout<br/>[layout.tsx]"]
  node_node_2["Dashboard Layout<br/>[layout.tsx]"]
  node_node_3["Dashboard Home<br/>page<br/>[page.tsx]"]
  node_node_4["Login Page<br/>[page.tsx]"]
  node_node_5["Signup Page<br/>[signup-page.tsx]"]
  node_node_6["Inventory Page<br/>[page.tsx]"]
  node_node_7["Sales Page<br/>[page.tsx]"]
  node_node_8["Stock Page<br/>[page.tsx]"]
  node_node_9["Templates Page<br/>[page.tsx]"]
  node_node_10["Transactions Page<br/>[page.tsx]"]
end

subgraph group_dashboard["Dashboard UI"]
  node_node_15["Dashboard Shell<br/>[DashboardShell.tsx]"]
  node_node_16["Sidebar<br/>nav<br/>[Sidebar.tsx]"]
  node_node_17["Top Nav<br/>[TopNav.tsx]"]
  node_node_18["Mobile Header<br/>nav<br/>[MobileHeader.tsx]"]
  node_node_19["Tab Bar<br/>nav<br/>[MobileTabBar.tsx]"]
  node_node_20["Stats Cards<br/>kpis<br/>[StatsCards.tsx]"]
  node_node_21["Charts<br/>analytics"]
  node_node_22["Revenue Chart<br/>[RevenueChart.tsx]"]
  node_node_23["Sales Chart Card<br/>[SalesChartCard.tsx]"]
  node_node_24["Recent Transactions<br/>feed"]
  node_node_25["Top Products<br/>ranking"]
end

subgraph group_domains["Feature Domains"]
  node_node_26["Sales Client<br/>[SalesClient.tsx]"]
  node_node_27["Stock Client<br/>[StockClient.tsx]"]
  node_node_28["Templates Client"]
  node_node_29{{"Sales Actions<br/>server actions<br/>[actions.ts]"}}
  node_node_30{{"Stock Actions<br/>server actions<br/>[actions.ts]"}}
  node_node_31{{"Template Actions<br/>server actions<br/>[actions.ts]"}}
  node_node_32{{"Profiles Actions<br/>server actions<br/>[actions.ts]"}}
end

subgraph group_data["Data & Auth"]
  node_node_11{{"Middleware<br/>guard<br/>[middleware.ts]"}}
  node_node_12[("Supabase Client<br/>db client<br/>[client.ts]")]
  node_node_13[("Supabase Server<br/>db server<br/>[server.ts]")]
  node_node_14["Shared Types<br/>[types.ts]"]
end

node_node_11 -->|"redirects"| node_node_4
node_node_11 -->|"redirects"| node_node_5
node_node_1 -->|"wraps"| node_node_2
node_node_1 -->|"renders"| node_node_4
node_node_1 -->|"renders"| node_node_5
node_node_2 -->|"uses"| node_node_15
node_node_15 -->|"contains"| node_node_16
node_node_15 -->|"contains"| node_node_17
node_node_15 -->|"contains"| node_node_18
node_node_15 -->|"contains"| node_node_19
node_node_2 -->|"serves"| node_node_3
node_node_3 -->|"shows"| node_node_20
node_node_3 -->|"shows"| node_node_21
node_node_3 -->|"shows"| node_node_24
node_node_21 -->|"includes"| node_node_22
node_node_21 -->|"includes"| node_node_23
node_node_3 -->|"shows"| node_node_25
node_node_7 -->|"assembles"| node_node_26
node_node_7 -->|"mutates via"| node_node_29
node_node_8 -->|"assembles"| node_node_27
node_node_8 -->|"mutates via"| node_node_30
node_node_9 -->|"assembles"| node_node_28
node_node_9 -->|"mutates via"| node_node_31
node_node_32 -->|"uses"| node_node_14
node_node_13 -->|"uses"| node_node_14
node_node_12 -->|"uses"| node_node_14
node_node_7 -->|"reads via"| node_node_13
node_node_8 -->|"reads via"| node_node_13
node_node_9 -->|"reads via"| node_node_13

click node_node_1 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/layout.tsx"
click node_node_2 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/(dashboard)/layout.tsx"
click node_node_3 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/(dashboard)/page.tsx"
click node_node_4 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/login/page.tsx"
click node_node_5 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/signup/signup-page.tsx"
click node_node_6 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/(dashboard)/inventory/page.tsx"
click node_node_7 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/(dashboard)/sales/page.tsx"
click node_node_8 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/(dashboard)/stock/page.tsx"
click node_node_9 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/(dashboard)/templates/page.tsx"
click node_node_10 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/(dashboard)/transactions/page.tsx"
click node_node_11 "https://github.com/robertofare2002/vinted-dashboard/blob/main/middleware.ts"
click node_node_12 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/lib/supabase/client.ts"
click node_node_13 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/lib/supabase/server.ts"
click node_node_14 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/lib/types.ts"
click node_node_15 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/components/DashboardShell.tsx"
click node_node_16 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/components/Sidebar.tsx"
click node_node_17 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/components/TopNav.tsx"
click node_node_18 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/components/MobileHeader.tsx"
click node_node_19 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/components/MobileTabBar.tsx"
click node_node_20 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/components/StatsCards.tsx"
click node_node_21 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/components/DashboardCharts.tsx"
click node_node_22 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/components/RevenueChart.tsx"
click node_node_23 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/components/SalesChartCard.tsx"
click node_node_24 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/components/RecentTransactions.tsx"
click node_node_25 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/components/TopProductsCard.tsx"
click node_node_26 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/components/SalesClient.tsx"
click node_node_27 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/components/StockClient.tsx"
click node_node_28 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/components/TemplatesClient.tsx"
click node_node_29 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/(dashboard)/sales/actions.ts"
click node_node_30 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/(dashboard)/stock/actions.ts"
click node_node_31 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/(dashboard)/templates/actions.ts"
click node_node_32 "https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/(dashboard)/profiles/actions.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_node_1,node_node_2,node_node_3,node_node_4,node_node_5,node_node_6,node_node_7,node_node_8,node_node_9,node_node_10 toneBlue
class node_node_15,node_node_16,node_node_17,node_node_18,node_node_19,node_node_20,node_node_21,node_node_22,node_node_23,node_node_24,node_node_25 toneAmber
class node_node_26,node_node_27,node_node_28,node_node_29,node_node_30,node_node_31,node_node_32 toneMint
class node_node_11,node_node_12,node_node_13,node_node_14 toneRose
```

## Components

### Routing

App Router entry points and section layouts

- [Root Layout](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/layout.tsx): layout · Global app wrapper · `src/app/layout.tsx`
- [Dashboard Layout](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/(dashboard)/layout.tsx): layout · Authenticated section shell · `src/app/(dashboard)/layout.tsx`
- [Dashboard Home](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/(dashboard)/page.tsx): page · Main dashboard landing page · `src/app/(dashboard)/page.tsx`
- [Login Page](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/login/page.tsx): page · Public sign-in entry · `src/app/login/page.tsx`
- [Signup Page](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/signup/signup-page.tsx): page · Public account creation entry · `src/app/signup/signup-page.tsx`
- [Inventory Page](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/(dashboard)/inventory/page.tsx): page · Inventory browsing view · `src/app/(dashboard)/inventory/page.tsx`
- [Sales Page](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/(dashboard)/sales/page.tsx): page · Sales workflow entry · `src/app/(dashboard)/sales/page.tsx`
- [Stock Page](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/(dashboard)/stock/page.tsx): page · Stock management view · `src/app/(dashboard)/stock/page.tsx`
- [Templates Page](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/(dashboard)/templates/page.tsx): page · Template management view · `src/app/(dashboard)/templates/page.tsx`
- [Transactions Page](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/(dashboard)/transactions/page.tsx): page · Transaction history view · `src/app/(dashboard)/transactions/page.tsx`

### Dashboard UI

Shared chrome and dashboard presentation components

- [Dashboard Shell](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/components/DashboardShell.tsx): shell · Responsive app chrome · `src/components/DashboardShell.tsx`
- [Sidebar](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/components/Sidebar.tsx): nav · Desktop navigation · `src/components/Sidebar.tsx`
- [Top Nav](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/components/TopNav.tsx): nav · Top-level desktop header · `src/components/TopNav.tsx`
- [Mobile Header](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/components/MobileHeader.tsx): nav · Mobile header bar · `src/components/MobileHeader.tsx`
- [Tab Bar](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/components/MobileTabBar.tsx): nav · Mobile bottom navigation · `src/components/MobileTabBar.tsx`
- [Stats Cards](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/components/StatsCards.tsx): kpis · Summary metrics cards · `src/components/StatsCards.tsx`
- [Charts](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/components/DashboardCharts.tsx): analytics · Dashboard chart composition · `src/components/DashboardCharts.tsx`
- [Revenue Chart](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/components/RevenueChart.tsx): chart · Revenue trend visualization · `src/components/RevenueChart.tsx`
- [Sales Chart Card](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/components/SalesChartCard.tsx): chart card · Sales analytics card · `src/components/SalesChartCard.tsx`
- [Recent Transactions](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/components/RecentTransactions.tsx): feed · Latest transaction list · `src/components/RecentTransactions.tsx`
- [Top Products](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/components/TopProductsCard.tsx): ranking · Best-selling products card · `src/components/TopProductsCard.tsx`

### Feature Domains

Operational dashboard sections and their client/action boundaries

- [Sales Client](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/components/SalesClient.tsx): client · Interactive sales subtree · `src/components/SalesClient.tsx`
- [Stock Client](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/components/StockClient.tsx): client · Interactive stock subtree · `src/components/StockClient.tsx`
- [Templates Client](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/components/TemplatesClient.tsx): client · Interactive templates subtree · `src/components/TemplatesClient.tsx`
- [Sales Actions](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/(dashboard)/sales/actions.ts): server actions · Sales mutations · `src/app/(dashboard)/sales/actions.ts`
- [Stock Actions](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/(dashboard)/stock/actions.ts): server actions · Stock mutations · `src/app/(dashboard)/stock/actions.ts`
- [Template Actions](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/(dashboard)/templates/actions.ts): server actions · Template mutations · `src/app/(dashboard)/templates/actions.ts`
- [Profiles Actions](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/app/(dashboard)/profiles/actions.ts): server actions · Profile mutations · `src/app/(dashboard)/profiles/actions.ts`

### Data & Auth

Middleware, Supabase helpers, and shared types

- [Middleware](https://github.com/robertofare2002/vinted-dashboard/blob/main/middleware.ts): guard · Route protection and redirects · `middleware.ts`
- [Supabase Client](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/lib/supabase/client.ts): db client · Browser-side Supabase access · `src/lib/supabase/client.ts`
- [Supabase Server](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/lib/supabase/server.ts): db server · Server-side Supabase access · `src/lib/supabase/server.ts`
- [Shared Types](https://github.com/robertofare2002/vinted-dashboard/blob/main/src/lib/types.ts): types · Shared domain and DB types · `src/lib/types.ts`

## Connections

- Middleware → Login Page: redirects · Protects dashboard routes and sends unauthenticated users to auth pages
- Middleware → Signup Page: redirects · Protects dashboard routes and sends unauthenticated users to auth pages
- Root Layout → Dashboard Layout: wraps · Root layout provides the section layout boundary
- Root Layout → Login Page: renders · Public auth entry is part of the app router
- Root Layout → Signup Page: renders · Public auth entry is part of the app router
- Dashboard Layout → Dashboard Shell: uses · Dashboard section is composed with the shared shell
- Dashboard Shell → Sidebar: contains · Desktop navigation
- Dashboard Shell → Top Nav: contains · Desktop top navigation
- Dashboard Shell → Mobile Header: contains · Mobile header
- Dashboard Shell → Tab Bar: contains · Mobile navigation
- Dashboard Layout → Dashboard Home: serves · Shared dashboard layout feeds the main landing page
- Dashboard Home → Stats Cards: shows · Displays KPI summary cards
- Dashboard Home → Charts: shows · Displays analytics charts
- Dashboard Home → Recent Transactions: shows · Displays recent activity
- Charts → Revenue Chart: includes · Chart composition includes revenue trend
- Charts → Sales Chart Card: includes · Chart composition includes sales metrics
- Dashboard Home → Top Products: shows · Shows top product ranking
- Sales Page → Sales Client: assembles · Sales page mounts interactive sales client
- Sales Page → Sales Actions: mutates via · Sales mutations are handled with server actions
- Stock Page → Stock Client: assembles · Stock page mounts interactive stock client
- Stock Page → Stock Actions: mutates via · Stock mutations are handled with server actions
- Templates Page → Templates Client: assembles · Templates page mounts interactive templates client
- Templates Page → Template Actions: mutates via · Template mutations are handled with server actions
- Profiles Actions → Shared Types: uses · Profile mutations share domain types
- Supabase Server → Shared Types: uses · Server data layer is typed from shared models
- Supabase Client → Shared Types: uses · Client data layer is typed from shared models
- Sales Page → Supabase Server: reads via · Sales flows use server-side Supabase access for data
- Stock Page → Supabase Server: reads via · Stock flows use server-side Supabase access for data
- Templates Page → Supabase Server: reads via · Template flows use server-side Supabase access for data
