Skip to content

Case study 03

School ERP

Most schools in Bangladesh still run on paper registers, spreadsheets and desktop software: fees reconciled by hand, results tabulated in Excel, and guardians hearing about absences days late. School ERP puts a school's academics, finance, people and communication on one affordable, mobile-first platform in Bangla and English. A school signs up and configures itself (sessions, classes, grading rules, fee heads, roles) without a sales call, and every school's data is isolated by PostgreSQL row-level security in a single shared deployment. The first release targets a pilot with a handful of schools: student records, attendance, exams and results with Bangladesh GPA grading, fee collection, notices and a guardian portal.

At a glance

Status: In Progress

Role
Founder & sole engineer
Type
Own product
Domain
EdTech, SaaS
Focus
School Management, ERP, Multi-tenancy, Row-level Security, Localization
Stack
  • Next.js
  • React
  • NestJS
  • PostgreSQL
  • TypeORM
  • Redis
  • BullMQ
  • TanStack Query
  • Tailwind CSS
  • Docker
Architecture: Tenant isolationDashboard to API (HTTPS); API to Tenant context (scope); Tenant context to PostgreSQL (RLS); API to Job queue (enqueue); Job queue to Workers; Workers to PostgreSQL (writes)HTTPSscopeRLSenqueuewritesUIDashboardNext.jsSVCAPINestJS · TypeORMSVCTenant contextper requestDBPostgreSQLrow-level securityMQJob queueBullMQ · RedisJOBWorkersnotices · reports
Fig. 03 School ERP architecture: Tenant isolationSolid: request · dashed: async · dashed box: external

What School ERP does

  • Self-serve signup and a setup wizard, so a school can be running within a day
  • Academic structure: sessions, shifts, classes, sections, subjects and teacher assignments
  • Student and guardian records, with Excel import
  • Mobile attendance and student leave
  • Exams and results with Bangladesh GPA grading and report-card PDFs
  • Fee heads, invoices, counter collection, receipts and dues
  • Notices, in-app notifications and email
  • A web portal for guardians and students
  • Role-based access with configurable roles, including a managing-committee role
  • Bangla and English throughout
  • A dashboard sidebar each school can configure

The problem

A school ERP touches admissions, classes, exams, fees, staff and guardians, and most schools in Bangladesh still do all of it on paper and in spreadsheets. To be affordable it has to serve many schools from one deployment, and a single missing WHERE clause must never leak one school's students to another.

Approach

Isolation is enforced by the database, not by convention. Each request sets the tenant in the session and PostgreSQL row-level security policies filter every tenanted table, so application code can't forget. Notices and long reports run on a queue.

Key decisions

  1. D1

    Row-level security

    Tenant filtering lives in PostgreSQL policies, so even a buggy query can't read across tenants.

  2. D2

    Configurable navigation

    The dashboard sidebar is data-driven, so each school sees only the modules it uses.

  3. D3

    Configurable, not custom

    Grading rules, fee heads, terms, shifts, roles and report cards are settings, so a new school never needs a code change.

Highlights

  • Tenant isolation with PostgreSQL row-level security on tenanted tables.
  • Next.js dashboard with a configurable sidebar, backed by a NestJS API.

My contributions

  • Came up with the product and wrote its product requirements: personas, tenancy model, module scope and a phased roadmap
  • Designed the multi-tenant architecture, with PostgreSQL row-level security on every tenanted table
  • Built the tenancy foundation: a NestJS API with TypeORM migrations and seeders, and a Next.js dashboard with a configurable sidebar
  • Set up local infrastructure with Docker Compose: PostgreSQL, Redis and a mail catcher

Build something similar

Planning a product like School ERP? Tell me what you're building and when you need it. I'll reply with questions or a proposal.