> For the complete documentation index, see [llms.txt](https://docs.automaktab.uz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.automaktab.uz/toliq-funksional-xarita/dashboard.md).

# Dashboard — To'liq Imkoniyatlar

## Route Logic (DashboardPage.tsx)

```
/dashboard
 ├── role === 'teacher' → TeacherDashboard
 ├── company_dashboard_v2 === false → LegacyMainDashboard
 └── default → CompanyRevenueDashboard
```

***

## 1. CompanyRevenueDashboard (V2, \~1700+ lines)

### Live Caption

* Vaqt, timezone (Asia/Tashkent), sana (uzbek static month table)
* Pulsating dot

### Greeting

* Vaxtga qarab: "Xayrli tong" / "Xayrli kun" / "Xayrli kech"
* Foydalanuvchi ismi

### Quick Actions (3)

* Add Payment (+)
* Add Student (+)
* Take Attendance (→ /attendance)

### Period Pills

* today / week / month

### Filter Bar

| Filter        | Type                         |
| ------------- | ---------------------------- |
| Sana oralig'i | Presets + manual calendar    |
| Filial        | Select (cross-tenant)        |
| Kurs turi     | Select (tezkor/avto\_maktab) |
| Granularity   | day / week                   |
| Refresh       | Button                       |

### KPI Tiles (4)

| Tile            | Vizual                               |
| --------------- | ------------------------------------ |
| Bugungi daromad | Gradient primary, count-up animation |
| Davr daromadi   | Sparkline line chart                 |
| Qarzdorlik      | Plain number                         |
| Davomat foizi   | Percentage                           |

### Revenue Trend

* AreaChart (Recharts)
* Last-point dot accent
* Expandable data table below

### Recovery Queue (Debtors)

* Priority dots: danger (red) / warning (yellow) / success (green)
* Based on: amount + overdue days

### Branch Performance Table

* Sortable columns: revenue, students, debt, collection rate

### Payment Status Donut

* SVG donut chart
* Segments: paid / partial / debt
* Center: coverage rate percentage

### Click-through

* KPIs → filtered payments/students page with context filters

***

## 2. LegacyMainDashboard

### Course Type Tabs

* all / tezkor / avto\_maktab

### Branch Filter

* Owner/dev only

### KPI Cards (4)

| Card            | Sparkline |
| --------------- | --------- |
| Bugungi daromad | ✅         |
| Faol talabalar  | ✅         |
| Qarzdorlik      | ✅         |
| Bitirganlar     | ✅         |

### Charts

| Chart               | Type             | Library  |
| ------------------- | ---------------- | -------- |
| Daromad trend       | AreaChart        | Recharts |
| Kurs mix            | PieChart         | Recharts |
| Top 5 filial        | BarChart         | Recharts |
| Filial solishtirish | Grouped BarChart | Recharts |

### Lists

* Recent payments (relative time)
* Activity pulse (audit log)

***

## 3. TeacherDashboard

### Cards

| Card           | Details                       |
| -------------- | ----------------------------- |
| Faol guruhlar  | Teacher's active groups count |
| Jami talabalar | Total students count          |
| Natijalar      | Passed / Failed / Studying    |

### Chart

* Horizontal bar chart: result stats

***

## Query Keys and Caching

| Hook                  | Key                            | StaleTime | Enabled                                    |
| --------------------- | ------------------------------ | --------- | ------------------------------------------ |
| useDashboardAnalytics | dashboardKeys.analytics        | 30s       | branchId \|\| isCrossTenant                |
| useTeacherAnalytics   | dashboardKeys.teacherAnalytics | 30s       | always (teacher)                           |
| useCompanyOverview    | dashboardKeys.company          | 30s       | branchId \|\| isCrossTenant \|\| companyId |
| usePaymentSnapshot    | paymentKeys.snapshot           | 30s       | branchId \|\| isCrossTenant                |

## Invalidatsiya

Barcha dashboard cachelari quyidagi mutationlardan so'ng invalidate bo'ladi:

* Student create/update/delete
* Payment create/update/delete


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.automaktab.uz/toliq-funksional-xarita/dashboard.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
