MDH e-school ERP ยท Documentation

Role guide & training

What each role can do, how requests move through the platform, illustrated end-to-end journeys, and an optional embedded training video.

7User roles
10+Flow diagrams
5Migration steps

System architecture

All roles use the same Next.js app in the browser. It calls a single Express API (JSON over HTTPS). The API validates JWTs, resolves school scope, then reads and writes PostgreSQL and local file storage. Nothing in the database is shared across schools without an explicit schoolId filter.

Request path

Role-based users

Browsers ยท desktop & mobile

Super AdminSchool AdminTeacherStudentParentAccountantHR

Next.js web application

App Router ยท React ยท Tailwind ยท client auth & school headers

/erp-api/*JWT in headerX-School-Id

Express API

One HTTP service: routes per module (students, fees, exams, HR, โ€ฆ). Every school-scoped call is checked against the signed-in user and active school context.

Middleware chain

  • JWT validation
  • Resolve school / scope
  • Zod validation
  • Prisma data access

PostgreSQL

Single database, schoolId on rows for tenant isolation.

File storage

Uploads (documents, ID assets, exam media) on disk or compatible storage, paths referenced from the API.

Optional services (e.g. Redis cache, email SMTP, payment gateways) connect from the API layer only โ€” not from the browser.

MDH ERP system architecture โ€” Next.js frontend, Express API, PostgreSQL
BROWSERNext.js 14React ยท Tailwind ยท TypeScriptHTTPS/JWTEXPRESS APIJWT ยท Role guardschoolId scoped ยท Audit logsSQL ยท ORMDATABASEPostgreSQLMulti-tenant ยท File storageClient layerBusiness logicPersistence layer

๐Ÿ“ Save asset at:

frontend/public/images/guide/architecture-overview.png

End-to-end flows

Step-by-step visuals for the main journeys in the product. Each diagram renders inline โ€” no external engine required.

Sign-in and school context

Most routes require authentication; super-admin flows add an explicit school context step.

Authentication path

Open login

MDH School ERP sign-in

Email & password

Submitted to /auth/login

Valid JWT?
Yes โ†’ continueNo โ†’ error UI

Dashboard

Shell & nav by primaryRole

After login โ€” school context

Super Admin?
Yes โ†’ pick schoolNo โ†’ school on token

Schools โ†’ Open as context

Sets X-School-Id for this session

School-scoped screens

Fees, students, exams, etc. for that tenant

Other roles

School is already on the JWT and/or header from login โ€” no extra context step.

Admission โ†’ enrollment โ†’ class

Public enrollment forms feed admin review; approved students become first-class records in the school.

Admission โ†’ enrollment โ†’ class

1

Public / parent

Submit admission

Open enrollment form for school code

2

System

Queue application

Visible in student registrations

3

School admin

Review & approve

Check documents & eligibility

4

System

Create student

Profile + section assignment

5

Family

Access portals

Student / parent login linked

Fees: structure โ†’ assignment โ†’ payment

Accountants configure structures; families pay through the portal when gateways are enabled.

Fee lifecycle

Setup

  • Fee structure
  • Assign to class / student

Payment

  • Open Fees (parent or student)
  • Pay online or record offline

Post-payment

  • Receipt & ledger

๐Ÿ“ Save asset at:

frontend/public/images/guide/flows-admission.png | frontend/public/videos/guide/flows-walkthrough.mp4
SUPER ADMIN

Super admin platform loop

Monitor platform SaaS health across schools first; switch into tenant-scoped work only when needed.

SCHOOL ADMIN

School admin operational loop

Run the school day: setup academic structure, manage students, handle operations, and coordinate HR/finance.

TEACHER

Teacher daily teaching loop

Assignments, attendance, assessments, and online exams share the same section-aware permissions.

ACCOUNTANT

Accountant finance loop

Keep fee collection and invoices consistent: configure structures, record payments, and reconcile receipts.

HR

HR staff-org loop

Organize employees by department and job title, then manage leave and payroll/letters from the HR workspace.

STUDENT

Student visibility loop

View timetable, attendance, fees, exams, and homework through personal, academic-year-scoped screens.

PARENT

Parent visibility loop

Parents stay on child-specific surfaces plus fees and school messages.

Migrating from another ERP

Schools often replace an older product mid-year or between sessions. MDH is multi-tenant: every row is scoped to a schoolId, and admission, registration, and employee numbers are generated per school so you will not collide with other tenants.

Signed-in schools

After login, open Data migration to initiate the checklist and update your school's migration phase.

๐Ÿ“ Save asset at:

frontend/public/images/guide/migration-roadmap.png | frontend/public/videos/guide/migration-walkthrough.mp4

Actions by role

Navigation in the app is filtered by primaryRole. The list below matches the modules wired in the shell.

๐Ÿ›๏ธ

SUPER ADMIN

Platform owner

๐ŸŽ“

SCHOOL ADMIN

Principal / operations

๐Ÿ“–

TEACHER

Class & subject teacher

๐Ÿ’ณ

ACCOUNTANT

Finance office

๐Ÿ‘ฅ

HR

Human resources

๐ŸŽ’

STUDENT

Learner portal

๐Ÿ‘จโ€๐Ÿ‘ง

PARENT

Guardian portal

๐Ÿ“ Save asset at:

frontend/public/images/guide/roles-overview.png | frontend/public/videos/guide/roles-walkthrough.mp4

Departments & titles (HR)

HR uses a staff-org catalog to group employees by department and designation / job title. This matches the HR โ€œAdd employeeโ€ form and the fields stored on each employee record.

HR staff-org

Departments + job titles model

Expand for catalog + save rules

๐Ÿ“ Save asset at:

frontend/public/images/guide/departments-catalog.png | frontend/public/videos/guide/departments-walkthrough.mp4

Training video

Record your walkthrough, upload it to YouTube or another host, then point the app at the public URL.

Embed your video

Set NEXT_PUBLIC_ERP_TRAINING_VIDEO in frontend/.env.local to a full YouTube watch URL or embed URL. Rebuild or restart next dev after changing.

Video placeholder

Add NEXT_PUBLIC_ERP_TRAINING_VIDEO to show an embedded video here.

Ready to get started?

Sign in to your account or subscribe to set up your school in minutes.