School Management System
Technical Blueprint
An interactive exploration of the SMART360 architecture. Designed for the Kenyan Competency-Based Curriculum (CBC), this system employs strict Role-Based Access Control (RBAC) and real-time data synchronization to serve Administrators, Teachers, Parents, and Students.
1. Core Architecture & Stack
The foundation of SMART360 is built on modern, scalable technologies designed for performance and real-time responsiveness. We leverage a serverless-first approach with Firebase to handle the complex, real-time data needs of a busy school environment.
Frontend: React / TS
Single-Page Application (SPA)
Chosen for its ability to handle complex, dynamic dashboards. TypeScript ensures type safety across the vast CBC data models.
Styling: Tailwind CSS
Utility-First Framework
Ensures rapid, mobile-first responsive design. Essential for Parents accessing portals via mobile phones.
Database: Firestore
NoSQL Document Store
Provides real-time sync (marks appear instantly) and flexible schemas for evolving CBC assessment structures.
Auth: Firebase Auth
Identity Management
Manages secure sign-ins and provides the critical `userId` used to enforce data isolation policies.
Logic: Node.js / Express
Backend API
Handles complex business logic (e.g., student creation sequence) and report generation away from the client.
2. User Roles & Authentication
Security is paramount. Users cannot self-register; strict onboarding ensures only authorized personnel access the system. The login flow automatically directs users to their specific dashboard based on their role. The administrative roles are carefully segregated to limit blast radius and enforce the principle of least privilege.
🔐 Login Logic Enforcement
User Enters Credentials
Auth Check (Firebase)
First Login?
Force Password Change
Role-Based Redirect
Admin / Teacher / Parent / Secretary / Headteacher
Admin (System Lead)
System ConfigResponsible for system-wide configuration, security, initial user provisioning, and high-level data access control.
- Define roles and permissions (RBAC).
- Initial setup of classes, terms, and subjects.
- Manage global system settings.
- Audit user activity logs.
Secretary (Finance & Operations)
Financial OpsHandles all student lifecycle administration, fee collection, and operational data entry. Restricted from system configuration.
- Process and record fee payments.
- Generate fee status reports and invoices.
- Student enrollment and data management.
- Manage school calendar events and alerts.
Headteacher / Principal
Oversight & ApprovalHigh-level supervisory role with comprehensive view-only access to all academic and financial data for strategic decision-making.
- Approve final report cards before release.
- View school-wide performance dashboards.
- Access all staff and student records (read-only).
- Sign off on curriculum changes.
Teacher (Academic Lead)
Class & MarkingFocused on assigned subjects and classes. Primary responsibility is marking, assessment entry, and generating key academic reports.
- Enter and manage student assessment marks.
- Access class register and attendance tools.
- View performance analysis for assigned students.
- Generate and Download Merit List (NEW).
Parent (Guardian)
Read-OnlyAccount automatically linked to their children's records. Read-only access to monitoring tools and communication channels, plus document download.
- View performance reports for linked children.
- Check current fee balance and payment history.
- Respond to communications from teachers.
- Download Report Card (NEW).
3. CBC Data Model
Explore the database schema designed to support the CBC structure. Select a collection on the left to view its fields, rationale, and relationships.
Select a collection to view schema details
4. Role-Based Dashboards
Each user role sees a custom interface. Explore the features and hypothetical analytics for each dashboard below.
Overview Modules
-
850Students
-
41Staff (Excl. Librarian)
-
KES 1.2MPending Fees
Analytics: Fee Collection Status
As the System Lead, the Admin sees a high-level overview of system health and critical financial metrics, including overall fee arrears (distinguishing them from the Secretary's transactional focus).
System Configuration
Manage backend settings and user roles.
Student Records
Add new students with mandatory parent email.
5. Backend Logic & Security
The backend API handles critical business logic to ensure data integrity. Below is the mandatory sequence for creating a student, which automatically links parents.
⚙️ POST /api/students Sequence
Validate Input
Check Name, DOB, Class ID. If Grade 3+, enforce UPI & Assessment Number.
Check Parent Email
Query `users` table. Does the email exist?
Create Parent (If New)
If email is new: Create User. Role='Parent'. Status='Active'. Generate default password.
Create Student Record
Save student details to `students` collection.
Link Parent & Student
Create entry in `parent_student` table mapping the two IDs.
🔒 Firestore Security Rules (RLS)
allow read, write: if
request.auth.uid == resource.data.teacherId;
allow read: if
get(/databases/$(database)/documents/users/$(request.auth.uid)).data.role in ['Admin', 'Headteacher'];
allow read: if
exists(/databases/$(database)/documents/parent_student/$(request.auth.uid)_$(resource.data.studentId));
allow write: if
get(/databases/$(database)/documents/users/$(request.auth.uid)).data.role == 'Secretary';