A school dashboard is a permissions problem, not a UI problem

Two school management systems, sixteen pages, four kinds of staff. What actually decided the design was not the components, it was who is allowed to see which row.

Articles

November 29, 2026· 8 min readFull StackReactTypeScriptExpressMongoDBPermissions

I built two school management systems: newTown-school-dashboard and royal-school-admin-dashboard, each with its own Node backend. Sixteen pages: students, teachers, classes, courses, attendance, exams, grades, finance, library, reports, schedule, student affairs, documents, events, settings, teacher profiles.

The screenshots look like a UI project. It was not. Almost every decision came from two questions: who is allowed to see this, and how much of it is there.

Hiding a link is not a permission

The nav is built from a role, so a teacher never sees Finance and an accountant never sees Grades. That is the part everyone remembers to do, and it is the part that provides zero security, because the API is still sitting there answering anyone with a token.

So the same rule exists twice, on purpose:

  • The client filters the menu and the routes, so the app does not show people doors they cannot open.
  • The server checks the role on every route, and re-checks ownership on the row, because a teacher may read their own class and not another one.

The second check is the one that matters. A route like /api/grades?class=8B has to answer with the rows that user may see, not with everything and a filter applied in the browser. I learned that the boring way: filtering on the client is a habit that survives right up to the first person who opens dev tools.

Attendance is a bulk write problem

Attendance looks like a checkbox grid. A class of thirty students times a month of school days is around six hundred records. Saving one request per student is six hundred round trips, and the teacher watches a spinner.

So the client sends the whole day as an array, and the server writes it with one bulk upsert keyed on student, class and date. Re-saving the same day has to update, not duplicate, which is exactly what an upsert with a compound key gives you.

The other rule I had to add: attendance for a past day is locked after a short window. Not because the database cares, but because a report that can change retroactively is not a report.

Grades need the server to do the work

A grades table for one class is fine in the browser. A grades table for a whole stage, across terms, with filters, is not. The fix was ordinary: paginate on the server, filter on the server, and return counts with the page so the UI can show "1–25 of 412" without a second request.

Charts come from the same aggregated numbers, not from the raw rows. Sending four hundred rows to the browser to draw a bar chart is how a dashboard gets slow in a school with two thousand students.

Finance needs a paper trail

This is the page I was most careful with. Invoices and payments are never edited in place. A correction is a new entry that points at the old one, and the balance is derived.

The reason is not technical purity. It is that at the end of the month someone asks why a number changed, and "the row was edited" is not an answer you can give a school accountant. Append, do not overwrite, and the question answers itself.

The pieces I would keep

  • shadcn-style components on Radix: dialogs, tabs, selects and tables that are accessible without me writing focus management.
  • recharts for the dashboard charts, kept to three chart types.
  • xlsx in the browser for the term export: the administration gets a file, and the server does not run a background job.
  • An error boundary per page, so one broken page shows an error card instead of a white screen.
  • helmet, rate limiting and express-validator on the API. Three lines of setup, and they close the obvious holes.

The one thing I got wrong

In the first version I cached the session client-side and encrypted it with crypto-js. It felt safer than plain storage. It was not: the key is in the same bundle as the ciphertext, so anyone who can read the storage can read the key too. It is obfuscation wearing a security costume.

The right answer is the one I used in the store project: an httpOnly cookie the JavaScript cannot read at all, plus a server route that says who the current user is. Encryption in the browser does not replace that, and I would remove crypto-js from the project today.

What I would add next

Server state is fetched with axios inside effects, and every page repeats the loading and error handling. A query library would remove that duplication and give me caching and refetching for free. That is the first refactor I would do, before adding another page.

Two repos, two schools, one lesson: the components are the easy part. The rules about who sees what, and the shape of the data at scale, are the product.

→ All articles