What is Shule?
Shule (Swahili: school) is a vertically integrated school management system designed specifically for East African K-12 schools, covering the full operational lifecycle from student admissions to leaving certificate generation. It runs as a SaaS platform on my-school.co.ke, with each customer school receiving an isolated tenant environment.
The platform replaces fragmented point solutions (separate fee-collection apps, paper registers, SMS-only parent communication, spreadsheet timetables) with a unified system where student records, academic results, attendance, fees, HR, and communications share a single source of truth. Events flow between modules: an absence automatically triggers a parent SMS; a fee payment updates a student's ledger and the bursar's dashboard simultaneously; a published report card queues PDF delivery to all guardians.
Market positioning
Key differentiators vs. generic SIS products
| Capability | Generic SIS | Shule |
|---|---|---|
| East African payment rails | Not available | M-Pesa, Airtel, MTN, Flutterwave, AzamPay |
| Government reporting | Manual export | KEMIS, TZ-EMIS, UG-EMIS auto-population |
| CBC curriculum | Not applicable | Strand/sub-strand assessments, competency bands, CBC report card |
| Multi-tenant isolation | Row-level tagging | Dedicated PostgreSQL schema per school |
| Timetable solver | Manual grid | Constructive + simulated annealing, TSC constraint validation |
| Safeguarding | None | CP case management, DSL workflow, SEND/IEP, wellbeing tracking |
| ZKTeco biometric | Not available | ZKTeco terminal integration for automated attendance |
System design
Shule is a microservices system: 14 independent FastAPI services, each owning a bounded domain, communicating via NATS JetStream for async events and a PostgreSQL-backed outbox for guaranteed delivery. A Next.js 15 frontend and an Expo mobile app consume the services through a typed API layer.
Multi-tenancy model
Each school is a completely isolated PostgreSQL schema named t_{tenant_slug}. This is schema-per-tenant isolation: stronger than row-level filtering and weaker than a separate database. Every table for a school's data lives in that schema; migrations run against all tenant schemas in sequence, guarded to be idempotent.
The platform schema shule_system holds the tenant registry, billing records, platform audit log, and operator CRM. The Caddy reverse proxy reads the subdomain (demo.my-school.co.ke) and passes the tenant slug as an HTTP header; the TenantSession dependency in each service resolves this header to the correct schema for every query.
Technology stack
Service-by-service capabilities
Each service is a standalone FastAPI application with its own database models, business logic, and REST API. Services communicate synchronously via HTTP (internal calls) and asynchronously via NATS JetStream events published through a transactional outbox.
Core — Students, Staff & School Administration
The Core service is the system of record for every person in the school: students, guardians, and staff. It also owns school settings, calendar events, admissions, alumni tracking, recruitment, and the platform-level operator console.
Academic — Timetable, Marks, Report Cards & Curriculum
The Academic service manages everything that happens in the classroom: timetable creation and publishing, grade books, CBC strand assessments, homework, lesson plans, exams, subject choices, and report card generation.
Timetable engine
The solver uses a constructive + simulated-annealing algorithm, deterministic by seed. It consumes teacher availability constraints, subject requirements per class, room types, and double-period rules. Clash validation uses CP-SAT. TSC teaching-load constraints (maximum lessons per teacher) are enforced at publish time.
Marks, reports & CBC
Attendance — Register, Biometric & Analytics
Attendance supports daily, session-by-session, and bulk mark modes. It integrates with ZKTeco biometric terminals for automated capture, and triggers guardian notifications on absence detection through the comms service.
Fees & Finance — Invoicing, Payments & Reporting
The most feature-dense service on the platform. Manages the complete school fee lifecycle: schedule creation, term invoice generation, payment collection across five payment rails, scholarship and bursary management, bank reconciliation, and statutory financial reporting.
Fee management
Payment rails
| Provider | Method | Markets | Notes |
|---|---|---|---|
| Safaricom M-Pesa | Daraja C2B, STK Push, paybill | KE | Per-tenant paybill + passkey configuration |
| Airtel Money | API collection | KE, TZ, UG | Callback + status polling |
| MTN MoMo | API collection | UG, other | OAuth 2 token management |
| Flutterwave | Card, bank, mobile | Multi-country | Initiate + verify + webhook |
| AzamPay | Mobile money | TZ | Tanzania-specific rail |
| Bank transfer | Statement upload + reconciliation | All | Auto-reconcile by reference number |
Defaulter management & collections
Procurement & bookshop
Human Resources
Full HR lifecycle management covering contracts, leave, payroll (Kenya), performance appraisal (TPAD and OPRAS), DBS/right-to-work compliance, CPD tracking, and cover request management.
Communications
Unified multi-channel messaging: in-app threads, SMS via Africa's Talking, WhatsApp Business Cloud API, push notifications, and broadcast campaigns. Absence alerts are event-driven from the attendance service via NATS.
Safeguarding, Behaviour & SEND
Sensitive-data module for child protection case management, DSL workflow, SEND/IEP records, behaviour incidents, wellbeing check-ins, and pastoral care. Access is role-gated to DSL and SENCO roles.
Library
Library catalogue management, loan tracking, MARC record import, reading progress tracking, and fine management.
Facilities, Assets & Visitors
Room bookings, asset register and tracking, maintenance request workflow, visitor sign-in/out, transport management, and health & safety checklists.
Sports & Co-curricular
Sports teams, fixtures, achievements, badges, and co-curricular clubs. Feeds into student portfolio for universities and employers.
Reports & Documents
WeasyPrint-based PDF generation for all formal school documents. All generated PDFs are stored in MinIO with a cryptographic verification token; any printed document can be verified online via /verify/{token}/{tenant}.
https://my-school.co.ke/verify/{token}/{tenant}. The token is HMAC-SHA256 signed with a serial number, document type, and document ID. Third parties (universities, employers) can verify document authenticity without contacting the school.
Scheduler & Workflow Automation
A Temporal worker service manages all time-based and event-driven workflows: automated attendance session creation, fee dunning, cover assignment, timetable scaffolding, and overdue notifications.
Portals by role
The Next.js 15 frontend routes users into distinct portal experiences based on their Keycloak role. All portals share a single deployment: the subdomain identifies the school, and the role determines the navigation tree and accessible pages.
| Portal | Role | Route prefix | Key pages |
|---|---|---|---|
| Admin / Staff | shule-admin, shule-head-teacher, shule-bursar, shule-support |
(dashboard)/ |
Dashboard, students, academic, attendance, fees, HR, comms, safeguarding, library, facilities, sports, reports, AI analytics, settings |
| Teacher | shule-teacher |
(teacher)/teacher/ |
Today's timetable, gradebook, homework, lesson plans, attendance, cover sessions, resources |
| Parent / Guardian | shule-parent, shule-guardian |
(parent)/parent/ |
Child profile, fees, grades, attendance, timetable, homework, report card, messages, notices, consent, goals, achievements, parent-teacher meetings, events |
| Student | shule-student |
(student)/student/ |
Timetable, grades, homework, report card, attendance, achievements, resources, portfolio, messages |
| Platform Admin | shule-super-admin |
(dashboard)/platform/ |
Tenant management, billing, system audit log, announcements, support tickets, event/outbox viewer |
Mobile app (Expo)
The Expo mobile app (iOS and Android) mirrors the teacher and parent portals, with offline capability for attendance marking and gradebook entry. Marks queued offline sync automatically when connectivity is restored.
USSD access
Fee balance enquiry and payment status are accessible via USSD short code (*384# pattern) using Redis-backed session state, enabling parents with feature phones to check balances without the web app.
Predictive intelligence
The AI service routes to LiteLLM (self-hosted on , proxying Claude/GPT/Llama based on configuration). AI features are additive; the platform operates fully without them if the LiteLLM endpoint is unreachable.
External systems & standards
Government education management systems
| System | Country | Capability |
|---|---|---|
| KEMIS | Kenya | Learner registration, term enrolment return, monthly attendance summary, CSV export |
| TZ-EMIS | Tanzania | Enrolment records, upsert and CSV export |
| UG-EMIS | Uganda | Enrolment records, upsert and CSV export |
| KNEC | Kenya | KCSE candidate registration, bulk register, confirmation |
| Ed-Fi | Standard | Students, staff, and school-association REST endpoints |
EdTech standards
Webhooks & event delivery
Schools can register outbound webhooks for any NATS event type. The delivery subsystem retries failed deliveries, maintains a delivery log with per-attempt status, and exposes a retry endpoint for manual replay.
API access
All service APIs follow REST conventions with JSON request/response bodies, UUIDv7 identifiers, and ISO 8601 timestamps. Authentication uses OAuth 2 Bearer tokens issued by Keycloak. Each service exposes OpenAPI docs at /docs (non-production environments). Rate limiting is handled at the Caddy layer.
Security architecture
Authentication & authorisation
Data isolation
Compliance features
shule-dsl or shule-senco roles. No safeguarding data is included in DSAR exports to non-authorised requesters. Audit entries are written for every access.
Hosting & deployment
The platform runs on a fleet of Contabo (EU) dedicated servers. The production app server is separate from the database host; a hot-standby replica runs continuously.
| Host | Role | Key services |
|---|---|---|
| App farm | 14 FastAPI services, Next.js, Caddy | |
| DB primary | PostgreSQL, nightly pg_dump per schema, 30-day retention | |
| DB hot standby | PG streaming replication, off-site backup rsync target | |
| Auth | Keycloak, SpiceDB, MinIO | |
| ML / Vault | LiteLLM , OpenBao, Ollama | |
| Observability | Stalwart SMTP, Prometheus, Grafana, Loki |
Deployment model
shule@*) managed by deploy-prod.sh/metrics)Observability
Every FastAPI service exposes Prometheus metrics at /metrics. Grafana () aggregates request rate, latency, error rate, and custom business metrics (invoice volume, attendance rates, NATS event lag). Loki collects structured JSON logs from all services. Sentry captures unhandled exceptions in both Python services and the Next.js frontend.
Roles, ports & conventions
RBAC role reference
| Keycloak role | Portal | Access level |
|---|---|---|
shule-super-admin | Platform console | Cross-tenant operator access, billing, tenant management |
shule-admin | Admin dashboard | Full school administration, all modules |
shule-head-teacher | Admin dashboard | Academic management, staff oversight, timetable |
shule-teacher | Teacher portal | Own classes, gradebook, attendance, lesson plans |
shule-bursar | Admin dashboard | Fees, payments, payroll, procurement |
shule-dsl | Admin dashboard | Safeguarding (CP cases, full access) |
shule-senco | Admin dashboard | SEND register, IEPs, interventions |
shule-librarian | Admin dashboard | Library catalogue and loans |
shule-support | Admin dashboard | Read-only support access across modules |
shule-parent | Parent portal | Own children only: fees, results, communications |
shule-guardian | Parent portal | Equivalent to parent, alternative guardian relationship |
shule-student | Student portal | Own profile only: timetable, results, homework |
Service port map
API conventions
/api/v1/{service}/{resource}2026-07-24T10:30:00+03:00){"error": "ERROR_CODE", "message": "..."}?page=1&page_size=50, response includes totalAuthorization: Bearer {keycloak_access_token}X-Tenant-ID header/docs (non-production) and /openapi.jsonEvent subjects (NATS)
| Subject pattern | Trigger |
|---|---|
shule.fees.invoice_created | Term invoice generated |
shule.fees.payment_received | M-Pesa / bank payment matched |
shule.attendance.absence_detected | Student marked absent in session |
shule.academic.report_card_published | Term report card published to portal |
shule.core.student_enrolled | New student accepted and enrolled |
shule.academic.timetable_published | New timetable version made live |
Consumer services subscribe to relevant subject patterns. Failed deliveries land in shule.dlq.* subjects, visible and replayable via the platform console.