# Walkthrough - Reporting & Analytics Module

The Reporting & Analytics module for SchoolAdmin is now fully implemented. This module provides a centralized hub for monitoring institutional health across academics, finance, and attendance.

## Key Features

### 1. Unified Analytics Dashboard
A new "Reporting & Analytics" section has been added to the sidebar, providing quick access to all report types. The **Overview** page features summary cards and a "Revenue vs. Expenses" bar chart.

### 2. Academic Performance Reports
Provides insights into student and class performance:
- **Class Performance**: Horizontal bar chart showing average scores across all classes.
- **Subject Performance**: Polar area chart identifying strengths and weaknesses across different subjects.
- **Top 10 Students**: A ranked leaderboard of the highest-performing students in the school.

### 3. Financial Summaries
A comprehensive view of the school's financial status:
- **Revenue vs. Expense Trend**: Multi-line chart showing monthly cash flow.
- **Arrears Tracking**: Quick view of outstanding balances from all invoices.
- **Detailed Monthly Breakdowns**: Tabular listings of income and spending.

### 4. Attendance Analytics
Visualizing presence trends over the last 30 days:
- **Student Attendance**: Line chart showing daily attendance rates.
- **Staff Attendance**: Bar chart tracking teacher and staff presence.
- **Key Metrics**: Displaying overall term averages against institutional targets.

### 5. Custom Report Generator
A flexible tool for administrators to build their own reports:
- Filter by **Report Type** (Performance, Fees, Attendance).
- Narrow down by **Class** or **Subject**.
- Define **Date Ranges** for historical analysis.
- Print-ready result tables with export options.

## Technical Details

- **Controller**: [ReportController.php](file:///c:/Users/User/OneDrive%20-%20dynamicconsult.co.ke/Institution%20Axis%20System/institution-axis/app/Http/Controllers/SchoolAdmin/ReportController.php)
- **Visuals**: Powered by **Chart.js** via CDN.
- **Data aggregation**: Optimized Eloquent queries with DB-level averages and sums.

## How to Verify
1. Log in as a **School Admin**.
2. Navigate to **Reporting & Analytics** in the sidebar.
3. Explore the **Academic**, **Financial**, and **Attendance** tabs to see the charts in action.
4. Use the **Custom Report Builder** to generate a "Student Performance Report" for a specific class.

> [!TIP]
> Use the **Print** button on the Custom Report results page to generate physical copies of your analytics!
