Naalya Handbook
Feature tour

Feature tour

Find the route folder and query domain behind each part of the Hub, from the staff hubs to the portals and the platform console.

Use this page when you know a feature by what it does on screen and need to find its code. It does not re-explain the patterns (the data layer, the design system, side panels and surfaces). It points you at the right folder and says what you will find there.

The product is five experiences sharing one codebase. Which one a person lands in depends on who they are.

Who routes where

Every signed-in user passes through getUserDestination, which reads their user type and sends them to the right home. There are five types:

src/lib/auth/get-user-destination.ts
switch (me.user.type) {
  case 'platform_admin': return { to: '/platform/hub' }
  case 'guest':          return { to: '/guest' }
  case 'student':        return { to: '/student/hub' }
  case 'guardian':       return { to: '/guardian/hub' }
  case 'staff': {
    // school hub when they can see the school dashboard, else their campus hub
    if (hasSchoolDashboard(me)) return { to: '/staff-hub/school/hub' }
    return { to: '/staff-hub/campus/$campusId/hub', params: { campusId } }
  }
}

Staff are the case with a branch. If they hold school_dashboard read (or manage all), they land in the school hub. Otherwise they land in the campus hub for their assigned campus, and if they have neither, a no-campus fallback. User types and Permissions cover the mechanics. For finding code, the user type is what decides the route tree.

The academic structure, briefly

Most of what staff manage hangs off one nested tree: School → Campus → (Academic Year → Term → Stream) → Class → Subject → Enrollment. Almost every route and query domain below is a view onto one node of that tree. Inside the campus hub, every year-scoped view reads the viewing academic year from the URL. The product explains each level. Here, it is enough to know that the folders mirror the tree.

The five areas

Each area has its own page, listed in the order most newcomers need them. The card says who uses the area and where its routes start, so you can pick the right page before you open it.

Two source trees that matter

Wherever a feature lives, it is almost always split across the same two trees.

Routes live under src/routes/_authenticated/. The folder names read like a sitemap: staff-hub/school/, staff-hub/campus.$campusId/, platform/, guest/, student/, guardian/. The $campusId in a folder name is a route param, which is how one set of campus pages serves every campus.

src/routes/_authenticated/ (shape)
staff-hub/school/{students,staff,campuses,inquiries,jobs,...}
staff-hub/campus.$campusId/{subjects,classes,classrooms,cbt-exams,gradebook,schemes-of-work,...}
platform/{schools,operators,curriculum}
guest/{admissions,jobs}   student/hub   guardian/hub

Data lives under src/queries/<domain>/, one folder per domain: student, staff, campus, enrollment, cbt-examination, application, job, and so on. A page that needs data reaches into the matching query domain rather than calling the API directly. The data layer has the full convention.

A page is usually a route folder plus a query domain

To find a feature, look in two places: the route folder under src/routes/_authenticated/ for the UI, and the matching folder under src/queries/ for the data. The names line up: students routes pair with the student query domain.

Shared UI in every area

Three families of shared components appear in every area:

  • src/components/data-tables/: the list views (students, staff, applications, exams). See Data tables.
  • src/components/side-panels/ and src/components/surfaces/: the slide-in panels and modal surfaces used to view, create, and edit records. See Panels and surfaces.
  • src/components/navigation/: the sidebars, navbars, and breadcrumbs for each experience (admin-staff.*, guardian.*, platform.*).

Each area page lists the routes and query domains it owns, and which of these shared pieces it uses.

On this page