SKOLE-STUD — Student Management Module
Module ID:SKOLE-STUD | Version: 1.0 | Status: ActiveProducts: Teacher App (assigned students) · Web App (full CRUD) · Parent App (own child profile)
1. Overview
Scope In
- Full student CRUD for web admin (create, update, archive)
- Teacher: view list of assigned students, view individual student detail
- Parent: view their child’s profile (read via Auth response)
- Guardian and address management per student
Scope Out
- Academic transcripts / grades
- Timetable assignment
2. Requirements
Functional Requirements (FR)
What the module must DO — actions, behaviors, and outcomes.- SKOLE-STUD-FR001: The module shall allow admins to create student records with comprehensive personal, academic, and contact information.
- SKOLE-STUD-FR002: The module shall enable admins to update student info and change their enrollment status.
- SKOLE-STUD-FR003: The module shall allow admins to archive students, capturing both an archive reason and the date.
- SKOLE-STUD-FR004: The module shall provide student filtering by grade, status, and name.
- SKOLE-STUD-FR005: The module shall allow teachers to view only their list of assigned students.
- SKOLE-STUD-FR006: The module shall enable admins to manage student guardian and address records.
- SKOLE-STUD-FR007: The module shall allow admins to reset a student’s parent PIN for application access.
- SKOLE-STUD-FR008: The module shall enforce that a student’s roll number is unique within its school.
Non-Functional Requirements (NFR)
How well the module must do it — performance, security, and reliability.- SKOLE-STUD-NFR001: The module shall perform multi-tenant isolation by scoping all student queries strictly to the
skole_id. - SKOLE-STUD-NFR002: The module shall behave predictably by allowing archived students to be filtered out of default lists to maintain registry cleanliness.
- SKOLE-STUD-NFR003: The module shall ensure that student detail retrieval is performant to support real-time application features like attendance marking.
Constraints
Rules and boundaries — tech choices and platform restrictions.- C001: We must treat the student registry as the core dependency for all other academic modules (Attendance, Diary, Activities).
- C002: We must use a junction table (
staff_student) for staff assignments to support many-to-many relationships where needed.
3. Sub-modules / Backlog
4. Logical Implementation
Student Status State Machine
Teacher Assigned Students Flow
Admin Student Listing
5. UI Requirements
Teacher App
Components:
Web App
Parent App
6. Conditional Expressions
7. Internal Module Connections
8. Database Tables
9. API Endpoints Summary
10. Detailed Endpoint Documentation (12-Section Format)
PARENT-01: List Parent’s Children
Section 1: Endpoint Summary
Returns all children/students linked to a parent account. Essential for multi-child family support, providing quick access to all enrolled children.Section 2: HTTP Details
- HTTP Method: GET
- Endpoint URL:
/parent-app/student - Content-Type:
application/json - Authentication: JWT Bearer Token (Parent)
- Rate Limit: 100 requests per minute
Section 3: Path Parameters
NoneSection 4: Query Parameters
Section 5: Request Body Schema
Empty (GET request)Section 6: Response Schema (Success - 200)
Section 7: Error Responses
401 - UnauthorizedSection 8: Implementation Examples
JavaScript:Section 9: Database Context
Primary Table:students Join Tables: student_guardian, student_address
Query Pattern:
Section 10: Business Logic & Validations
Validation:- JWT must contain valid parent_id
- Query must be scoped to parent’s school (skole_id)
- Status filter validates against enum: [active, inactive, archived]
- Extract parent_id from JWT
- Load parent’s skole_id for school isolation
- Build dynamic WHERE clause based on filters
- Query students with guardian and address joins
- Return paginated results
Section 11: Related Endpoints
- GET
/parent-app/student/:id- Get specific child detail - PUT
/parent-app/student/:id- Update child info - GET
/parent-app/student/search- Search children
Section 12: Response Summary Table
PARENT-02: Get Child Detail
Section 1: Endpoint Summary
Fetches complete profile of a specific child including personal info, guardians, address, and academic details.Section 2: HTTP Details
- HTTP Method: GET
- Endpoint URL:
/parent-app/student/:id - Authentication: JWT Bearer Token (Parent)
Section 3: Path Parameters
Section 5: Request Body Schema
Empty (GET request)Section 6: Response Schema (Success - 200)
Section 7: Error Responses
404 - Student Not FoundSection 8: Implementation Examples
JavaScript:Section 9: Database Context
Query joins: students + student_guardian + student_addressSection 10: Business Logic & Validations
Verify parent_id has access to this student_id.Section 11: Related Endpoints
- GET
/parent-app/student- List all children - PUT
/parent-app/student/:id- Update child
Section 12: Response Summary Table
PARENT-03: Update Child Info
Section 1: Endpoint Summary
Parents can update child’s profile information (emergency contact, address, medical info).Section 2: HTTP Details
- HTTP Method: PUT
- Endpoint URL:
/parent-app/student/:id - Authentication: JWT Bearer Token (Parent)
Section 3: Path Parameters
Section 5: Request Body Schema
Section 6: Response Schema (Success - 200)
Section 7: Error Responses
400 - Validation ErrorSection 8: Implementation Examples
JavaScript:Section 9: Database Context
Updates: students, student_guardian, student_address tablesSection 10: Business Logic & Validations
Verify parent access, validate blood group enum, check school isolation.Section 11: Related Endpoints
- GET
/parent-app/student/:id- Get current info - PATCH endpoints for partial updates
Section 12: Response Summary Table
PARENT-04: Archive Child Record
Section 1: Endpoint Summary
Parents can remove/archive a child from their profile (when child transfers schools).Section 2: HTTP Details
- HTTP Method: DELETE
- Endpoint URL:
/parent-app/student/:id - Authentication: JWT Bearer Token (Parent)
Section 5: Request Body Schema
Section 6: Response Schema (Success - 200)
Section 8: Implementation Examples
JavaScript:Section 9: Database Context
Sets status = ‘archived’, records archive_reason and archive_dateSection 12: Response Summary Table
PARENT-05: Search Children
Section 1: Endpoint Summary
Search children by name, roll number, or class with fuzzy matching support.Section 2: HTTP Details
- HTTP Method: GET
- Endpoint URL:
/parent-app/student/search - Authentication: JWT Bearer Token (Parent)
Section 4: Query Parameters
Section 6: Response Schema (Success - 200)
Section 8: Implementation Examples
JavaScript:Section 12: Response Summary Table
TEACHER-01: List Assigned Students
Section 1: Endpoint Summary
Teachers retrieve list of students assigned to their classes.Section 2: HTTP Details
- HTTP Method: GET
- Endpoint URL:
/teachers-app/student - Authentication: JWT Bearer Token (Staff)
Section 4: Query Parameters
Section 6: Response Schema (Success - 200)
Section 8: Implementation Examples
JavaScript:Section 9: Database Context
Query via staff_student junction table:Section 10: Business Logic & Validations
Load students only through staff_student assignments (many-to-many).Section 11: Related Endpoints
- GET
/teachers-app/student/:id- Student detail - POST
/teachers-app/student- Create new student - PUT
/teachers-app/student/:id- Update student
Section 12: Response Summary Table
TEACHER-02: Get Student Detail
Section 1: Endpoint Summary
Fetch complete profile of a student assigned to teacher’s class.Section 2: HTTP Details
- HTTP Method: GET
- Endpoint URL:
/teachers-app/student/:id - Authentication: JWT Bearer Token (Staff)
Section 3: Path Parameters
Section 6: Response Schema (Success - 200)
Section 7: Error Responses
403 - Not In ClassSection 8: Implementation Examples
JavaScript:Section 12: Response Summary Table
TEACHER-03: Update Student Info
Section 1: Endpoint Summary
Teachers can update student information like attendance status or academic notes.Section 2: HTTP Details
- HTTP Method: PUT
- Endpoint URL:
/teachers-app/student/:id - Authentication: JWT Bearer Token (Staff)
Section 5: Request Body Schema
Section 6: Response Schema (Success - 200)
Section 8: Implementation Examples
JavaScript:Section 12: Response Summary Table
TEACHER-04: Create Student Record
Section 1: Endpoint Summary
Teachers can create new student records in their assigned classes (for late admissions or transfers).Section 2: HTTP Details
- HTTP Method: POST
- Endpoint URL:
/teachers-app/student - Authentication: JWT Bearer Token (Staff)
Section 5: Request Body Schema
Section 6: Response Schema (Success - 201)
Section 7: Error Responses
400 - Duplicate Roll NumberSection 8: Implementation Examples
JavaScript:Section 12: Response Summary Table
ADMIN-01: List All Students (Web App)
Section 1: Endpoint Summary
Admin view of all students in school with advanced filtering, sorting, and pagination.Section 2: HTTP Details
- HTTP Method: GET
- Endpoint URL:
/web-app/student - Authentication: JWT Bearer Token (Admin)
Section 4: Query Parameters
Section 6: Response Schema (Success - 200)
Section 8: Implementation Examples
JavaScript:Section 9: Database Context
Dynamic WHERE clause builder:Section 10: Business Logic & Validations
Validation:- Admin must belong to school (skole_id match)
- Status, class, section must be valid enums
- Pagination: skip
>= 0, take<= 100 - Search applies fuzzy matching
- Build dynamic WHERE filters
- Apply school isolation
- Count total records matching filters
- Fetch paginated results
- Return with pagination metadata
Section 11: Related Endpoints
- GET
/web-app/student/:id- Student detail - POST
/web-app/student- Create student - PUT
/web-app/student/:id- Update student - POST
/web-app/student/bulk-upload- Bulk import
Section 12: Response Summary Table
ADMIN-02: Get Student Detail (Web App)
Section 1: Endpoint Summary
Complete admin view of student profile with all linked data: guardians, addresses, staff assignments, academic info.Section 2: HTTP Details
- HTTP Method: GET
- Endpoint URL:
/web-app/student/:id - Authentication: JWT Bearer Token (Admin)
Section 6: Response Schema (Success - 200)
Section 8: Implementation Examples
JavaScript:Section 12: Response Summary Table
ADMIN-03: Create Student
Section 1: Endpoint Summary
Admin creates new student record with comprehensive profile including guardians, address, and class assignment.Section 2: HTTP Details
- HTTP Method: POST
- Endpoint URL:
/web-app/student - Authentication: JWT Bearer Token (Admin)
Section 5: Request Body Schema
Section 6: Response Schema (Success - 201)
Section 7: Error Responses
400 - Duplicate Roll NumberSection 8: Implementation Examples
JavaScript:Section 9: Database Context
Inserts into:- students table
- student_guardian table
- student_address table
Section 10: Business Logic & Validations
Validation:- Roll number unique within class
- Class exists and belongs to school
- Guardian phone valid format
- DOB must be in past
- Gender from enum
- Required fields present
- Validate roll number uniqueness in class
- Check class exists in school
- Create student record
- Create guardians record
- Create address record
- Return new student ID
Section 11: Related Endpoints
- GET
/web-app/student- List students - PUT
/web-app/student/:id- Update student - DELETE
/web-app/student/:id- Delete student
Section 12: Response Summary Table
ADMIN-04: Update Student
Section 1: Endpoint Summary
Admin updates student profile including personal details, guardians, and addresses.Section 2: HTTP Details
- HTTP Method: PUT
- Endpoint URL:
/web-app/student/:id - Authentication: JWT Bearer Token (Admin)
Section 5: Request Body Schema
Section 6: Response Schema (Success - 200)
Section 8: Implementation Examples
JavaScript:Section 12: Response Summary Table
ADMIN-05: Delete Student
Section 1: Endpoint Summary
Admin permanently deletes student record (soft delete: archives with reason).Section 2: HTTP Details
- HTTP Method: DELETE
- Endpoint URL:
/web-app/student/:id - Authentication: JWT Bearer Token (Admin)
Section 5: Request Body Schema
Section 6: Response Schema (Success - 200)
Section 8: Implementation Examples
JavaScript:Section 12: Response Summary Table
ADMIN-06: Bulk Upload Students
Section 1: Endpoint Summary
Admin imports multiple students at once from CSV/Excel file. Supports complex guardian and address data with validation.Section 2: HTTP Details
- HTTP Method: POST
- Endpoint URL:
/web-app/student/bulk-upload - Content-Type:
multipart/form-data - Authentication: JWT Bearer Token (Admin)
Section 5: Request Body Schema
Section 6: Response Schema (Success - 200)
Section 7: Error Responses
413 - File Too LargeSection 8: Implementation Examples
JavaScript (FormData):Section 9: Database Context
Process:- Parse file (CSV/Excel reader)
- Validate all rows first
- If dry_run=true, stop here
- Wrap inserts in transaction
- Create students, guardians, addresses atomically
Section 10: Business Logic & Validations
Pre-validation:- File format: CSV or Excel only
- File size: max 10MB
- Column headers match expected schema
- Required fields: first_name, last_name, roll_no, class_id, dob
- Roll number unique within class
- Class exists in school
- Phone format valid (or null)
- DOB in past
- Gender from enum
- All rows: all-or-nothing (atomic)
- If any row fails: rollback all
- Return detailed error list for partial failures
Section 11: Related Endpoints
- POST
/web-app/student- Single student creation - GET
/web-app/student- List students
Section 12: Response Summary Table
| 422 ❌ | Validation failed | VALIDATION_FAILED | Row errors |