Commit Graph

3 Commits

Author SHA1 Message Date
kovakmedya f11cd099f6 feat(dashboard): real data — metrics, charts, top customers, recent transactions
Dashboard is no longer mock data. Single getDashboardData(tenantId) server
query computes everything in one pass.

New aggregator (lib/appwrite/dashboard-queries.ts):
- Pulls customers, invoices, finance_entries, tasks, services in parallel.
- Derives:
  * metrics: totalCustomers, activeCustomers, monthIncome,
    prevMonthIncome (for delta), outstanding (unpaid invoice total),
    overdueCount, openTasks, urgentTasks
  * monthlyIncome: 12-month income+expense series for area chart
  * topCustomers: 5 highest-grossing customers by paid invoice total
  * recentTransactions: 8 newest finance entries
  * topServices: 5 services by aggregate unit price (placeholder, will
    refine when we have invoice line analytics)
  * newCustomersMonthly: 6-month new customer count for bar chart

Components (dashboard/components/):
- Metrics: 4 cards with trend indicator on income (delta vs previous
  month), warning tone on overdue invoices and urgent tasks.
- IncomeChart: Recharts Area chart, dual income/expense series with
  gradient fills, Turkish month labels.
- TopCustomers: ranked list with progress bars relative to top earner.
- RecentTransactions: list with type badge, signed amount, link to
  /finance for full list.
- CustomerGrowth: BarChart of new customers per month (last 6).
- QuickActions: 4 buttons linking to /customers, /invoices, /calendar,
  /tasks (replaced template's New User/Add Product/etc).

Layout: 4 metric cards row, then income chart + top customers (2-col),
then recent transactions + customer growth (2-col).

Removed:
- src/app/(dashboard)/dashboard-2/ (was the demo page; same components
  re-exported into the real /dashboard from there. Now /dashboard owns
  its components.)
- 'Dashboard 2' entry from CommandSearch; replaced with our actual
  module list (Müşteriler / Hizmetler / Yazılımlarımız / Takvim /
  Görevler / Gelir-Gider / Faturalar).
2026-04-30 06:19:44 +03:00
kovakmedya 8a7742af1b feat(dashboard): personalized header + reuse dashboard-2 components
- /dashboard now a server component:
  * fetches active user + active tenant settings via getActiveContext()
  * redirects to /onboarding if user has no tenant yet
  * header shows companyName + 'Hoş geldiniz, {firstName}' + Turkish description
- Body reuses dashboard-2 components (Metrics/Sales/Revenue/Transactions/
  TopProducts/CustomerInsights/QuickActions). Mock data for now; will be
  swapped for live Appwrite queries as modules ship.
- New lib/appwrite/active-context.ts: getActiveContext() returns
  { user, tenantId, settings } for any server component / action.
- Made schema.ts SDK-agnostic by replacing Models.Document import with a
  local SystemRow type ({ $id, $createdAt, $updatedAt, $permissions, ... }).
  Avoids type clashes between appwrite (browser) and node-appwrite (server).
2026-04-30 03:33:53 +03:00
kovakmedya 29aa346f9e Initial commit: silicondeck/shadcn-dashboard-landing-template (nextjs-version) + CLAUDE.md
- Next.js 16.1.1 + React 19.2.3 + Tailwind v4 + shadcn/ui v3
- Template scaffold (App Router with (auth)/(dashboard)/landing route groups)
- pnpm v10 lockfile
- CLAUDE.md describing multi-tenant Appwrite architecture, 8 modules, Gitea+Coolify deploy
2026-04-30 02:28:30 +03:00