How deniweb/crm_nextjs works
This is a Next.js CRM for managing companies and their promotions, with an admin dashboard for sales, counts, and summary statistics. The main workflow is to browse companies, open a company record, and view its promotions or use the form routes to add records; dashboard routes fetch and present aggregate views. The API module connects these screens to MockAPI, while server-side query prefetching supports the company list and detail views. The README marks several management features as in development. Connections below rely on the README and SOURCE INDEX references; unsampled routes and components are not assumed to have unshown behavior.
Main entry points: api.ts CRM API client · company-form.tsx Company form · promotion-form.tsx Promotion form · page.tsx Sales summary
Components 33
Admin navigation
- Admin shell
src/app/(admin)/layout.tsx - Dashboard page
src/app/(admin)/dashboard/page.tsx
Company management
- Company list route
src/app/(admin)/companies/page.tsx - Company table
src/app/components/company-table.tsx - Company detail route
src/app/(admin)/companies/[id]/page.tsx - Company information
src/app/components/company-info.tsx - Company promotions
src/app/components/company-promotions.tsx - Company form
src/app/components/company-form.tsx - Promotion form
src/app/components/promotion-form.tsx
Dashboard analytics
- Sales summary
src/app/(admin)/dashboard/@sales/page.tsx - Promotion summary
src/app/(admin)/dashboard/@promotions/page.tsx - Country breakdown
src/app/(admin)/dashboard/@countries/page.tsx - Category breakdown
src/app/(admin)/dashboard/@categories/page.tsx - Summary statistics
src/app/(admin)/dashboard/@stats/page.tsx - New companies view
src/app/(admin)/dashboard/newCompanies/page.tsx
Shared UI and data
- Sidebar navigation
src/app/components/sidebar.tsx - CRM API client
src/lib/api.ts - Query prefetch cache
src/lib/utils/getQueryClient.ts - Count aggregation
src/lib/utils/getCountById.ts - Page header
src/app/components/header.tsx - Toolbar and search
src/app/components/toolbar.tsx - Search input
src/app/components/search-input.tsx - Action buttons
src/app/components/button.tsx - Form controls
src/app/components/input-field.tsx - Logo uploader
src/app/components/logo-uploader.tsx - Status label
src/app/components/status-label.tsx - Dashboard card
src/app/components/dashboard-card.tsx - Stat card
src/app/components/stat-card/stat-card.tsx - Summary table
src/app/components/summary-table.tsx - Summary table header
src/app/components/summary-table-header.tsx - Summary table cell
src/app/components/summary-table-cell.tsx
Other components
- Admin user
- MockAPI service
Connections 48
- Admin user → Admin shell: opens admin
- Admin shell → Sidebar navigation: renders
src/app/(admin)/layout.tsx - Admin user → Company list route: browses companies
- Company list route → Company table: renders
src/app/(admin)/companies/page.tsx - Company list route → CRM API client: prefetches companies
src/app/(admin)/companies/page.tsx - Company list route → Query prefetch cache: gets query client
src/app/(admin)/companies/page.tsx - Company table → CRM API client: loads company data
src/app/components/company-table.tsx - Admin user → Company detail route: opens company
- Company detail route → Company information: renders
src/app/(admin)/companies/[id]/page.tsx - Company detail route → Company promotions: renders
src/app/(admin)/companies/[id]/page.tsx - Company detail route → CRM API client: prefetches record and promotions
src/app/(admin)/companies/[id]/page.tsx - Company detail route → Query prefetch cache: gets query client
src/app/(admin)/companies/[id]/page.tsx - Company information → CRM API client: loads company
src/app/components/company-info.tsx - Company promotions → CRM API client: loads promotions
src/app/components/company-promotions.tsx - Company promotions → Promotion form: displays promotions
- Admin user → Company form: adds company
- Company form → CRM API client: creates company
src/app/components/company-form.tsx - Company form → Action buttons: uses
src/app/components/company-form.tsx - Company form → Form controls: uses
src/app/components/company-form.tsx - Company form → Logo uploader: uses
src/app/components/company-form.tsx - Company form → Status label: uses
src/app/components/company-form.tsx - Admin user → Promotion form: adds promotion
- Promotion form → CRM API client: creates promotion
src/app/components/promotion-form.tsx - Promotion form → Action buttons: uses
src/app/components/promotion-form.tsx - Promotion form → Form controls: uses
src/app/components/promotion-form.tsx - Promotion form → Logo uploader: uses
src/app/components/promotion-form.tsx - CRM API client → MockAPI service: sends HTTP requests
src/lib/api.ts - Dashboard page → Page header: renders
src/app/(admin)/dashboard/page.tsx - Admin user → Dashboard page: views dashboard
- Sales summary → CRM API client: fetches sales
src/app/(admin)/dashboard/@sales/page.tsx - Sales summary → Dashboard card: renders
src/app/(admin)/dashboard/@sales/page.tsx - Sales summary → Summary table: renders
src/app/(admin)/dashboard/@sales/page.tsx - Sales summary → Summary table header: renders
src/app/(admin)/dashboard/@sales/page.tsx - Sales summary → Summary table cell: renders
src/app/(admin)/dashboard/@sales/page.tsx - Promotion summary → CRM API client: fetches promotions
src/app/(admin)/dashboard/@promotions/page.tsx - Promotion summary → Dashboard card: renders
src/app/(admin)/dashboard/@promotions/page.tsx - Promotion summary → Summary table: renders
src/app/(admin)/dashboard/@promotions/page.tsx - Promotion summary → Summary table header: renders
src/app/(admin)/dashboard/@promotions/page.tsx - Promotion summary → Summary table cell: renders
src/app/(admin)/dashboard/@promotions/page.tsx - Country breakdown → CRM API client: fetches country and company data
src/app/(admin)/dashboard/@countries/page.tsx - Country breakdown → Count aggregation: counts by country
src/app/(admin)/dashboard/@countries/page.tsx - Country breakdown → Dashboard card: renders
src/app/(admin)/dashboard/@countries/page.tsx - Category breakdown → CRM API client: fetches category and company data
src/app/(admin)/dashboard/@categories/page.tsx - Category breakdown → Count aggregation: counts by category
src/app/(admin)/dashboard/@categories/page.tsx - Category breakdown → Dashboard card: renders
src/app/(admin)/dashboard/@categories/page.tsx - Category breakdown → Stat card: renders
src/app/(admin)/dashboard/@categories/page.tsx - Summary statistics → CRM API client: fetches summary stats
src/app/(admin)/dashboard/@stats/page.tsx - New companies view → CRM API client: loads new companies