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

Page

PreviousNext

The route entry — auth, tenant, render the matching content component.

page.tsx is the route entry. It does not own logic — auth() + getTenantContext() (when needed) + render <XxxContent /> from the matching feature directory.

Rules

#Rule
1export default async function Page() — never arrow, never feature-named
2params and searchParams are Promise<...> in Next.js 16 — await them
3Import from @/components/<feature>/content (mirror pattern)
4Parallelise multiple awaits with Promise.all
5Export metadata or generateMetadata
6import type for Metadata, Locale
7No inline data fetching — move to queries.ts
8No inline try/catch — error.tsx boundaries handle exceptions

Canonical example

import type { Metadata } from "next"
 
import { getDictionary } from "@/components/internationalization/dictionaries"
import type { Locale } from "@/components/internationalization/dictionaries"
import StudentsContent from "@/components/school-dashboard/listings/students/content"
 
export const metadata: Metadata = { title: "Students" }
 
interface Props {
  params: Promise<{ lang: Locale }>
  searchParams: Promise<Record<string, string | string[] | undefined>>
}
 
export default async function Page({ params, searchParams }: Props) {
  const { lang } = await params
  const dictionary = await getDictionary(lang)
  return (
    <StudentsContent
      dictionary={dictionary.school.students}
      lang={lang}
      searchParams={searchParams}
    />
  )
}

Variants

VariantWhen
Server page with content delegateDefault for every dashboard route
generateMetadataTitle needs runtime data (entity name, locale)
Static pageNo params, no auth (marketing landing)
Auth pagePre-tenant flows (login, register, reset)
Parallel data fetchMultiple awaits — wrap in Promise.all

Parallel fetching

const [dictionary, school, applicants] = await Promise.all([
  getDictionary(lang),
  getSchoolById(id),
  getApplicantList(id),
])

Anti-patterns

  • Arrow function exports — use named function declarations.
  • Inline data fetching — move to queries.ts consumed by content.tsx.
  • Re-fetching what the layout provides.
  • Wrapping the body in <Suspense> — use loading.tsx.
  • Loading the entire dictionary — pass the slice (dictionary.school.students).
  • Different types for generateMetadata vs Page — share the Props interface.
  • Inline try/catch — let error.tsx handle exceptions.
  • Using Next.js's PageProps helper — define interface Props per page.

Naming

  • File: page.tsx.
  • Function: Page. Never LoginPage, Students, DashboardPage.
  • Default export, async by default.

See also

  • Pattern
  • Content
  • Queries
PatternLayout

On This Page

RulesCanonical exampleVariantsParallel fetchingAnti-patternsNamingSee also

Built by Databayt ·

Welcome to balqalam.

A great journey is about to begin.