0%
balqalam Logo
balqalam
FeaturesCommunityPricingDocumentation
Login
  • Introduction
  • Pitch
  • Hogwarts
  • Live Demo
  • MVP
  • Roadmap
  • Launch Sprint
  • PRD
  • Get Started
  • Localhost
  • Architecture
  • Structure
  • Pattern
  • Page
  • Layout
  • Content
  • Types
  • Config
  • Actions
  • Queries
  • Authorization
  • Validation
  • Form
  • Table
  • Detail
  • Card
  • Util
  • Hooks
  • List Params
  • Views
  • README.md
  • ISSUE.md
  • Technology Stack
  • Database
  • File
  • CDN Assets
  • Entry Points
  • Dashboard
  • Authentication
  • Credentials
  • OAuth
  • Flow Diagrams
  • Multi-Tenancy
  • Offline
  • Onboarding
  • Onboarding Videos
  • Add Values
  • Admission
  • Application
  • Attendance
  • Compliance
  • Profile
  • Exams
  • Exam Wizard
  • Timetable
  • Classrooms
  • Notifications
  • Conference
  • LMS (Lumos)
Finance
  • Finance
  • Fee Management
  • Invoice
  • Wallet
  • Salary
  • Payroll
  • Timesheet
  • Expenses
  • Budget
  • Receipt
  • Accounts
  • Banking
  • Reports
  • Dashboard
  • Permissions
  • Messages
  • Integration Flow
  • Provision
  • AI Document Processing
  • Document Intelligence
  • Internationalization
  • Translation
  • Translation Guide
  • Icons
  • Docs Factory
  • Inspiration
  • Listings
  • Teachers
  • Students
  • Catalog
  • Library
  • Contributing
  • Code of conduct
  • GitHub Workflow
  • Database Seeds
  • Database Safety
  • Test Accounts
  • Playwright
  • Prettier
  • Block Rebound
Sales & GTM
  • Marketing Brief
  • Sales
  • Go-to-market
  • Marketing
  • Admission — Feature Spotlight
  • Pilot Program
  • Leads
  • Proposal
  • Outreach Templates
  • Case Study
  • Competitors
  • Landing-page teardown
  • Competitor FAQ
  • Business model
  • Shared economy
  • Traction
Fundraising & Ecosystem
  • Get Support
  • Investor Deck
  • Data Room
  • Investors
  • Accelerators
  • Incubators
  • Grants
  • Sponsors
  • Partners
  • Competitions & Hackathons
  • Universities & Training Centers

Dashboard

PreviousNext

Role-based dashboards for 8 user types, all sharing a 6-section layout with role-specific content.

The dashboard renders one of eight role-specific views — Admin, Developer, Principal, Teacher, Student, Guardian, Accountant, Staff — each composed from the same six unified sections. Routing happens via a switch in content.tsx; section components read the role and adapt content.

Server wrapper + client view

Admin, Student and Teacher follow a two-file split. The <role>.tsx file is a Server Component that does nothing but fetch — the role's dashboard data, quick look and weather in one Promise.all, plus the tenant's subdomain — and hand the result to a <role>-client.tsx view. Every widget the dashboard composes (MetricCard, ActivityRings, ScheduleItem, the charts) is already a client component, so keeping the view server-side only fragmented it into dozens of separate client boundaries.

The client view reads its copy from useDictionary() rather than a dictionary prop, which keeps section components independently composable. The server file still needs the dictionary for one thing: the two error fallbacks it can render before the client view ever mounts.

Parent, Principal, Accountant and Staff have not been split yet.

Section order

Every role renders these six sections in order. Section 2 is title-less.

#SectionComponent
1Upcoming + WeatherUpcoming + Weather
2Quick LookQuickLookSection
3Quick ActionsQuickActionsSection
4Resource UsageResourceUsageSection
5Invoice HistoryInvoiceHistorySection
6Financial OverviewFinancialOverviewSection

Role routing

// content.tsx
switch (userRole) {
  case "STUDENT":
    return <StudentDashboard {...props} />
  case "TEACHER":
    return <TeacherDashboard {...props} />
  case "GUARDIAN":
    return <ParentDashboard {...props} />
  case "STAFF":
    return <StaffDashboard {...props} />
  case "ADMIN":
  case "DEVELOPER":
    return <AdminDashboard {...props} />
  case "PRINCIPAL":
    return <PrincipalDashboard {...props} />
  case "ACCOUNTANT":
    return <AccountantDashboard {...props} />
  default:
    return <DefaultDashboard {...props} />
}

Directory layout

src/components/school-dashboard/dashboard/
├── content.tsx, client.tsx, actions.ts, config.ts, validation.ts, types.ts
├── admin.tsx, student.tsx, teacher.tsx, parent.tsx,
│   principal.tsx, accountant.tsx, staff.tsx
├── admin-client.tsx, student-client.tsx, teacher-client.tsx
├── upcoming.tsx, weather.tsx, quick-look-section.tsx,
│   quick-actions.tsx, quick-actions-config.ts,
│   resource-usage-section.tsx, invoice-history-section.tsx,
│   financial-overview-section.tsx, section-heading.tsx
├── metric-card.tsx, activity-rings.tsx, schedule-item.tsx,
│   announcement-card.tsx, progress-card.tsx, chart-card.tsx,
│   empty-state.tsx
├── attendance-chart.tsx, grade-chart.tsx, revenue-chart.tsx,
│   performance-gauge.tsx, weekly-chart.tsx, comparison-chart.tsx
├── header.tsx, loading.tsx, error-boundary.tsx,
│   search-command.tsx, notification-service.tsx,
│   project-switcher.tsx, transactions-list.tsx,
│   upgrade-card.tsx, info-card.tsx, delete-account.tsx
└── settings/  (content.tsx, user-name-form.tsx)

Showcase components (card-*.tsx, chart-*.tsx, stat-*.tsx, dashboard-showcase.tsx) document the widget library.

Upcoming flip card

Role-specific 3D flip card. Front shows primary content; back shows secondary.

RolePrimarySecondary
StudentAssignments due (with overdue)Next class info
TeacherNext class detailsPending grading, attendance due
ParentChildren's pending/overdueUpcoming events for kids
StaffUrgent tasks, pending requestsToday's priorities
AccountantPending payments, overdue invoicesFinancial deadlines
PrincipalCritical alertsToday's priorities, deadlines
AdminSystem alerts, pending approvalsUrgent notifications

Weather

Current temp, humidity, wind, rain chance + 6-day forecast. Refresh button. Falls back to mock data.

Resource usage metrics (4 per role)

RoleMetrics
StudentAssignment Completion, Attendance Rate, Grade Average, Library Books
TeacherClasses Taught, Students Count, Pending Grading, Assignments Created
ParentChildren Enrolled, Attendance Avg, Pending Tasks, Upcoming Events
StaffTasks Completed, Requests Processed, Approvals Pending, Efficiency
AccountantCollection Rate, Invoices Processed, Outstanding, Payments Today
PrincipalSchool Capacity, Staff Utilization, Budget Usage, Satisfaction
AdminSystem Usage, Storage, Active Users, API Calls

Invoice history visibility

RoleTitleShows
StudentFee HistoryOwn fee invoices
TeacherExpense ClaimsReimbursements
ParentChildren's FeesFees for all children
StaffExpense ReportsReimbursements
AccountantInvoice ManagementAll school invoices
PrincipalBudget InvoicesBudget-related
AdminSystem InvoicesAll platform invoices

Financial overview

RoleViewChart
StudentPersonal fee status, payment dueNo
TeacherDepartment budget if applicableNo
ParentCombined children's fee statusNo
StaffDepartment budget statusNo
AccountantRevenue, collectionYes — Revenue Collection
PrincipalSchool budgetYes — Monthly Budget
AdminPlatform metricsYes — Platform Revenue

Quick actions (4 per role)

RoleActions
Admin / DeveloperUsers, Settings, Reports, Analytics
PrincipalReports, Staff, Performance, Analytics
TeacherAttendance, Grades, Assignments, Timetable
StudentAssignments, Grades, Timetable, Messages
GuardianChildren, Grades, Attendance, Messages
AccountantInvoices, Fees, Reports, Receipts
StaffTasks, Requests, Schedule, Directory

Server actions

ActionReturnsUsed by
getDashboardSummary()All metrics aggregatedAdmin
getEnrollmentMetrics()Student countsAdmin, Principal
getAttendanceMetrics()Attendance ratesAdmin, Principal, Teacher
getStaffMetrics()Teacher countsAdmin, Principal
getAcademicPerformanceMetrics()GPA, exams, assignmentsPrincipal, Teacher
getAnnouncementsMetrics()Announcement countsAll
getClassesMetrics()Class counts, ratiosAdmin, Principal
getRecentActivities()Activity feedAdmin
getQuickActionsByRole()Role-specific actionsAll
getUpcomingDataByRole()Role-specific upcomingAll
getResourceUsageByRole()Role-specific metricsAll
getInvoicesByRole()Role-specific invoicesAll
getFinancialOverviewByRole()Role-specific financialsAll
getTeacherDashboardData()Teacher-specificTeacher
getStudentDashboardData()Student-specificStudent
getParentDashboardData()Parent-specificParent
getPrincipalDashboardData()Principal-specificPrincipal

Render pattern

Each role dashboard reduces to the same shell.

export async function RoleDashboard({ user, dictionary, locale }: Props) {
  const { schoolId } = await getTenantContext()
  const school = await db.school.findUnique({ where: { id: schoolId } })
  const subdomain = school?.domain ?? ""
 
  return (
    <div className="space-y-6">
      <div className="grid grid-cols-1 gap-6 lg:grid-cols-2">
        <Upcoming role="ROLE" locale={locale} subdomain={subdomain} />
        <Weather />
      </div>
      <QuickLookSection />
      <SectionHeading title="Quick Actions" icon={Zap} />
      <QuickActionsSection role="ROLE" locale={locale} subdomain={subdomain} />
      <ResourceUsageSection role="ROLE" />
      <InvoiceHistorySection role="ROLE" />
      <FinancialOverviewSection role="ROLE" />
    </div>
  )
}

Shared widgets

WidgetFilePurpose
SectionHeadingsection-heading.tsxUnified title with icon, badge, action
MetricCardmetric-card.tsxStat with icon, trend, drill-down
ActivityRingsactivity-rings.tsxApple-style concentric rings
ScheduleItemschedule-item.tsxTimetable entry with status
ProgressCardprogress-card.tsxGoal with progress bar
AnnouncementCardannouncement-card.tsxPriority-styled announcement
EmptyStateempty-state.tsxNo-data placeholder
ChartCardchart-card.tsxChart container wrapper
PerformanceGaugeperformance-gauge.tsxRadial single-metric gauge
WeeklyActivityChartweekly-chart.tsxWeekly bar chart
ComparisonLineChartcomparison-chart.tsxPeriod comparison
RevenueChartrevenue-chart.tsxRevenue vs expenses area

See also

  • Pattern
  • Multi-Tenancy
  • Layout
Entry PointsAuthentication

On This Page

Server wrapper + client viewSection orderRole routingDirectory layoutUpcoming flip cardWeatherResource usage metrics (4 per role)Invoice history visibilityFinancial overviewQuick actions (4 per role)Server actionsRender patternShared widgetsSee also

Built by Databayt ·

Welcome to balqalam.

A great journey is about to begin.