Skip to main content

Dashboard Statistics

This section covers the API endpoints for managing dashboard statistics in the admin panel.

Get Dashboard Overview

GET /v1/admin/dashboard/statistics

Returns comprehensive statistics and analytics data for the dashboard.

Query Parameters

ParameterTypeDescriptionValidation Rules
fromstringStart date for statisticsOptional, format: Y-m-d, default: start of year
tostringEnd date for statisticsOptional, format: Y-m-d, default: end of year

Response

{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"customers_chart": {
"percentage": "217%",
"total": "1.1K",
"status": "green",
"data": [
[
"يناير",
1147
],
[
"مارس",
1
]
]
},
"orders_chart": {
"percentage": "2.5%",
"total": "4K",
"status": "green",
"data": [
[
"يناير",
"4K"
],
[
"مارس",
"1"
]
]
},
"net_profit_chart": {
"percentage": "47%",
"total": "475.3K",
"status": "green",
"data": [
[
"يناير",
"475.3K"
]
]
},
"total_visits_by_country": [
{
"name": "السعودية",
"percentage": "65.1%"
},
{
"name": "العراق",
"percentage": "4.7%"
},
{
"name": "الإمارات",
"percentage": "4.1%"
},
{
"name": "الجزائر",
"percentage": "3.3%"
},
{
"name": "الكويت",
"percentage": "3.0%"
},
{
"name": "المغرب",
"percentage": "2.6%"
}
],
"best_selling": {
"most_sold": {
"name": "قانون الجذب",
"sales": "31.8K"
},
"highest_rated": {
"name": "DCE تطوير الجسد المشاعري للاطفال",
"rating": "5"
},
"most_profitable_courses": [
{
"name": "دايزي- الوعي الزواجي",
"total": "2.2M"
},
{
"name": "آفا - الوعي الطفولي",
"total": "1.4M"
},
{
"name": "ابنوس",
"total": "1.2M"
},
{
"name": "مسرح الاحلام",
"total": "1.1M"
},
{
"name": "الخوف",
"total": "1.1M"
}
]
},
"customers": {
"new_customers_today": "0",
"newest_customers": "0",
"active_customers": "0",
"subscribed_customers": "84.7K",
"total_customers": "184.4K"
},
"articles": {
"total_articles": 225,
"total_active_articles": 224,
"most_viewed_article": {
"name": "توقف",
"views": 972
}
},
"courses": {
"total_courses": 190,
"total_active_courses": 146,
"most_ordered_course": {
"name": "الثقة بالنفس - العار",
"orders_count": "5.3K"
}
},
"bundles": {
"total_bundles": 39,
"total_active_bundles": 13,
"most_ordered_bundle": {
"name": "باقة تنظيف المشاعر الأساسية",
"orders_count": "1.7K"
}
},
"publications": {
"total_publications": 8,
"total_active_publications": 8,
"most_viewed_publication": {
"name": "حدثني فقال",
"views": 921
}
}
},
"status_code": 200
}

The response includes:

  1. Customers Chart Data

    • Monthly customer growth statistics
    • Percentage change compared to previous period
    • Total customer count
    • Status indicator (green for growth, red for decline)
  2. Orders Chart Data

    • Monthly order statistics
    • Percentage change compared to previous period
    • Total orders count
    • Status indicator
  3. Net Profit Chart Data

    • Monthly profit statistics
    • Percentage change compared to previous period
    • Total profit amount
    • Status indicator
  4. Visits by Country

    • Country name
    • Percentage of total visits
  5. Best Selling Statistics

    • Most sold course (name and sales count)
    • Highest rated course (name and rating)
    • Most profitable courses (name and total revenue)
  6. Customer Statistics

    • New customers today
    • Newest customers (within a week)
    • Active customers
    • Subscribed customers
    • Total customers
  7. Article Statistics

    • Total articles count
    • Active articles count
    • Most viewed article details
  8. Course Statistics

    • Total courses count
    • Active courses count
    • Most ordered course details
  9. Bundle Statistics

    • Total bundles count
    • Active bundles count
    • Most ordered bundle details
  10. Publication Statistics

    • Total publications count
    • Active publications count
    • Most viewed publication details