Naalya Handbook
Feature tour

Admissions and recruitment

The inbound pipelines, student applications, job vacancies and applicants, and website inquiries with AI answers.

Three different kinds of stranger want something from a school: a family applying for a place, a candidate applying for a job, and a website visitor asking a question. The Education Hub treats all three as inbound pipelines, and they share one shape. Each has a guest side where the outsider fills in a form and tracks their status, and a staff side where someone inside the school reviews what came in and pushes it forward.

Once you see that mirror, guest submits, staff reviews, the three features stop looking like three apps and start looking like one pattern wearing three hats. This page is the map: what each pipeline does, and where its code lives.

Guests are a real user type

The guest area lives under src/routes/_authenticated/guest, behind a requirePermission({ userType: 'guest' }) guard. An applicant is a logged-in user, just a different user type from staff. See User Types for how that split works.

The guest landing page sets the tone, it greets the applicant by name and offers three doors:

src/routes/_authenticated/guest/index.tsx
const actionButtons = [
  { title: 'Admission Applications', path: '/guest/admissions', icon: TaskEdit01Icon },
  { title: 'Job Applications', path: '/guest/jobs', icon: WorkIcon },
  { title: 'My Letters', path: '/guest/letters', icon: Mail02Icon },
]

Admissions

The first pipeline is student admissions. A family applies for a place; the school reviews the application, tracks the application fee, and records a decision.

Guest side: families apply and track status at /guest/admissions. The multi-step form and the per-application detail view live in src/routes/_authenticated/guest/admissions/ (the -partials/ folder holds each step).

ApplicationPage treats the form as read-only when application.status is anything other than draft. In that state it shows Download and Print in a two-column row. Download calls useDownloadAdmissionApplicationPdf and toasts Could not download your application when that call fails. Print calls useAdmissionApplicationPreview, which runs queryClient.fetchQuery on ApplicationOptions.preview. That query has staleTime: 0 and ApplicationQuery.preview requests the HTML as text with the bearer token. The HTML goes into PrintFrame, a hidden sandboxed iframe (allow-scripts allow-modals). When the frame loads it posts { type: 'naalya-preview-print' } to its own window. A failed fetch toasts Could not print your application. The staff Print control on Review admission applications is a different screen. Read at Hub c7143aa1e1ee84775012fbd3b05c37023142902b. The buttons were not clicked.

Staff side: staff review every application at /staff-hub/school/admissions. The route itself is tiny: it asks one hook for the count, shows an empty state when nobody has applied, and otherwise hands off to a data table.

src/routes/_authenticated/staff-hub/school/admissions.tsx
const { applications, loadingApplications } = useAdmissionApplications()
const showEmptyState = applications?.totalCount === 0 && !loadingApplications
// ...
{!showEmptyState && <AdmissionApplicationDataTable />}

The real work is in the data table at src/components/data-tables/admission-applications/. It's a server-paginated table: the columns.tsx file declares the columns (reference, name, campus, class, status, started-at, plus a row-actions cell), and filter.tsx drives the query params sent to the API.

src/components/data-tables/admission-applications/columns.tsx
columnHelper.accessor('reference', {
  header: 'Ref',
  cell: (info) => (
    <Link to="/staff-hub/school/admissions/$applicationId"
      params={{ applicationId: info.row.original.id }}>
      {info.getValue()}
    </Link>
  ),
})

Clicking a reference opens the detail route admissions_.$applicationId.tsx, where staff see the full application and record a decision.

Two data sources, one screen

Admissions reads from two query modules: queries/application for the applications themselves, and queries/transaction for the application-fee payment attached to each one. When you trace a value on the screen, check which of the two it came from.

Recruitment

The second pipeline is jobs. Same mirror, but now the school is the one posting, and the outsider is a candidate.

Staff side: at /staff-hub/school/jobs, staff create vacancies and review applicants. The list route opens a surface to create a new vacancy and renders the vacancies in a data table:

src/routes/_authenticated/staff-hub/school/jobs/index.tsx
const { openSurface } = useSurface()
const { vacancies, loadingVacancies } = useStaffJobVacancies()
// New vacancy → openSurface(CreateJobVacancy)
// Otherwise → <JobVacanciesDataTable data={vacancies ?? []} />

Drilling into a single vacancy (jobs/$vacancyId) lists the people who applied to that listing.

Guest side: candidates browse open roles and apply at /guest/jobs. The browse page (guest/jobs/index.tsx) gives them search, department and employment-type filters, and a grid-or-list view; submitting a role runs the multi-step application form in the -partials/ folder.

Three query modules for one feature

Jobs spreads across queries/job (the public vacancy listing a guest browses), queries/staff-jobs (the staff-side management view), and queries/job-application (an individual candidate's submission). Reach for the one that matches the side of the mirror you're on.

The application form itself is the textbook case for Forms: TanStack Form for state, Zod for validation, one schema per step. If you're adding a field, that's the page to read.

Enquiries

The third pipeline is the website enquiry list. Staff open it at /staff-hub/school/enquiries. At Hub 9e84f4c33d5f1a9b9ae84bd7f1e6663598504073 the route requires the admissions feature, staff, and list on enquiry. The default tab is the website list and calls listEnquiries. The AI tab is mounted when the viewer can list social_connection, and it calls listSocialAgentQuestions. There is no inquiries route and no overview tab in that index. The row detail was not opened, so the status and assign methods on a single enquiry stay on Enquiries.

The AI list is the queue of questions the assistant handed to staff. An earlier read of queries/social-agent-question shows answer. That file was not re-opened at this pin:

src/queries/social-agent-question/social-agent-question.query.ts
readonly answer = async (id: string, response: string) =>
  this.exec(this.op.answerSocialAgentQuestion({ id }, { response }))

See The AI Assistant for where these answers come from and how the model fits into the platform.

Enquiry spelling

The staff route and the empty title use enquiries. The generated operations use the same spelling (listEnquiries).

The shared shape

Step back and the three pipelines rhyme. Every one of them is the same handful of moving parts:

PipelineGuest routeStaff routeQuery modules
Admissions/guest/admissions/staff-hub/school/admissionsapplication, transaction
Recruitment/guest/jobs/staff-hub/school/jobsjob, staff-jobs, job-application
Enquirieswebsite form/staff-hub/school/enquiriesenquiry, social-agent-question

Learn one and you've mostly learned all three: a guest-side form, a staff-side table or tabs, and a query module per concern.

Where to go next

On this page